CMountCB Class Reference

class CMountCB : public CFsDispatchObject

A file server interface class representing a mount.

An instance of this object is referred to as a mount control block.

A mount control block needs to be created for a specific volume (partition) on a drive in order to be able to access that volume. Volumes may be permanent or represent removable media. Note that removable media may also be mounted directly onto a device with no drive. Volumes can be formatted, unlike drives.

The volume represented is either a currently mounted volume in the system or, in the case of removable volumes, a volume that has been removed but still has subsession objects open.

A plug-in file system implements this class.

Inherits from

Public Member Functions
CMountCB()
~CMountCB()
TInt AddToCompositeMount(TInt)
TInt CheckDisk()
TInt CheckDisk(TInt, TAny *, TAny *)
TInt CheckFileSystemMountable()
TInt ClampFile(const TInt, const TDesC &, TAny *)
TInt ClearPassword(TMediaPassword &)
TInt ControlIO(const RMessagePtr2 &, TInt, TAny *, TAny *)
voidDecLock()
voidDeleteL(const TDesC &)
voidDirOpenL(const TDesC &, CDirCB *)
voidDismounted()
TDrive &Drive()
voidEntryL(const TDesC &, TEntry &)
TInt ErasePassword()
voidFileOpenL(const TDesC &, TUint, TFileOpen, CFileCB *)
TInt FileSystemClusterSize()
voidFileSystemName(TDes &)
TInt FileSystemSubType(TDes &)
voidFinaliseMountL()
voidFinaliseMountL(TInt, TAny *, TAny *)
TInt ForceRemountDrive(const TDesC8 *, TInt, TUint)
TInt GetCurrentFreeSpaceAvailable(TInt64 &)
TInt GetFileUniqueId(const TDesC &, TInt64 &)
voidGetLongNameL(const TDesC &, TDes &)
TInt GetMaxSupportedFileSize(TUint64 &)
TBool GetNotifyUser()
voidGetShortNameL(const TDesC &, TDes &)
voidIncLock()
IMPORT_C voidInitL(TDrive &, CFileSystem *)
TBool IsCurrentMount()
IMPORT_C TIntIsFileClamped(const TInt64)
IMPORT_C voidIsFileInRom(const TDesC &, TUint8 *&)
TInt IsMountFinalised(TBool &)
TInt LocalBufferSupport(CFileCB *)
TInt LocalDrive(TBusLocalDrive *&)
TInt Lock(TMediaPassword &, TMediaPassword &, TBool)
TInt LockStatus()
TBool Locked()
IMPORT_C TBoolMatchEntryAtt(TUint, TUint)
voidMkDirL(const TDesC &)
TInt MountControl(TInt, TInt, TAny *)
voidMountL(TBool)
TInt MountedVolumeSize(TUint64 &)
TInt NoOfClamps()
TInt ProxyDrive(CProxyDrive *&)
voidRawReadL(TInt64, TInt, const TAny *, TInt, const RMessagePtr2 &)
voidRawWriteL(TInt64, TInt, const TAny *, TInt, const RMessagePtr2 &)
TInt ReMount()
voidReadSection64L(const TDesC &, TInt64, TAny *, TInt, const RMessagePtr2 &)
voidReadSectionL(const TDesC &, TInt, TAny *, TInt, const RMessagePtr2 &)
voidRenameL(const TDesC &, const TDesC &)
voidReplaceL(const TDesC &, const TDesC &)
TInt RequestFreeSpace(TUint64 &)
voidRmDirL(const TDesC &)
TInt ScanDrive()
TInt ScanDrive(TInt, TAny *, TAny *)
IMPORT_C voidSetDiskSpaceChange(TInt64)
voidSetDrive(TDrive *)
voidSetEntryL(const TDesC &, const TTime &, TUint, TUint)
voidSetNotifyOff()
voidSetNotifyOn()
voidSetVolumeL(TDes &)
voidSetVolumeName(HBufC *)
TInt64 Size()
TInt Spare1(TInt, TAny *, TAny *)
TInt Spare2(TInt, TAny *, TAny *)
TInt Spare3(TInt, TAny *, TAny *)
TInt UnclampFile(RFileClamp *)
TInt Unlock(TMediaPassword &, TBool)
voidVolumeL(TVolumeInfo &)
HBufC &VolumeName()
IMPORT_C TBooloperator!=(const CMountCB &)
Protected Member Functions
IMPORT_C CFileSystem *FileSystem()
IMPORT_C TIntGetInterface(TInt, TAny *&, TAny *)
TInt GetInterfaceTraced(TInt, TAny *&, TAny *)
TBool IsDismounted()
TInt MountNumber()
TBool ProxyDriveDismounted()
voidSetDismounted(TBool)
voidSetMountNumber(TInt)
voidSetProxyDriveDismounted()
Private Member Functions
CDirCB *NewDirL()
CFileCB *NewFileL()
CFormatCB *NewFormatL()
voidSetFileSystem(CFileSystem *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CFsDispatchObject::CFsDispatchObject()
CFsDispatchObject::Close()
CFsDispatchObject::Dispatch()
CFsDispatchObject::DoInitL(TInt)
CFsDispatchObject::DriveNumber()const
CFsDispatchObject::IsCorrectThread()
CFsDispatchObject::~CFsDispatchObject()
CFsObject::CFsObject()
CFsObject::Container()const
CFsObject::Dec()
CFsObject::DoClose()
CFsObject::Inc()
CFsObject::Name()const
CFsObject::Open()
CFsObject::SetName(const TDesC *)
CFsObject::UniqueID()const
CFsObject::~CFsObject()
Public Member Enumerations
enumTInterfaceIds {
EAddFsToCompositeMount = 0, EGetLocalDrive = 1, EFileAccessor = 2, EGetFileSystemSubType = 3, EGetClusterSize = 4, ELocalBufferSupport = 5, EAddToCompositeMount = 6, EGetProxyDrive = 7, EFileExtendedInterface = 8
}
Protected Member Enumerations
enumTMntCtlLevel {
EMountStateQuery, EMountVolParamQuery, ECheckFsMountable, ESpecificMountCtl = 0x40000000, ESpecificFsCtl = 0x40001000, EMountFsParamQuery
}
enumTMntCtlOption {
ESQ_IsMountFinalised, ESpecificMountCtlOpt = 0x40000000, ESQ_RequestFreeSpace, ESQ_GetCurrentFreeSpace, ESQ_MountedVolumeSize, ESpecificFsCtlOpt = 0x40001000, ESQ_GetMaxSupportedFileSize
}
Protected Attributes
TInt iMountNumber
TDblQue< CFileCB >iMountQ
TInt64 iSize
TUint iUniqueID
Private Attributes
CMountBody *iBody
TDrive *iDrive
TInt iLockMount
HBufC *iVolumeName

Constructor & Destructor Documentation

CMountCB()

IMPORT_CCMountCB()

~CMountCB()

IMPORT_C~CMountCB()

Member Functions Documentation

AddToCompositeMount(TInt)

TInt AddToCompositeMount(TIntaMountIndex)[inline]

Parameters

TInt aMountIndex

CheckDisk()

TInt CheckDisk()[inline, virtual]

Checks the integrity of the file system on the volume and returns an appropriate error value. The default implementation must be overridden by a derived class.

CheckDisk(TInt, TAny *, TAny *)

TInt CheckDisk(TIntaOperation,
TAny *aParam1 = NULL,
TAny *aParam2 = NULL
)[inline, virtual]

The same as original CheckDisk(), but with some parameters.

Parameters

TInt aOperation
TAny * aParam1 = NULL
TAny * aParam2 = NULL

CheckFileSystemMountable()

TInt CheckFileSystemMountable()[inline]

Check is this file system can be mounted on the drive at all. The file system implementation may, for example, read and validate the boot region without real mounting overhead.

ClampFile(const TInt, const TDesC &, TAny *)

TInt ClampFile(const TIntaDriveNo,
const TDesC &aName,
TAny *aHandle
)

Parameters

const TInt aDriveNo
const TDesC & aName
TAny * aHandle

ClearPassword(TMediaPassword &)

TInt ClearPassword(TMediaPassword &)[inline, virtual]

Clears a password from a media that supports write protection.

The default implementation must be overridden in a derived class.

Parameters

TMediaPassword &

ControlIO(const RMessagePtr2 &, TInt, TAny *, TAny *)

TInt ControlIO(const RMessagePtr2 &,
TInt,
TAny *,
TAny *
)[inline, virtual]

Low-level control IO

Parameters

const RMessagePtr2 &
TInt
TAny *
TAny *

DecLock()

voidDecLock()[inline]

Unlocks the mount by decrementing the internal lock counter.

The mount becomes locked on formatting or on the opening of a resource (a file or a directory) or raw disk subsession. A format, resource or raw disk subsession can only be opened if the mount is not locked.

DeleteL(const TDesC &)

voidDeleteL(const TDesC &aName)[pure virtual]

Deletes the specified file from the mount.

The function can assume that the file is closed.

The file name specified by aName is of the form:
    \\dirA\\dirB\\dirC\\file.ext

The extension is optional.

The function should leave on error detection, with an appropriate error code.

leave
KErrAccessDenied aName specifies a file whose attributes state that the file is read-only or aName specifies a directory.

Parameters

const TDesC & aNameA reference to a descriptor containing the full path name of the file that will be removed.

DirOpenL(const TDesC &, CDirCB *)

voidDirOpenL(const TDesC &aName,
CDirCB *aDir
)[pure virtual]

Customises the opening of a directory on the mount.

The function is called internally, and the directory will have been created and initialised by the calling function. Any customisation specific to a file system should be implemented in this function.

Note that aName is of the form
    \\dirA\\dirB\\dirC\\file.ext

where \dirA\dirB\dirC\ is the directory to be opened and file.ext is an optional entry name and extension.

After successful completion of the function, the directory control block pointer will be added to the file server global directories container.

The function should leave with a suitable error code if it cannot complete successfully for any reason.

Parameters

const TDesC & aNameA reference to a descriptor containing the full name of the directory that will be opened.
CDirCB * aDirPoints to a directory control block which will, on success, represent the open directory.

Dismounted()

voidDismounted()[pure virtual]

Carries out any clean-up necessary for a volume dismount.

Dismounting a volume will always succeed, so the function does not need to return an error value. Any cached information should be discarded and no attempt should be made to access the volume. For removable media it may be that the media has already been removed. This function is called when a media change is detected.

Drive()

TDrive &Drive()const [inline]

Gets a reference to the object representing the drive on which the volume is mounted.

EntryL(const TDesC &, TEntry &)

voidEntryL(const TDesC &aName,
TEntry &anEntry
)const [pure virtual]

Gets the entry details for the specified file or directory.

anEntry should be filled with details from the file or directory with the full name aName. aName is of the form
    \\dirA\\dirB\\dirC\\entry.

Note that anEntry.iType (the entry UID) should only be set for a file whose size is greater than or equal to sizeof(TCheckedUid).

The function should leave with an appropriate error code if it cannot complete successfully for any reason.

leave
KErrPathNotFound The entry, aName, cannot be found.

Parameters

const TDesC & aNameA reference to a descriptor containing the full name of the entry whose details are required.
TEntry & anEntryOn return, a reference to the filled entry object.

ErasePassword()

TInt ErasePassword()[inline, virtual]

Erase a password from a media that supports write protection.

The default implementation must be overridden in a derived class.

FileOpenL(const TDesC &, TUint, TFileOpen, CFileCB *)

voidFileOpenL(const TDesC &aName,
TUintaMode,
TFileOpenanOpen,
CFileCB *aFile
)[pure virtual]

Customises the opening of a new or existing file on the mount.

The function is called internally (via TDrive::FileOpen()) as a result of a call by the client, and the file is created, if necessary, and opened by the calling function. However this function implements any replacement functionality, as well as any other behaviour particular to the file system.

If anOpen specifies EFileReplace (rather than EFileCreate or EFileOpen) then, if replacement functionality is required, the data contained in the file should be discarded, the archive attribute should be set, and the size of the file should be set to zero. Note that it can be assumed that if anOpen specifies EFileReplace then the file already exists.

After successful completion of the function, the file control block pointer will be added to the file server's global files container.

The function should leave with a suitable error code if it cannot be completed successfully.

leave
KErrAccessDenied aName may specify a directory, or the function may be attempting to open a file on a ROM drive.

Parameters

const TDesC & aNameThe full name of the file that will be opened.
TUint aModeThe file share mode. The following share modes are available: EFileShareExclusive; EFileShareReadersOnly; EFileShareAny; EFileShareReadersOrWriters; EFileStream; EFileStreamText; EFileRead; EFileWrite.
TFileOpen anOpenIndicatES how the file will be opened. It can be one of the following: EFileOpen; EFileCreate; EFileReplace.
CFileCB * aFilePointer to the file control block which will, on success, represent the open file.

FileSystem()

IMPORT_C CFileSystem *FileSystem()const [protected]

FileSystemClusterSize()

TInt FileSystemClusterSize()

FileSystemName(TDes &)

voidFileSystemName(TDes &aName)

Parameters

TDes & aName

FileSystemSubType(TDes &)

TInt FileSystemSubType(TDes &aName)

Parameters

TDes & aName

FinaliseMountL()

voidFinaliseMountL()[inline, virtual]

Legacy method: finalise the mount and put it to the consistent state.

FinaliseMountL(TInt, TAny *, TAny *)

voidFinaliseMountL(TIntaOperation,
TAny *aParam1 = NULL,
TAny *aParam2 = NULL
)[inline, virtual]

finalise the mount and put it to the consistent state.

Parameters

TInt aOperationdescribes finalisation operation, see RFs::TFinaliseDrvMode
TAny * aParam1 = NULLnot used, for future expansion
TAny * aParam2 = NULLnot used, for future expansion

ForceRemountDrive(const TDesC8 *, TInt, TUint)

TInt ForceRemountDrive(const TDesC8 *,
TInt,
TUint
)[inline, virtual]

Parameters

const TDesC8 *
TInt
TUint

GetCurrentFreeSpaceAvailable(TInt64 &)

TInt GetCurrentFreeSpaceAvailable(TInt64 &aFreeSpaceBytes)[inline]

Corresponds to EMountVolParamQuery. A request to obtain the _current_ amount of free space on the volume asynchronously, without blocking. Some mounts implementations can count volume free space in the background.

Parameters

TInt64 & aFreeSpaceBytesin: none; out: _current_ amount of free space on the volume.

GetFileUniqueId(const TDesC &, TInt64 &)

TInt GetFileUniqueId(const TDesC &aName,
TInt64 &aUniqueId
)

Parameters

const TDesC & aName
TInt64 & aUniqueId

GetInterface(TInt, TAny *&, TAny *)

IMPORT_C TIntGetInterface(TIntaInterfaceId,
TAny *&aInterface,
TAny *aInput
)[protected, virtual]

Return a pointer to a specified interface extension - to allow future extension of this class without breaking binary compatibility.

Parameters

TInt aInterfaceIdInterface identifier of the interface to be retrieved.
TAny *& aInterfaceA reference to a pointer that retrieves the specified interface.
TAny * aInputAn arbitrary input argument.

GetInterfaceTraced(TInt, TAny *&, TAny *)

TInt GetInterfaceTraced(TIntaInterfaceId,
TAny *&aInterface,
TAny *aInput
)[protected]

Parameters

TInt aInterfaceId
TAny *& aInterface
TAny * aInput

GetLongNameL(const TDesC &, TDes &)

voidGetLongNameL(const TDesC &aShorName,
TDes &aLongName
)[pure virtual]

Gets the long name of the file or directory associated with the given short name.

This function is used in circumstances where a file system mangles Symbian OS natural names in order to be able to store them on a file system that is not entirely compatible.

The function should leave with a suitable error code if it cannot complete successfully for any reason.

leave
KErrNotFound The entry specified by its short name cannot be found.

Parameters

const TDesC & aShorNameA reference to a descriptor containing the short name of the entry.
TDes & aLongNameOn return, a reference to a descriptor containing the long name of the entry.

GetMaxSupportedFileSize(TUint64 &)

TInt GetMaxSupportedFileSize(TUint64 &aSize)[inline]

Get Maximum file size, which is supported by the file system that has produced this mount.

Parameters

TUint64 & aSize

GetNotifyUser()

TBool GetNotifyUser()const [inline]

Tests whether the client is notified of any read or write failures.

The notification status is a property of the current session with the file server, the value of which is stored in CSessionFs::iNotifyUser. If set to true, the client will receive notifications from the file system.

Typically, this function might be used to save the current notification state prior to temporarily disabling notifiers. This allows the original notification state to be restored.

Note that GetNotifyUser() is only available once the drive has been set for the mount control block (using SetDrive()), since the notification status is held by the session and accessed via the drive.

GetShortNameL(const TDesC &, TDes &)

voidGetShortNameL(const TDesC &aLongName,
TDes &aShortName
)[pure virtual]

Gets the short name of the file or directory with the given full name.

This function is used in circumstances where a file system mangles Symbian OS natural names, in order to be able to store them on a file system that is not entirely compatible.

The function should leave with a suitable error code if it cannot complete successfully for any reason.

leave
KErrNotFound The entry specified by its long name cannot be found.

Parameters

const TDesC & aLongNameA reference to a descriptor containing the full name of the entry.
TDes & aShortNameOn return, a reference to a descriptor containing the short name of the entry.

IncLock()

voidIncLock()[inline]

Locks the mount by incrementing the internal lock counter.

The mount becomes locked on formatting or on the opening of a resource (a file or a directory) or raw disk subsession. A format, resource or raw disk subsession can only be opened if the mount is not locked.

InitL(TDrive &, CFileSystem *)

IMPORT_C voidInitL(TDrive &aDrive,
CFileSystem *apFileSystem
)

Parameters

TDrive & aDrive
CFileSystem * apFileSystem

IsCurrentMount()

TBool IsCurrentMount()const [inline]

Tests whether the mount control block represents the current mount on the associated drive.

A drive has only one mount which is accessible: the current mount. Any mount other than the current mount relates to a partition (i.e. volume) that was present on a removable media which has since been removed. The reason the mount has persisted is because resources (i.e. files/directories) are still open on it.

This function is only available when the drive has been set for the mount control block (using SetDrive()), since the current mount is held by the drive.

IsDismounted()

TBool IsDismounted()const [protected, inline]

Returns ETrue if the mount is flagged as dismounted.

IsFileClamped(const TInt64)

IMPORT_C TIntIsFileClamped(const TInt64aUniqueId)

Parameters

const TInt64 aUniqueId

IsFileInRom(const TDesC &, TUint8 *&)

IMPORT_C voidIsFileInRom(const TDesC &aFileName,
TUint8 *&aFileStart
)[virtual]

Parameters

const TDesC & aFileName
TUint8 *& aFileStart

IsMountFinalised(TBool &)

TInt IsMountFinalised(TBool &aFinalised)[inline]

Query if the mount is finalised, corresponds to the EMountStateQuery control code only.

Parameters

TBool & aFinalisedout: ETrue if the mount is finalised, EFalse otherwise.

LocalBufferSupport(CFileCB *)

TInt LocalBufferSupport(CFileCB *aFile = NULL)[inline]

Returns whether the mount (and any extensions) support file caching

Parameters

CFileCB * aFile = NULL

LocalDrive(TBusLocalDrive *&)

TInt LocalDrive(TBusLocalDrive *&aLocalDrive)[inline]

Retrieves TBusLocalDrive object associated with the mount

Parameters

TBusLocalDrive *& aLocalDrive

Lock(TMediaPassword &, TMediaPassword &, TBool)

TInt Lock(TMediaPassword &,
TMediaPassword &,
TBool
)[inline, virtual]

Locks a media which supports password protection and replaces the old password with a new one.

If aStore is set to ETrue, then the new password should be saved to the password store file, KMediaPWrdFile, using the exported file server function WriteToDisk().

The password file is used to initialise the password store on boot up, so the user does not need to be prompted for the password again if it is saved here.

The default implementation must be overridden in a derived class.

LockStatus()

TInt LockStatus()const [inline]

Gets the current lock status.

It delivers the current lock status by returning the internal lock counter.

Locked()

TBool Locked()const [inline]

Tests whether the mount is currently locked.

A mount is locked when the internal lock counter is greater than zero. On creation, the lock counter is set to zero.

The mount becomes locked on formatting or on the opening of a resource (a file or a directory) or raw disk subsession. A format, resource or raw disk subsession can only be opened if the mount is not locked.

MatchEntryAtt(TUint, TUint)

IMPORT_C TBoolMatchEntryAtt(TUintanAtt,
TUintaMatt
)const

Parameters

TUint anAtt
TUint aMatt

MkDirL(const TDesC &)

voidMkDirL(const TDesC &aName)[pure virtual]

Creates a new directory on the mount.

The directory to be created is identified through its full name in aName. The full name is in the form:
    \\dirA\\dirB\\dirC\\dirD
where dirD is the new directory to be created in \dirA\dirB\dirC\. This means that dirC is the leaf directory in which dirD will be created.

The function should leave, on error detection, with an appropriate error code.

leave
KErrPathNotFound Part of the path in aName does not exist.
leave
KErrAlreadyExists dirD already exists in \dirA\dirB\dirC\
leave
KErrAccessDenied dirD already exists but is not a directory.
leave
KErrDirFull There is no room in \dirA\dirB\dirC\ for the new entry, which is especially applicable to the root directory.

Parameters

const TDesC & aNameA reference to a descriptor containing the full name of the directory to be created.

MountControl(TInt, TInt, TAny *)

TInt MountControl(TIntaLevel,
TIntaOption,
TAny *aParam
)[inline, virtual]

Generic mount control method.

Parameters

TInt aLevelspecifies the operation to perfrom on the mount
TInt aOptionspecific option for the given operation
TAny * aParampointer to generic parameter, its meaning depends on aLevel and aOption

MountL(TBool)

voidMountL(TBoolaForceMount)[pure virtual]

Attempts to set the mount control block properties using the current mount (i.e. volume) on the associated drive.

The function should set the volume name (iVolumeName), the unique ID (iUniqueID) and the volume size (iSize) by reading and processing the current mount.

When aForceMount is set to ETrue, the properties of a corrupt volume should be forcibly stored. The classic case of when this is desirable is when a corrupt volume needs to be formatted.

The function should leave, on error detection, with an appropriate error code.

leave
KErrCorrupt The properties of the current mount on the drive were not successfully mounted due to corruption of volume information, assuming that aForceMount is not set.

Parameters

TBool aForceMountIndicates whether the properties of a corrupt volume should be stored.

MountNumber()

TInt MountNumber()const [protected, inline]

Returns the unique mount number

MountedVolumeSize(TUint64 &)

TInt MountedVolumeSize(TUint64 &aVolSizeBytes)[inline]

Corresponds to EMountVolParamQuery. A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block).

