CMTPStorageMgr Class Reference

class CMTPStorageMgr : public CBase

Implements the MTP storage manager interface.

Inherits from

Public Member Functions
~CMTPStorageMgr()
IMPORT_C TUint32AllocateLogicalStorageIdL(TUint, TDriveNumber, const CMTPStorageMetaData &)
IMPORT_C TUint32AllocateLogicalStorageIdL(TUint, TUint32, const CMTPStorageMetaData &)
IMPORT_C TUint32AllocatePhysicalStorageIdL(TUint, const CMTPStorageMetaData &)
IMPORT_C TIntDeallocateLogicalStorageId(TUint, TUint32)
IMPORT_C voidDeallocateLogicalStorageIds(TUint, TUint32)
IMPORT_C TIntDeallocatePhysicalStorageId(TUint, TUint32)
IMPORT_C TUint32DefaultStorageId()
IMPORT_C TIntDriveNumber(TUint32)
IMPORT_C TInt32FrameworkStorageId(TDriveNumber)
IMPORT_C voidGetAvailableDrivesL(RArray< TDriveNumber > &)
IMPORT_C voidGetLogicalStoragesL(const TMTPStorageMgrQueryParams &, RPointerArray< const CMTPStorageMetaData > &)
IMPORT_C voidGetPhysicalStoragesL(const TMTPStorageMgrQueryParams &, RPointerArray< const CMTPStorageMetaData > &)
IMPORT_C TBoolIsReadWriteStorage(TUint32)
IMPORT_C TUint32LogicalStorageId(TUint32)
IMPORT_C TInt32LogicalStorageId(const TDesC &)
IMPORT_C TUintLogicalStorageNumber(TUint32)
IMPORT_C TUintLogicalStorageOwner(TUint32)
IMPORT_C CMTPStorageMgr *NewL()
IMPORT_C TInt32PhysicalStorageId(TDriveNumber)
IMPORT_C TUint32PhysicalStorageId(TUint32)
IMPORT_C TUintPhysicalStorageNumber(TUint32)
IMPORT_C TUintPhysicalStorageOwner(TUint32)
IMPORT_C voidSetDefaultStorageId(TUint32)
IMPORT_C voidSetDriveMappingL(TDriveNumber, TUint32)
IMPORT_C voidSetFrameworkId(TUint)
IMPORT_C TUint32StorageId(TUint32, TUint32)
IMPORT_C const CMTPStorageMetaData &StorageL(TUint32)
IMPORT_C TBoolValidStorageId(TUint32)
IMPORT_C CMTPTypeString *VolumeIdL(TUint, TUint32, const TDesC &)
Private Member Functions
CMTPStorageMgr()
TInt32 AllocateLogicalStorageId(TUint, TUint32)
TInt32 AllocatePhysicalStorageId(TUint)
voidConstructL()
TUint32 EncodeLogicalStorageId(TUint32, TUint, TUint)
TUint32 EncodeLogicalStorageNumber(TUint)
TUint32 EncodeLogicalStorageOwner(TUint)
TUint32 EncodePhysicalStorageId(TUint, TUint)
TUint32 EncodePhysicalStorageNumber(TUint)
TUint32 EncodePhysicalStorageOwner(TUint)
voidRemoveLogicalStorageL(TUint)
TBool StorageKeyMatchSuid(const TDesC *, const CMTPStorageMetaData &)
CMTPStorageMetaData &StorageMetaDataL(TUint32)
TInt StorageOrder(const CMTPStorageMetaData &, const CMTPStorageMetaData &)
TInt StorageOrder(const TUint32 *, const CMTPStorageMetaData &)
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()
Private Attributes
__FLOG_DECLARATION_MEMBER_MUTABLE
TUint32 iDefaultStorageId
TInt iFrameworkId
TFixedArray< TInt, KMaxDrives >iMapDriveToStorage
RArray< TUint >iPhysicalStorageNumbers
RMTPFramework iSingletons
RPointerArray< CMTPStorageMetaData >iStorages

Constructor & Destructor Documentation

CMTPStorageMgr()

CMTPStorageMgr()[private]

Constructor.

~CMTPStorageMgr()

IMPORT_C~CMTPStorageMgr()

Destructor.

Member Functions Documentation

AllocateLogicalStorageId(TUint, TUint32)

TInt32 AllocateLogicalStorageId(TUintaDataProviderId,
TUint32aPhysicalStorageId
)[private]

