CMTPStorageMgr Class Reference

class CMTPStorageMgr : public CBase

Implements the MTP storage manager interface.

Inherits from

Public Member Functions
~CMTPStorageMgr ()
IMPORT_C TUint32 AllocateLogicalStorageIdL ( TUint , TDriveNumber , const CMTPStorageMetaData &)
IMPORT_C TUint32 AllocateLogicalStorageIdL ( TUint , TUint32 , const CMTPStorageMetaData &)
IMPORT_C TUint32 AllocatePhysicalStorageIdL ( TUint , const CMTPStorageMetaData &)
IMPORT_C TInt DeallocateLogicalStorageId ( TUint , TUint32 )
IMPORT_C void DeallocateLogicalStorageIds ( TUint , TUint32 )
IMPORT_C TInt DeallocatePhysicalStorageId ( TUint , TUint32 )
IMPORT_C TUint32 DefaultStorageId ()
IMPORT_C TInt DriveNumber ( TUint32 )
IMPORT_C TInt32 FrameworkStorageId ( TDriveNumber )
IMPORT_C void GetAvailableDrivesL ( RArray < TDriveNumber > &)
IMPORT_C void GetLogicalStoragesL (const TMTPStorageMgrQueryParams &, RPointerArray < const CMTPStorageMetaData > &)
IMPORT_C void GetPhysicalStoragesL (const TMTPStorageMgrQueryParams &, RPointerArray < const CMTPStorageMetaData > &)
IMPORT_C TBool IsReadWriteStorage ( TUint32 )
IMPORT_C TUint32 LogicalStorageId ( TUint32 )
IMPORT_C TInt32 LogicalStorageId (const TDesC &)
IMPORT_C TUint LogicalStorageNumber ( TUint32 )
IMPORT_C TUint LogicalStorageOwner ( TUint32 )
IMPORT_C CMTPStorageMgr * NewL ()
IMPORT_C TInt32 PhysicalStorageId ( TDriveNumber )
IMPORT_C TUint32 PhysicalStorageId ( TUint32 )
IMPORT_C TUint PhysicalStorageNumber ( TUint32 )
IMPORT_C TUint PhysicalStorageOwner ( TUint32 )
IMPORT_C void SetDefaultStorageId ( TUint32 )
IMPORT_C void SetDriveMappingL ( TDriveNumber , TUint32 )
IMPORT_C void SetFrameworkId ( TUint )
IMPORT_C TUint32 StorageId ( TUint32 , TUint32 )
IMPORT_C const CMTPStorageMetaData & StorageL ( TUint32 )
IMPORT_C TBool ValidStorageId ( TUint32 )
IMPORT_C CMTPTypeString * VolumeIdL ( TUint , TUint32 , const TDesC &)
Private Member Functions
CMTPStorageMgr ()
TInt32 AllocateLogicalStorageId ( TUint , TUint32 )
TInt32 AllocatePhysicalStorageId ( TUint )
void ConstructL ()
TUint32 EncodeLogicalStorageId ( TUint32 , TUint , TUint )
TUint32 EncodeLogicalStorageNumber ( TUint )
TUint32 EncodeLogicalStorageOwner ( TUint )
TUint32 EncodePhysicalStorageId ( TUint , TUint )
TUint32 EncodePhysicalStorageNumber ( TUint )
TUint32 EncodePhysicalStorageOwner ( TUint )
void RemoveLogicalStorageL ( 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 ( TUint aDataProviderId,
TUint32 aPhysicalStorageId
) [private]

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

Parameters

TUint aDataProviderId The storage owner data provider identifier.
TUint32 aPhysicalStorageId The physical MTP StorageID.

AllocateLogicalStorageIdL(TUint, TDriveNumber, const CMTPStorageMetaData &)

IMPORT_C TUint32 AllocateLogicalStorageIdL ( TUint aDataProviderId,
TDriveNumber aDriveNumber,
const CMTPStorageMetaData & aStorage
)

Parameters

TUint aDataProviderId
TDriveNumber aDriveNumber
const CMTPStorageMetaData & aStorage

AllocateLogicalStorageIdL(TUint, TUint32, const CMTPStorageMetaData &)

IMPORT_C TUint32 AllocateLogicalStorageIdL ( TUint aDataProviderId,
TUint32 aPhysicalStorageId,
const CMTPStorageMetaData & aStorage
)

Parameters

TUint aDataProviderId
TUint32 aPhysicalStorageId
const CMTPStorageMetaData & aStorage

AllocatePhysicalStorageId(TUint)

TInt32 AllocatePhysicalStorageId ( TUint aDataProviderId ) [private]

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

Parameters

TUint aDataProviderId The storage owner data provider identifier.

AllocatePhysicalStorageIdL(TUint, const CMTPStorageMetaData &)

IMPORT_C TUint32 AllocatePhysicalStorageIdL ( TUint aDataProviderId,
const CMTPStorageMetaData & aStorage
)

Parameters

TUint aDataProviderId
const CMTPStorageMetaData & aStorage

ConstructL()

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

DeallocateLogicalStorageId(TUint, TUint32)

IMPORT_C TInt DeallocateLogicalStorageId ( TUint aDataProviderId,
TUint32 aLogicalStorageId
)

Parameters

TUint aDataProviderId
TUint32 aLogicalStorageId

DeallocateLogicalStorageIds(TUint, TUint32)

IMPORT_C void DeallocateLogicalStorageIds ( TUint aDataProviderId,
TUint32 aPhysicalStorageId
)

Parameters

TUint aDataProviderId
TUint32 aPhysicalStorageId

DeallocatePhysicalStorageId(TUint, TUint32)

IMPORT_C TInt DeallocatePhysicalStorageId ( TUint aDataProviderId,
TUint32 aPhysicalStorageId
)

Parameters

TUint aDataProviderId
TUint32 aPhysicalStorageId

DefaultStorageId()

IMPORT_C TUint32 DefaultStorageId ( ) const

DriveNumber(TUint32)

IMPORT_C TInt DriveNumber ( TUint32 aStorageId ) const

Parameters

TUint32 aStorageId

EncodeLogicalStorageId(TUint32, TUint, TUint)

TUint32 EncodeLogicalStorageId ( TUint32 aPhysicalStorageId,
TUint aDataProviderId,
TUint aStorageNumber
) [private]

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

Parameters

TUint32 aPhysicalStorageId The physical MTP StorageID.
TUint aDataProviderId The data provider identifier.
TUint aStorageNumber The storage number.

EncodeLogicalStorageNumber(TUint)

TUint32 EncodeLogicalStorageNumber ( TUint aStorageNumber ) [private]

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

Parameters

TUint aStorageNumber The storage number.

EncodeLogicalStorageOwner(TUint)

TUint32 EncodeLogicalStorageOwner ( TUint aDataProviderId ) [private]

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

Parameters

TUint aDataProviderId The data provider identifier.

EncodePhysicalStorageId(TUint, TUint)

TUint32 EncodePhysicalStorageId ( TUint aDataProviderId,
TUint aStorageNumber
) [private]

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

Parameters

TUint aDataProviderId The data provider identifier.
TUint aStorageNumber The storage number.

EncodePhysicalStorageNumber(TUint)

TUint32 EncodePhysicalStorageNumber ( TUint aStorageNumber ) [private]

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

Parameters

TUint aStorageNumber The storage number.

EncodePhysicalStorageOwner(TUint)

TUint32 EncodePhysicalStorageOwner ( TUint aDataProviderId ) [private]

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

Parameters

TUint aDataProviderId The data provider identifier.

FrameworkStorageId(TDriveNumber)

IMPORT_C TInt32 FrameworkStorageId ( TDriveNumber aDriveNumber ) const

Parameters

TDriveNumber aDriveNumber

GetAvailableDrivesL(RArray< TDriveNumber > &)

IMPORT_C void GetAvailableDrivesL ( RArray < TDriveNumber > & aDrives ) const

Parameters

RArray < TDriveNumber > & aDrives

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

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

Parameters

const TMTPStorageMgrQueryParams & aParams
RPointerArray < const CMTPStorageMetaData > & aStorages

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

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

Parameters

const TMTPStorageMgrQueryParams & aParams
RPointerArray < const CMTPStorageMetaData > & aStorages

IsReadWriteStorage(TUint32)

IMPORT_C TBool IsReadWriteStorage ( TUint32 aStorageId ) const

Parameters

TUint32 aStorageId

LogicalStorageId(TUint32)

IMPORT_C TUint32 LogicalStorageId ( TUint32 aStorageId ) const

Parameters

TUint32 aStorageId

LogicalStorageId(const TDesC &)

IMPORT_C TInt32 LogicalStorageId ( const TDesC & aStorageSuid ) const

Parameters

const TDesC & aStorageSuid

LogicalStorageNumber(TUint32)

IMPORT_C TUint LogicalStorageNumber ( TUint32 aStorageId ) [static]

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

Parameters

TUint32 aStorageId The storage ID.

LogicalStorageOwner(TUint32)

IMPORT_C TUint LogicalStorageOwner ( TUint32 aStorageId ) [static]

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

Parameters

TUint32 aStorageId The 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 TInt32 PhysicalStorageId ( TDriveNumber aDriveNumber ) const

Parameters

TDriveNumber aDriveNumber

PhysicalStorageId(TUint32)

IMPORT_C TUint32 PhysicalStorageId ( TUint32 aStorageId ) const

Parameters

TUint32 aStorageId

PhysicalStorageNumber(TUint32)

IMPORT_C TUint PhysicalStorageNumber ( TUint32 aStorageId ) [static]

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

Parameters

TUint32 aStorageId The storage ID.

PhysicalStorageOwner(TUint32)

IMPORT_C TUint PhysicalStorageOwner ( TUint32 aStorageId ) [static]

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

Parameters

TUint32 aStorageId The storage ID.

RemoveLogicalStorageL(TUint)

void RemoveLogicalStorageL ( TUint aIdx ) [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 aIdx The storages table index.

SetDefaultStorageId(TUint32)

IMPORT_C void SetDefaultStorageId ( TUint32 aStorageId )
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 aStorageId The system default MTP StorageID.

SetDriveMappingL(TDriveNumber, TUint32)

IMPORT_C void SetDriveMappingL ( TDriveNumber aDriveNumber,
TUint32 aStorageId
)
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 aDriveNumber The Symbian OS drive number.
TUint32 aStorageId The MTP StorageID.

SetFrameworkId(TUint)

IMPORT_C void SetFrameworkId ( TUint aDataProviderId )
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 aDataProviderId The framework storages owner identifier.

StorageId(TUint32, TUint32)

IMPORT_C TUint32 StorageId ( TUint32 aPhysicalStorageId,
TUint32 aLogicalStorageId
) 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 * aSuid The storage SUID key value.
const CMTPStorageMetaData & aStorage The storage meta-data.

StorageL(TUint32)

IMPORT_C const CMTPStorageMetaData & StorageL ( TUint32 aStorageId ) const

Parameters

TUint32 aStorageId

StorageMetaDataL(TUint32)

CMTPStorageMetaData & StorageMetaDataL ( TUint32 aStorageId ) [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 aStorageId The 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 & aL The first object instance.
const CMTPStorageMetaData & aR The 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 * aKey The key value.
const CMTPStorageMetaData & aStorage

ValidStorageId(TUint32)

IMPORT_C TBool ValidStorageId ( TUint32 aStorageId ) const

Parameters

TUint32 aStorageId

VolumeIdL(TUint, TUint32, const TDesC &)

IMPORT_C CMTPTypeString * VolumeIdL ( TUint aDataProviderId,
TUint32 aStorageId,
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.