Parameters

TUint64 & aVolSizeBytesin: none; out: mounted volume size, same as TVolumeInfo::iSize

NewDirL()

CDirCB *NewDirL()const [private]

NewFileL()

CFileCB *NewFileL()const [private]

NewFormatL()

CFormatCB *NewFormatL()const [private]

NoOfClamps()

TInt NoOfClamps()

ProxyDrive(CProxyDrive *&)

TInt ProxyDrive(CProxyDrive *&aProxyDrive)[inline]

Retrieves CProxyDrive object associated with the mount

Parameters

CProxyDrive *& aProxyDrive

ProxyDriveDismounted()

TBool ProxyDriveDismounted()[protected]

RawReadL(TInt64, TInt, const TAny *, TInt, const RMessagePtr2 &)

voidRawReadL(TInt64aPos,
TIntaLength,
const TAny *aTrg,
TIntanOffset,
const RMessagePtr2 &aMessage
)const [pure virtual]

Reads the specified length of data from the specified position on the volume directly into the client thread.

It can be assumed that if this function is called, then there has been a successful mount.

This function should leave with an appropriate error code when an error is detected.

Parameters

TInt64 aPosStart position in the volume for the read operation, in bytes.
TInt aLengthThe number of bytes to be read.
const TAny * aTrgA pointer to the buffer into which data is to be read.
TInt anOffsetThe offset at which to start adding data to the read buffer.
const RMessagePtr2 & aMessage

