RFilePlugin Class Reference

class RFilePlugin : private RFile

Inherits from

Public Member Functions
RFilePlugin(TFsPluginRequest &, TBool)
~RFilePlugin()
IMPORT_C TIntAdoptFromClient()
IMPORT_C TIntAtt(TUint &)
IMPORT_C TIntChangeMode(TFileMode)
IMPORT_C voidClose()
IMPORT_C TIntCreate(const TDesC &, TUint)
IMPORT_C TIntFlush()
IMPORT_C TIntLock(TInt64, TInt64)
IMPORT_C TIntModified(TTime &)
IMPORT_C TIntOpen(const TDesC &, TUint)
IMPORT_C TIntRead(TInt64, TDes8 &)
IMPORT_C TIntRead(TInt64, TDes8 &, TInt)
IMPORT_C TIntRename(const TDesC &)
IMPORT_C TIntReplace(const TDesC &, TUint)
IMPORT_C TIntSeek(TSeek, TInt64 &)
IMPORT_C TIntSet(const TTime &, TUint, TUint)
IMPORT_C TIntSetAtt(TUint, TUint)
IMPORT_C TIntSetModified(const TTime &)
IMPORT_C TIntSetSize(TInt64)
IMPORT_C TIntSize(TInt64 &)
IMPORT_C TIntTemp(const TDesC &, TFileName &, TUint)
IMPORT_C TIntTransferToClient()
IMPORT_C TIntUnLock(TInt64, TInt64)
IMPORT_C TIntWrite(TInt64, const TDesC8 &)
IMPORT_C TIntWrite(TInt64, const TDesC8 &, TInt)
Protected Member Functions
voidCloseSubSession(TInt)
TInt CreateSubSession(const RSessionBase &, TInt, const TIpcArgs &)
TInt SendReceive(TInt, const TIpcArgs &)
Private Member Functions
RFilePlugin()
RFilePlugin(const RFilePlugin &)
voidSetHandle(TInt)
voidSetSubSessionHandle(TInt)
RFilePlugin &operator=(const RFilePlugin &)
Inherited Functions
RFile::Adopt(RFs &,TInt)
RFile::AdoptFromClient(const RMessage2 &,TInt,TInt)
RFile::AdoptFromCreator(TInt,TInt)
RFile::AdoptFromServer(TInt,TInt)
RFile::BlockMap(SBlockMapInfo &,TInt64 &,TInt64,TInt)const
RFile::Clamp(RFileClamp &)
RFile::Create(RFs &,const TDesC &,TUint)
RFile::Drive(TInt &,TDriveInfo &)const
RFile::Duplicate(const RFile &,TOwnerType)
RFile::DuplicateHandle(TInt &)const
RFile::Flush(TRequestStatus &)
RFile::FullName(TDes &)const
RFile::Lock(TInt,TInt)const
RFile::Name(TDes &)const
RFile::Open(RFs &,const TDesC &,TUint)
RFile::Read(TDes8 &)const
RFile::Read(TDes8 &,TInt)const
RFile::Read(TDes8 &,TInt,TRequestStatus &)const
RFile::Read(TDes8 &,TRequestStatus &)const
RFile::Read(TInt,TDes8 &)const
RFile::Read(TInt,TDes8 &,TInt)const
RFile::Read(TInt,TDes8 &,TInt,TRequestStatus &)const
RFile::Read(TInt,TDes8 &,TRequestStatus &)const
RFile::ReadCancel()const
RFile::ReadCancel(TRequestStatus &)const
RFile::Replace(RFs &,const TDesC &,TUint)
RFile::Seek(TSeek,TInt &)const
RFile::SetSize(TInt)
RFile::Size(TInt &)const
RFile::Temp(RFs &,const TDesC &,TFileName &,TUint)
RFile::TransferToClient(const RMessage2 &,TInt)const
RFile::TransferToProcess(RProcess &,TInt,TInt)const
RFile::TransferToServer(TIpcArgs &,TInt,TInt)const
RFile::UnLock(TInt,TInt)const
RFile::Write(TInt,const TDesC8 &)
RFile::Write(TInt,const TDesC8 &,TInt)
RFile::Write(TInt,const TDesC8 &,TInt,TRequestStatus &)
RFile::Write(TInt,const TDesC8 &,TRequestStatus &)
RFile::Write(const TDesC8 &)
RFile::Write(const TDesC8 &,TInt)
RFile::Write(const TDesC8 &,TInt,TRequestStatus &)
RFile::Write(const TDesC8 &,TRequestStatus &)
RSubSessionBase::CreateAutoCloseSubSession(RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt)
RSubSessionBase::RSubSessionBase()
RSubSessionBase::Send(TInt)const
RSubSessionBase::Send(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt)const
RSubSessionBase::SendReceive(TInt,TRequestStatus &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSubSessionBase::Session()const
RSubSessionBase::SubSessionHandle()const
Private Attributes
TPluginSessionHelper iSessionHelper

Constructor & Destructor Documentation

RFilePlugin(TFsPluginRequest &, TBool)

IMPORT_CRFilePlugin(TFsPluginRequest &aRequest,
TBoolaDirectToDrive = EFalse
)

Parameters

TFsPluginRequest & aRequest
TBool aDirectToDrive = EFalse

RFilePlugin()

RFilePlugin()[private]

RFilePlugin(const RFilePlugin &)

RFilePlugin(const RFilePlugin &)[private]

Parameters

const RFilePlugin &

~RFilePlugin()

IMPORT_C~RFilePlugin()

Member Functions Documentation

AdoptFromClient()

IMPORT_C TIntAdoptFromClient()

Att(TUint &)

IMPORT_C TIntAtt(TUint &aAttValue)const

Gets the file's attributes.

KEntryAttNormal

Parameters

TUint & aAttValueA bitmask which, on return, contains the file s attributes. For more information, see KEntryAttNormal and the other file/directory attributes.

ChangeMode(TFileMode)

IMPORT_C TIntChangeMode(TFileModeaNewMode)

Switches an open file's access mode between EFileShareExclusive and EFileShareReadersOnly.

This allows or disallows read-only access without having to close and re-open the file.

capability
Dependent If the path starts with /Resource then capability DiskAdmin is required

Parameters

TFileMode aNewModeThe new access mode.

Close()

IMPORT_C voidClose()

Closes the file.

Any open files are closed when the file server session is closed.

Close() is guaranteed to return, and provides no indication whether it completed successfully or not. When closing a file you have written to, you should ensure that data is committed to the file by invoking RFile::Flush() before closing. If Flush() completes successfully, Close() is essentially a no-operation.

CloseSubSession(TInt)

voidCloseSubSession(TIntaFunction)[protected]

Parameters

TInt aFunction

Create(const TDesC &, TUint)

IMPORT_C TIntCreate(const TDesC &aName,
TUintaFileMode
)

Parameters

const TDesC & aName
TUint aFileMode

CreateSubSession(const RSessionBase &, TInt, const TIpcArgs &)

TInt CreateSubSession(const RSessionBase &aSession,
TIntaFunction,
const TIpcArgs &aArgs
)[protected]

Creates a new sub-session within an existing session.

Parameters

const RSessionBase & aSessionThe session to which this sub-session will belong.
TInt aFunctionThe opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
const TIpcArgs & aArgsThe message arguments.

Flush()

IMPORT_C TIntFlush()

Commits data to the storage device and flushes internal buffers without closing the file.

Although RFile::Close() also flushes internal buffers, it is often useful to call Flush() before a file is closed. This is because Close() returns no error information, so there is no way of telling whether the final data was written to the file successfully or not. Once data has been flushed, Close() is effectively a no-operation.

Lock(TInt64, TInt64)

IMPORT_C TIntLock(TInt64aPos,
TInt64aLength
)const

Parameters

TInt64 aPos
TInt64 aLength

Modified(TTime &)

IMPORT_C TIntModified(TTime &aTime)const

Gets local date and time the file was last modified, in universal time.

Parameters

TTime & aTimeOn return, contains the date and time the file was last modified in UTC.

Open(const TDesC &, TUint)

IMPORT_C TIntOpen(const TDesC &aName,
TUintaMode
)

Parameters

const TDesC & aName
TUint aMode

Read(TInt64, TDes8 &)

IMPORT_C TIntRead(TInt64aPos,
TDes8 &aDes
)const

Parameters

TInt64 aPos
TDes8 & aDes

Read(TInt64, TDes8 &, TInt)

IMPORT_C TIntRead(TInt64aPos,
TDes8 &aDes,
TIntaLength
)const

Parameters

TInt64 aPos
TDes8 & aDes
TInt aLength

Rename(const TDesC &)

IMPORT_C TIntRename(const TDesC &aNewName)

Renames a file.

If aNewName specifies a different directory to the one in which the file is currently located, then the file is moved.

No other process may have access to the file, that is, the file must have been opened in EFileShareExclusive share mode, or an error is returned. The file must have been opened for writing (using EFileWrite access mode). An error is returned if a file with the new filename already exists in the target directory.

The file or directory may not be moved to another device by this means, either explicitly (by another drive specified in the name) or implicitly (because the directory has been mapped to another device with RFs::SetSubst()).

Note that the function builds up the new file specification by using all of the path components specified in aNewName (directory path, filename and extension), then adding any missing components from the current file specification, and finally adding any missing components from the session path. A consequence of this is that you cannot rename a file to remove its extension. An alternative to this function is RFs::Rename() which renames the file using the new name as provided.

capability
Dependent If aNewName starts with /Sys then capability Tcb is required
capability
Dependent If aNewName starts with /Resource then capability Tcb is required
capability
Dependent If aNewName starts with /Private and does not match this process' SID then AllFiles capability is required.

Parameters

const TDesC & aNewNameThe new file name and/or directory path. No part may contain wildcard characters or an error is returned.

Replace(const TDesC &, TUint)

IMPORT_C TIntReplace(const TDesC &aName,
TUintaFileMode
)

Parameters

const TDesC & aName
TUint aFileMode

Seek(TSeek, TInt64 &)

IMPORT_C TIntSeek(TSeekaMode,
TInt64 &aPos
)const

Parameters

TSeek aMode
TInt64 & aPos

SendReceive(TInt, const TIpcArgs &)

TInt SendReceive(TIntaFunction,
const TIpcArgs &aArgs
)const [protected]

Sends a message to the server and waits synchronously for a reply.

An opcode specifies the service required. A set of message arguments is passed that can be used to specify client addresses, which the server can use to read from and write to the client address space.

Note that this function will only fail if the server itself fails or environmental errors occur in the server. All requests made using this function are guaranteed to reach the server. This means that all synchronous client requests (typically those that return void) should be routed through this synchronous variant of SendReceive().

Parameters

TInt aFunctionThe opcode specifying the requested service.
const TIpcArgs & aArgsThe message arguments.

Set(const TTime &, TUint, TUint)

IMPORT_C TIntSet(const TTime &aTime,
TUintaSetAttMask,
TUintaClearAttMask
)

Sets the file s attributes, and the date and time it was last modified.

It combines the functionality of SetAtt() and SetModified()

An attempt to set or clear the KEntryAttDir, KEntryAttVolume or KEntryAttRemote attributes have no effect.

panic
FSCLIENT 21 if the same attribute bit is set in both bitmasks.
RFile::SetModified RFile::SetAtt

Parameters

const TTime & aTimeThe new date and time the file was last modified. UTC date and time should be used.
TUint aSetAttMaskA bitmask indicating the file attributes to be set
TUint aClearAttMaskA bitmask indicating the attributes to be cleared. For more information see KEntryAttNormal, and the other file/directory attributes.

SetAtt(TUint, TUint)

IMPORT_C TIntSetAtt(TUintaSetAttMask,
TUintaClearAttMask
)

Sets or clears file attributes using two bitmasks.

The first mask controls which attributes are set. The second controls which attributes are cleared.

Notes:

1. The file must have been opened for writing, or an error is returned.

2. A panic is raised if any attribute is specified in both bitmasks.

3. An attempt to set or clear the KEntryAttDir, KEntryAttVolume or KEntryAttRemote attributes have no effect.

4. The new attribute values take effect when the file is flushed or closed (which implies a flush).

panic
FSCLIENT 21 if the same attribute bit is set in both bitmasks.

Parameters

TUint aSetAttMaskA bitmask indicating the file attributes to be set
TUint aClearAttMaskA bitmask indicating the attributes to be cleared. For more information see KEntryAttNormal, and the other file/directory attributes.

SetHandle(TInt)

voidSetHandle(TIntaHandle)[private]

Parameters

TInt aHandle

SetModified(const TTime &)

IMPORT_C TIntSetModified(const TTime &aTime)

Sets the date and time the file was last modified. UTC date and time should be used.

Notes:

1. The file must have been opened for writing, or an error is returned.

2. The new modified time takes effect when the file is flushed or closed (which implies a flush).

Parameters

const TTime & aTimeThe new date and time the file was last modified, in universal time.

SetSize(TInt64)

IMPORT_C TIntSetSize(TInt64aSize)

Parameters

TInt64 aSize

SetSubSessionHandle(TInt)

voidSetSubSessionHandle(TIntaHandle)[private]

Parameters

TInt aHandle

Size(TInt64 &)

IMPORT_C TIntSize(TInt64 &aSize)const

Parameters

TInt64 & aSize

Temp(const TDesC &, TFileName &, TUint)

IMPORT_C TIntTemp(const TDesC &aPath,
TFileName &aName,
TUintaFileMode
)

Parameters

const TDesC & aPath
TFileName & aName
TUint aFileMode

TransferToClient()

IMPORT_C TIntTransferToClient()

UnLock(TInt64, TInt64)

IMPORT_C TIntUnLock(TInt64aPos,
TInt64aLength
)const

Parameters

TInt64 aPos
TInt64 aLength

Write(TInt64, const TDesC8 &)

IMPORT_C TIntWrite(TInt64aPos,
const TDesC8 &aDes
)

Parameters

TInt64 aPos
const TDesC8 & aDes

Write(TInt64, const TDesC8 &, TInt)

IMPORT_C TIntWrite(TInt64aPos,
const TDesC8 &aDes,
TIntaLength
)

Parameters

TInt64 aPos
const TDesC8 & aDes
TInt aLength

operator=(const RFilePlugin &)

RFilePlugin &operator=(const RFilePlugin &)[private]

Parameters

const RFilePlugin &

Member Data Documentation

TPluginSessionHelper iSessionHelper

TPluginSessionHelper iSessionHelper[private]