MMTPType Class Reference

class MMTPType

Defines the generic MTP data type interface. All non-opaque MTP data comprises either a single atomic value of a simple type, or a set of atomic simple type values organised according to some dataset structure. Structured datasets may take one of the following general forms:

1. Flat - a contiguous collection of values. 2. Complex - a contiguous array or string of values. 3. Compound - a mixed sequence of simple, flat, and complex types.

Any time data is passed as a parameter to an MTP operation, response or event; or any time data is passed in the data phase of a fully described operation, that data must be of a type that implements the generic MTP data type interface.

Member Functions Documentation

CommitChunkL(TPtr8 &)

IMPORT_C MMTPType *CommitChunkL(TPtr8 &aChunk)[virtual]
Commits the specified write data chunk. This method should only be invoked if the type indicates that committing data is required (CommitRequired). Generally this would only be required by types which are performing intermediate buffering, e.g. a file data object.
leave
KErrNotSupported, if the type does not support data commit.
leave
KMTPDataTypeInvalid, if the data type is structurally invalid.
leave
One of the system wide error codes, if a general processing error occurs.
CommitRequired

Parameters

TPtr8 & aChunkThe data chunk to be commited.

CommitRequired()

IMPORT_C TBoolCommitRequired()const [virtual]

Indicates if the data type requires that data be committed during data write sequences. Generally this would only be required by types which perform intermediate buffering (e.g. a file data object), or by data types whose final structure is determined by the value of meta data elements within the data stream itself (e.g an MTP ObjectPropDesc dataset). CommitChunkL ChunkWritePtr

CopyL(const MMTPType &, MMTPType &)

IMPORT_C voidCopyL(const MMTPType &aFrom,
MMTPType &aTo
)[static]
Copies the data from one MTP data type object to another. This is accomplished by attaching read and write data streams from the source object to the sink object. The source and sink objects are not required to be of the same type and no type compatibility checking is performed.
leave
One of the system wide error codes, if a general processing error occurs.

Parameters

const MMTPType & aFromThe MTP source data type object.
MMTPType & aToThe MTP source data type object.

FirstReadChunk(TPtrC8 &)

TInt FirstReadChunk(TPtrC8 &aChunk)const [pure virtual]

Initiates a data read sequence on the type by providing a const pointer to the first in the sequence of data chunks that make up the type's data stream. Subsequent chunks in the sequence can be sequentially retrieved using NextReadChunk. NextReadChunk.

Parameters

TPtrC8 & aChunkThe const pointer to be set to point to the start of the first data chunk. This pointer's length is set to zero if no data chunk exists or a processing error occurs.

FirstWriteChunk(TPtr8 &)

TInt FirstWriteChunk(TPtr8 &aChunk)[pure virtual]

Initiates a data write sequence on the type by providing a non-const pointer to the first in the sequence of data chunks that make up the type's data stream. Subsequent chunks in the sequence can be sequentially retrieved using NextWriteChunk. NextWriteChunk.

Parameters

TPtr8 & aChunkThe non-const pointer to be set to point to the start of the first data chunk. If successful, the pointer's Length is set to zero, and MaxLength is set to the available capacity of the data chunk. If not successful, the pointer's MaxLength is set to zero.

FirstWriteChunk(TPtr8 &, TUint)

IMPORT_C TIntFirstWriteChunk(TPtr8 &aChunk,
TUintaDataLength
)[virtual]

Parameters

TPtr8 & aChunk
TUint aDataLength

GetExtendedInterface(TUid)

IMPORT_C TAny *GetExtendedInterface(TUidaInterfaceUid)[virtual]

Provides an MTP data type extension interface implementation for the specified interface Uid.

Parameters

TUid aInterfaceUidThe unique identifier for the extension interface being requested.

NextReadChunk(TPtrC8 &)

TInt NextReadChunk(TPtrC8 &aChunk)const [pure virtual]

Continues a data read sequence on the type by providing a const pointer to the next in the sequence of data chunks that make up the type's data stream. This data read sequence should have been previously initiated by invoking FirstReadChunk. FirstReadChunk.

Parameters

TPtrC8 & aChunkThe const pointer to be set to point to the start of the next data chunk. This pointer's length is set to zero if no data chunk exists or a processing error occurs.

NextWriteChunk(TPtr8 &)

TInt NextWriteChunk(TPtr8 &aChunk)[pure virtual]

Continues a data write sequence on the type by providing a non-const pointer to the next in the sequence of data chunks that make up the type's data stream. This data write sequence should have been previously initiated by invoking FirstWriteChunk. FirstReadChunk.

Parameters

TPtr8 & aChunkThe non-const pointer to be set to point to the start of the next data chunk. If successful, the pointer's Length is set to zero, and MaxLength is set to the available capacity of the data chunk. If not successful, the pointer's MaxLength is set to zero..

NextWriteChunk(TPtr8 &, TUint)

IMPORT_C TIntNextWriteChunk(TPtr8 &aChunk,
TUintaDataLength
)[virtual]

Parameters

TPtr8 & aChunk
TUint aDataLength

ReserveTransportHeader(TUint, TPtr8 &)

IMPORT_C TBoolReserveTransportHeader(TUintaHeaderLength,
TPtr8 &aHeader
)[virtual]

Parameters

TUint aHeaderLength
TPtr8 & aHeader

Size()

TUint64 Size()const [pure virtual]

Provides the size in bytes of the MTP data type.

Type()

TUint Type()const [pure virtual]

Provides the MTP data type identification datacode.

Validate()

IMPORT_C TIntValidate()const [virtual]

Validates the structural integrity of the data type. This method can be invoked on completion of a data write sequence to validate that the received data represents a structurally valid instance of the data type.