RawWriteL(TInt64, TInt, const TAny *, TInt, const RMessagePtr2 &)

voidRawWriteL(TInt64aPos,
TIntaLength,
const TAny *aSrc,
TIntanOffset,
const RMessagePtr2 &aMessage
)[pure virtual]

Writes a specified length of data from the client thread to the volume at the specified position.

It can be assumed that if this function is called, then there has been a successful mount.

This function should leave with an appropriate error code when an error is detected.

Parameters

TInt64 aPosStart position in the volume for the write operation, in bytes.
TInt aLengthThe number of bytes to be written.
const TAny * aSrcPointer to the buffer from which data will be written.
TInt anOffsetThe offset in the buffer at which to start writing data.
const RMessagePtr2 & aMessage

ReMount()

TInt ReMount()[pure virtual]

Checks whether the mount control block represents the current mount on the associated drive.

The function should read mount information from the current volume, and check it against the mount information from this mount - typically iVolumeName and iUniqueID. If the mount information matches, the function should return KErrNone, otherwise it should return KErrGeneral.

Called by the associated TDrive object when the drive has no current mounts, which is the case on first access to the drive and following a volume change on a drive associated with removable media. In this circumstance, this function is called systematically on every mount control block owned by the drive. If ReMount() calls for all existing mount control blocks fail, the drive creates a new mount control block and calls CMountCB::MountL() on that object; the new object is added to the list of mount control blocks owned by the drive.