Allocates a new 32-bit logical StorageId for the storage owner as a partition of the specified physical MTP StorageID.

Parameters

TUint aDataProviderIdThe storage owner data provider identifier.
TUint32 aPhysicalStorageIdThe physical MTP StorageID.

AllocateLogicalStorageIdL(TUint, TDriveNumber, const CMTPStorageMetaData &)

IMPORT_C TUint32AllocateLogicalStorageIdL(TUintaDataProviderId,
TDriveNumberaDriveNumber,
const CMTPStorageMetaData &aStorage
)

Parameters

TUint aDataProviderId
TDriveNumber aDriveNumber
const CMTPStorageMetaData & aStorage

AllocateLogicalStorageIdL(TUint, TUint32, const CMTPStorageMetaData &)

IMPORT_C TUint32AllocateLogicalStorageIdL(TUintaDataProviderId,
TUint32aPhysicalStorageId,
const CMTPStorageMetaData &aStorage
)

Parameters

TUint aDataProviderId
TUint32 aPhysicalStorageId
const CMTPStorageMetaData & aStorage

AllocatePhysicalStorageId(TUint)

TInt32 AllocatePhysicalStorageId(TUintaDataProviderId)[private]

Allocates a new 32-bit physical StorageId for the storage owner.

Parameters

TUint aDataProviderIdThe storage owner data provider identifier.

AllocatePhysicalStorageIdL(TUint, const CMTPStorageMetaData &)

IMPORT_C TUint32AllocatePhysicalStorageIdL(TUintaDataProviderId,
const CMTPStorageMetaData &aStorage
)

Parameters

TUint aDataProviderId
const CMTPStorageMetaData & aStorage

ConstructL()

voidConstructL()[private]
Second phase constructor.
leave
One of the system wide error code, if a processing failure occurs.

DeallocateLogicalStorageId(TUint, TUint32)

IMPORT_C TIntDeallocateLogicalStorageId(TUintaDataProviderId,
TUint32aLogicalStorageId
)

Parameters

TUint aDataProviderId
TUint32 aLogicalStorageId

DeallocateLogicalStorageIds(TUint, TUint32)

IMPORT_C voidDeallocateLogicalStorageIds(TUintaDataProviderId,
TUint32aPhysicalStorageId
)

Parameters

TUint aDataProviderId
TUint32 aPhysicalStorageId

DeallocatePhysicalStorageId(TUint, TUint32)

IMPORT_C TIntDeallocatePhysicalStorageId(TUintaDataProviderId,
TUint32aPhysicalStorageId
)

Parameters

TUint aDataProviderId
TUint32 aPhysicalStorageId

DefaultStorageId()

IMPORT_C TUint32DefaultStorageId()const

DriveNumber(TUint32)

IMPORT_C TIntDriveNumber(TUint32aStorageId)const

Parameters

TUint32 aStorageId

EncodeLogicalStorageId(TUint32, TUint, TUint)

TUint32 EncodeLogicalStorageId(TUint32aPhysicalStorageId,
TUintaDataProviderId,
TUintaStorageNumber
)[private]

Encodes the specified physical MTP StorageID, data provider identifier, and storage number as a fully formed MTP StorageID.

Parameters

TUint32 aPhysicalStorageIdThe physical MTP StorageID.
TUint aDataProviderIdThe data provider identifier.
TUint aStorageNumberThe storage number.

EncodeLogicalStorageNumber(TUint)

TUint32 EncodeLogicalStorageNumber(TUintaStorageNumber)[private]

Encodes the storage identifier as the logical storage number in a fully formed MTP StorageID.

Parameters

TUint aStorageNumberThe storage number.

EncodeLogicalStorageOwner(TUint)

TUint32 EncodeLogicalStorageOwner(TUintaDataProviderId)[private]

Encodes the specified data provider identifier as the logical storage owner in a fully formed MTP StorageID.

Parameters

TUint aDataProviderIdThe data provider identifier.

EncodePhysicalStorageId(TUint, TUint)

TUint32 EncodePhysicalStorageId(TUintaDataProviderId,
TUintaStorageNumber
)[private]

Encodes the specified data provider identifier and storage number as an physical MTP StorageID.

Parameters

TUint aDataProviderIdThe data provider identifier.
TUint aStorageNumberThe storage number.

EncodePhysicalStorageNumber(TUint)

TUint32 EncodePhysicalStorageNumber(TUintaStorageNumber)[private]