ReadSection64L(const TDesC &, TInt64, TAny *, TInt, const RMessagePtr2 &)

voidReadSection64L(const TDesC &aName,
TInt64aPos,
TAny *aTrg,
TIntaLength,
const RMessagePtr2 &aMessage
)

Parameters

const TDesC & aName
TInt64 aPos
TAny * aTrg
TInt aLength
const RMessagePtr2 & aMessage

ReadSectionL(const TDesC &, TInt, TAny *, TInt, const RMessagePtr2 &)

voidReadSectionL(const TDesC &aName,
TIntaPos,
TAny *aTrg,
TIntaLength,
const RMessagePtr2 &aMessage
)[pure virtual]

Reads a specified section of the file, regardless of the file's lock state.

The function should leave with a suitable error code if it cannot complete successfully for any reason.

leave
KErrEof aPos is past the end of the file.

Parameters

const TDesC & aNameA reference to a descriptor containing the full name of the file to be read from
TInt aPosThe byte position to start reading from.
TAny * aTrgA pointer to the buffer into which data is to be read.
TInt aLengthThe length of data to be read, in bytes.
const RMessagePtr2 & aMessage

RenameL(const TDesC &, const TDesC &)

voidRenameL(const TDesC &anOldName,
const TDesC &anNewName
)[pure virtual]

Renames or moves a single file or directory on the mount.

It can be used to move a file or directory since both anOldName and anNewName specify the respective entries with full names; for example,
    \\dirA\\dirB\\dirC\\oldEntryName

and

    \\dirE\\dirF\\dirG\\newEntryName

If oldEntryName is a file, it can be assumed that it is closed. If oldEntryName is a directory, it can be assumed that there are no open files in this directory. Furthermore, if newEntryName specifies a directory, it can be assumed that it is not a subdirectory of oldEntryName.

The function should leave with an appropriate error code if it cannot complete successfully for any reason.

leave
KErrAlreadyExists The new entry already exists.

Parameters

const TDesC & anOldNameA reference to a descriptor containing the full entry name of the entry to be renamed.
const TDesC & anNewNameA reference to a descriptor containing the new full entry name for the entry to be renamed.

ReplaceL(const TDesC &, const TDesC &)

voidReplaceL(const TDesC &anOldName,
const TDesC &anNewName
)[pure virtual]

Replaces one file on the mount with another.

The function can assume that both anOldName and, if it exists, anNewName contain the full file names of files, and that these files are not open.

If the file aNewName does not exist it should be created.

The file anOldName should have its contents, attributes, and the universal date and time of its last modification, copied to the file aNewName, overwriting any existing contents and attribute details. Finally anOldName should be deleted.