Encodes the storage identifier as the physical storage number in a fully formed MTP StorageID.

Parameters

TUint aStorageNumberThe storage number.

EncodePhysicalStorageOwner(TUint)

TUint32 EncodePhysicalStorageOwner(TUintaDataProviderId)[private]

Encodes the specified data provider identifier as the physical storage owner in a fully formed MTP StorageID.

Parameters

TUint aDataProviderIdThe data provider identifier.

FrameworkStorageId(TDriveNumber)

IMPORT_C TInt32FrameworkStorageId(TDriveNumberaDriveNumber)const

Parameters

TDriveNumber aDriveNumber

GetAvailableDrivesL(RArray< TDriveNumber > &)

IMPORT_C voidGetAvailableDrivesL(RArray< TDriveNumber > &aDrives)const

Parameters

RArray< TDriveNumber > & aDrives

GetLogicalStoragesL(const TMTPStorageMgrQueryParams &, RPointerArray< const CMTPStorageMetaData > &)

IMPORT_C voidGetLogicalStoragesL(const TMTPStorageMgrQueryParams &aParams,
RPointerArray< const CMTPStorageMetaData > &aStorages
)const

Parameters

const TMTPStorageMgrQueryParams & aParams
RPointerArray< const CMTPStorageMetaData > & aStorages

GetPhysicalStoragesL(const TMTPStorageMgrQueryParams &, RPointerArray< const CMTPStorageMetaData > &)

IMPORT_C voidGetPhysicalStoragesL(const TMTPStorageMgrQueryParams &aParams,
RPointerArray< const CMTPStorageMetaData > &aStorages
)const

Parameters

const TMTPStorageMgrQueryParams & aParams
RPointerArray< const CMTPStorageMetaData > & aStorages

IsReadWriteStorage(TUint32)

IMPORT_C TBoolIsReadWriteStorage(TUint32aStorageId)const

Parameters

TUint32 aStorageId

LogicalStorageId(TUint32)

IMPORT_C TUint32LogicalStorageId(TUint32aStorageId)const

Parameters

TUint32 aStorageId

LogicalStorageId(const TDesC &)

IMPORT_C TInt32LogicalStorageId(const TDesC &aStorageSuid)const

Parameters

const TDesC & aStorageSuid

LogicalStorageNumber(TUint32)

IMPORT_C TUintLogicalStorageNumber(TUint32aStorageId)[static]

Extracts the storage number of the logical storage ID encoded in the specified StorageID.

Parameters

TUint32 aStorageIdThe storage ID.

LogicalStorageOwner(TUint32)

IMPORT_C TUintLogicalStorageOwner(TUint32aStorageId)[static]

Extracts the ID of the data provider responsible for the logical storage ID encoded in the specified StorageID.

Parameters

TUint32 aStorageIdThe storage ID.

NewL()

IMPORT_C CMTPStorageMgr *NewL()[static]
MTP data provider framework storage manager factory method.
leave
One of the system wide error codes, if a processing failure occurs.

PhysicalStorageId(TDriveNumber)

IMPORT_C TInt32PhysicalStorageId(TDriveNumberaDriveNumber)const

Parameters

TDriveNumber aDriveNumber

PhysicalStorageId(TUint32)

IMPORT_C TUint32PhysicalStorageId(TUint32aStorageId)const

Parameters

TUint32 aStorageId

PhysicalStorageNumber(TUint32)

IMPORT_C TUintPhysicalStorageNumber(TUint32aStorageId)[static]

Extracts the storage number of the physical storage ID encoded in the specified StorageID.

Parameters

TUint32 aStorageIdThe storage ID.

PhysicalStorageOwner(TUint32)

IMPORT_C TUintPhysicalStorageOwner(TUint32aStorageId)[static]

Extracts the ID of the data provider responsible for the physical storage ID encoded in the specified StorageID.

Parameters

TUint32 aStorageIdThe storage ID.

RemoveLogicalStorageL(TUint)

voidRemoveLogicalStorageL(TUintaIdx)[private]
Removes the logical storages table entry at the specified index.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TUint aIdxThe storages table index.

SetDefaultStorageId(TUint32)

IMPORT_C voidSetDefaultStorageId(TUint32aStorageId)
Sets the default MTP StorageID. This should be set once at start up and not subsequently changed.
panic
USER 0, in debug builds only, if the default StorageID is set more than once.

Parameters

TUint32 aStorageIdThe system default MTP StorageID.

SetDriveMappingL(TDriveNumber, TUint32)