The function should leave with an appropriate error code if it cannot complete successfully for any reason.

Parameters

const TDesC & anOldNameA reference to a descriptor containing the full file name of the file to replace the file specified by anNewName
const TDesC & anNewNameA reference to a descriptor containing the new full file name for the entry to be replaced.

RequestFreeSpace(TUint64 &)

TInt RequestFreeSpace(TUint64 &aFreeSpaceBytes)[inline]

Corresponds to EMountVolParamQuery. Request a certain amount of free space on the volume. If _current_ amount of free space is >= than required or it is not being updated in background by the mount, returns immediately; If mount is still counting free space and If _current_ amount of free space is < than required, the caller will be blocked until mount finds enough free space or reports that the _final_ amount of free space is less than required.

Parameters

TUint64 & aFreeSpaceBytesin: number of free bytes on the volume required, out: resulted amount of free space. It can be less than required if there isn't enough free space on the volume at all.

RmDirL(const TDesC &)

voidRmDirL(const TDesC &aName)[pure virtual]

Removes the directory specified by aName (its full name) from the volume.

The directory specified by aName is in the form:
    \\dirA\\dirB\\dirC\\dirD
where dirD is the directory to be removed from \dirA\dirB\dirC\. This means that dirC is the leaf directory from which dirD should be removed.

The function can assume that the directory exists and is not read-only.

The function should leave with a suitable error code if it cannot complete successfully for any reason.

leave
KErrInUse dirD contains entries other than the parent (..) and current (.) entries.

Parameters

const TDesC & aNameA reference to a descriptor containing the full name of the directory to be removed.

ScanDrive()

TInt ScanDrive()[inline, virtual]

Scans through and corrects errors found in the volume.

The default implementation must be overridden by a derived class.

ScanDrive(TInt, TAny *, TAny *)

TInt ScanDrive(TIntaOperation,
TAny *aParam1 = NULL,
TAny *aParam2 = NULL
)[inline, virtual]

The same as original ScanDrive(), but with some parameters.

Parameters

TInt aOperation
TAny * aParam1 = NULL
TAny * aParam2 = NULL

SetDiskSpaceChange(TInt64)

IMPORT_C voidSetDiskSpaceChange(TInt64aFreeDiskSpace)

Parameters

TInt64 aFreeDiskSpace

SetDismounted(TBool)

voidSetDismounted(TBoolaDismounted = ETrue)[protected, inline]

Set the mount to be dismounted

Parameters

TBool aDismounted = ETrue

SetDrive(TDrive *)

voidSetDrive(TDrive *aDrive)[inline]

Sets a pointer to the object representing the drive on which the volume is mounted.

Parameters

TDrive * aDriveA pointer to the drive on which the volume is mounted.

SetEntryL(const TDesC &, const TTime &, TUint, TUint)

voidSetEntryL(const TDesC &aName,
const TTime &aTime,
TUintaSetAttMask,
TUintaClearAttMask
)[pure virtual]

Sets entry details for a specified file or directory.

The entry identfied by the full name descriptor aName should have its modification time and its attributes mask updated as required.

The entry receives a new universal modified time from aTime. The entry attributes are set with aSetAttMask and cleared with aClearAttMask: the bits that are set in aSetAttMask should be set in the entry attribute mask; the bits that are set in aClearAttMask should be cleared from the entry attribute mask.

The function can assume that aSetAttMask and aClearAttMask do not change the type of attribute (i.e. volume or directory). Furthermore, if aName specifies a file, it can be assumed that this file is closed.

The function should leave with an appropriate error code on error detection.

Parameters

const TDesC & aNameA reference to a descriptor containing the full name of the entry to be updated.
const TTime & aTimeA reference to the time object holding the new universal modified time for aName.
TUint aSetAttMaskAttribute mask for setting the entry's attributes.
TUint aClearAttMaskAttribute mask for clearing the entry's attributes.

SetFileSystem(CFileSystem *)

voidSetFileSystem(CFileSystem *aFS)[private]

Parameters

CFileSystem * aFS

SetMountNumber(TInt)

voidSetMountNumber(TIntaMountNumber)[protected, inline]

Parameters

TInt aMountNumber

SetNotifyOff()

voidSetNotifyOff()[inline]

SetNotifyOn()

voidSetNotifyOn()[inline]

SetProxyDriveDismounted()

voidSetProxyDriveDismounted()[protected]

SetVolumeL(TDes &)

voidSetVolumeL(TDes &aName)[pure virtual]

Sets the volume name for the mount, thus writing the new volume name to the corresponding volume.