IMPORT_C voidSetDriveMappingL(TDriveNumberaDriveNumber,
TUint32aStorageId
)
Creates a mapping between the specified Symbian OS drive number and MTP StorageID.
leave
One of the sysem wide error codes, if a processing failure occurs.

Parameters

TDriveNumber aDriveNumberThe Symbian OS drive number.
TUint32 aStorageIdThe MTP StorageID.

SetFrameworkId(TUint)

IMPORT_C voidSetFrameworkId(TUintaDataProviderId)
Sets the framework storages owner identifier. This should be set once at start up and not subsequently changed.
panic
USER 0, in debug builds only, if the framework storages owner identifier is set more than once.

Parameters

TUint aDataProviderIdThe framework storages owner identifier.

StorageId(TUint32, TUint32)

IMPORT_C TUint32StorageId(TUint32aPhysicalStorageId,
TUint32aLogicalStorageId
)const

Parameters

TUint32 aPhysicalStorageId
TUint32 aLogicalStorageId

StorageKeyMatchSuid(const TDesC *, const CMTPStorageMetaData &)

TBool StorageKeyMatchSuid(const TDesC *aSuid,
const CMTPStorageMetaData &aStorage
)[private, static]

Implements a storage key match identity relation using CMTPStorageMetaData::EStorageSuid.

Parameters

const TDesC * aSuidThe storage SUID key value.
const CMTPStorageMetaData & aStorageThe storage meta-data.

StorageL(TUint32)

IMPORT_C const CMTPStorageMetaData &StorageL(TUint32aStorageId)const

Parameters

TUint32 aStorageId

StorageMetaDataL(TUint32)

CMTPStorageMetaData &StorageMetaDataL(TUint32aStorageId)[private]
Provides a non-const reference to the storage meta-data for the specified logical MTP StorageID.
leave
KErrNotFound if the specified StorageID does not exist.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

TUint32 aStorageIdThe physical or fully formed logical MTP StorageID.

StorageOrder(const CMTPStorageMetaData &, const CMTPStorageMetaData &)

TInt StorageOrder(const CMTPStorageMetaData &aL,
const CMTPStorageMetaData &aR
)[private, static]

Implements an TLinearOrder function for CMTPStorageMetaData objects based on relative CMTPStorageMetaData::EStorageId.

Parameters

const CMTPStorageMetaData & aLThe first object instance.
const CMTPStorageMetaData & aRThe second object instance.

StorageOrder(const TUint32 *, const CMTPStorageMetaData &)

TInt StorageOrder(const TUint32 *aKey,
const CMTPStorageMetaData &aStorage
)[private, static]

Implements an CMTPStorageMetaData::EStorageId key order function.

Parameters

const TUint32 * aKeyThe key value.
const CMTPStorageMetaData & aStorage

ValidStorageId(TUint32)

IMPORT_C TBoolValidStorageId(TUint32aStorageId)const

Parameters

TUint32 aStorageId

VolumeIdL(TUint, TUint32, const TDesC &)

IMPORT_C CMTPTypeString *VolumeIdL(TUintaDataProviderId,
TUint32aStorageId,
const TDesC &aVolumeIdSuffix
)const

Parameters

TUint aDataProviderId
TUint32 aStorageId
const TDesC & aVolumeIdSuffix

Member Data Documentation

__FLOG_DECLARATION_MEMBER_MUTABLE

__FLOG_DECLARATION_MEMBER_MUTABLE[private]

FLOGGER debug trace member variable.

TUint32 iDefaultStorageId

TUint32 iDefaultStorageId[private]

The default MTP storage ID.

TInt iFrameworkId

TInt iFrameworkId[private]

The framework storages (drives) owning data provider ID.

TFixedArray< TInt, KMaxDrives > iMapDriveToStorage

TFixedArray< TInt, KMaxDrives >iMapDriveToStorage[private]

The Symbian OS drive number to default MTP StorageID mapping table. This StorageID may either be the physical MTP StorageID or the default logical MTP StorageID.

RArray< TUint > iPhysicalStorageNumbers

RArray< TUint >iPhysicalStorageNumbers[private]

The physical storage numbers allocation table. Indexed by physical storage owner data provider ID.

RMTPFramework iSingletons

RMTPFramework iSingletons[private]

The framework singletons.

RPointerArray< CMTPStorageMetaData > iStorages

RPointerArray< CMTPStorageMetaData >iStorages[private]

The storages table.