This function should leave on error detection.

leave
KErrBadName If the specified volume name is longer than the maximum allowed length for a volume name

Parameters

TDes & aNameA reference to a descriptor containing the new volume name.

SetVolumeName(HBufC *)

voidSetVolumeName(HBufC *aName)[inline]

Sets a pointer to a heap descriptor containing the name of the mounted volume.

Parameters

HBufC * aNameA pointer to a heap descriptor containing the name of the mounted volume to be set.

Size()

TInt64 Size()const [inline]

Spare1(TInt, TAny *, TAny *)

TInt Spare1(TIntaVal,
TAny *aPtr1,
TAny *aPtr2
)

Parameters

TInt aVal
TAny * aPtr1
TAny * aPtr2

Spare2(TInt, TAny *, TAny *)

TInt Spare2(TIntaVal,
TAny *aPtr1,
TAny *aPtr2
)

Parameters

TInt aVal
TAny * aPtr1
TAny * aPtr2

Spare3(TInt, TAny *, TAny *)

TInt Spare3(TIntaVal,
TAny *aPtr1,
TAny *aPtr2
)

Parameters

TInt aVal
TAny * aPtr1
TAny * aPtr2

UnclampFile(RFileClamp *)

TInt UnclampFile(RFileClamp *aHandle)

Parameters

RFileClamp * aHandle

Unlock(TMediaPassword &, TBool)

TInt Unlock(TMediaPassword &,
TBool
)[inline, virtual]

Unlocks a media which supports password protection.

If aStore is set to ETrue then the password should be saved to the password store file specified by KMediaPWrdFile using the exported file server function WriteToDisk().

The password file is used to initialise the password store on boot up, so the user does not need to be prompted for the password again if it is saved here.

The default implementation must be overridden in a derived class.

Parameters

TMediaPassword &
TBool

VolumeL(TVolumeInfo &)

voidVolumeL(TVolumeInfo &aVolume)const [pure virtual]

Gets volume information.

The only information that the function has to supply is the free space, TVolumeInfo::iFree, since the remaining members have already been set by the calling function.

The function should leave, on error detection, with an appropriate error code.

Parameters

TVolumeInfo & aVolumeOn return, a reference to the filled volume information object.

VolumeName()

HBufC &VolumeName()const [inline]

Gets a reference to a heap descriptor containing the name of the mounted volume.

operator!=(const CMountCB &)

IMPORT_C TBooloperator!=(const CMountCB &aMount)const

Parameters

const CMountCB & aMount

Member Enumerations Documentation

Enum TInterfaceIds

Enumeration of the aInterfaceIDs used in GetInterface.

Enumerators

EAddFsToCompositeMount = 0
EGetLocalDrive = 1
EFileAccessor = 2
EGetFileSystemSubType = 3
EGetClusterSize = 4
ELocalBufferSupport = 5
EAddToCompositeMount = 6
EGetProxyDrive = 7
EFileExtendedInterface = 8

Enum TMntCtlLevel

Mount Control levels or operations to perform

Enumerators

EMountStateQuery
EMountVolParamQuery
ECheckFsMountable
ESpecificMountCtl = 0x40000000
ESpecificFsCtl = 0x40001000
EMountFsParamQuery

Enum TMntCtlOption

Mount Control options that makes sense only for certain control codes, see TMntCtlLevel

Enumerators

ESQ_IsMountFinalised

query if the mount is finalised, corresponds to the EMountStateQuery control code only. IsMountFinalised()

ESpecificMountCtlOpt = 0x40000000
ESQ_RequestFreeSpace

Corresponds to EMountVolParamQuery. Request a certain amount of free space on the volume. RequestFreeSpace()

ESQ_GetCurrentFreeSpace

Corresponds to EMountVolParamQuery. A request to obtain the _current_ amount of free space on the volume asynchronously, without blocking.

ESQ_MountedVolumeSize

Corresponds to EMountVolParamQuery. A request to obtain size of the mounted volume without blocking (CMountCB::VolumeL() can block).

ESpecificFsCtlOpt = 0x40001000
ESQ_GetMaxSupportedFileSize

Get Maximum file size, which is supported by the file system that has produced this mount.

Member Data Documentation

CMountBody * iBody

CMountBody *iBody[private]

TDrive * iDrive

TDrive *iDrive[private]

TInt iLockMount

TInt iLockMount[private]

TInt iMountNumber

TInt iMountNumber[protected]

TDblQue< CFileCB > iMountQ

TDblQue< CFileCB >iMountQ[protected]

A list of all open files on that mount. Set by the TDrive object representing the drive of which the mount resides.

TInt64 iSize

TInt64 iSize[protected]

TUint iUniqueID

TUint iUniqueID[protected]

HBufC * iVolumeName

HBufC *iVolumeName[private]