TDataType Class Reference

#include <apmstd.h>

Link against: apmime.lib

class TDataType
Public Member Functions
TDataType()
TDataType(const TDataType &)
TDataType(const TDesC8 &)
TDataType(TUid)
IMPORT_C TBuf< KMaxDataTypeLength >Des()
IMPORT_C TPtrC8Des8()
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsNative()
IMPORT_C TUidUid()
IMPORT_C TIntoperator!=(const TDataType &)
IMPORT_C TIntoperator==(const TDataType &)

Detailed Description

A data type.

The class maintains a string that describes the data type and an associated UID.

A data type is also referred to as a MIME type.

Constructor & Destructor Documentation

TDataType ( )

IMPORT_CTDataType()

Default constructor.

Sets an empty data type string and sets the associated UID to KNullUid.

TDataType ( const TDataType & )

IMPORT_CTDataType(const TDataType &aDataType)

Copy constructor.

ParameterDescription
aDataTypeThe data type to be copied.

TDataType ( const TDesC8 & )

IMPORT_CTDataType(const TDesC8 &aDataType)

Constructor taking a descriptor.

The data type string is copied from the specified descriptor. By default, the associated UID is set to KNullUid.

If the data type string begins with the characters "x-epoc/x-app", identifying data as a native Symbian type, then the associated UID is set to the UID value which is expected to follow the characters "x-epoc/x-app".

If no sensible UID can be extracted from the characters following: "x-epoc/x-app", then the associated UID is set to KNullUid.

ParameterDescription
aDataTypeThe source for the data type string. Note that this is an 8 bit descriptor.

TDataType ( TUid )

IMPORT_CTDataType(TUidaUid)

Constructor taking a UID.

The data type string is set to "x-epoc/x-app" concatenated with the decimal character representation of the specified UID value. The data type is assumed to identify data as a native Symbian type.

ParameterDescription
aUidThe associated UID.

Member Function Documentation

Des ( )

IMPORT_C TBuf< KMaxDataTypeLength >Des()const

Gets a copy of the data type string.

Returns: A modifiable buffer descriptor containing a copy of the data type string. Note that this descriptor is a build independent type.

Des8 ( )

IMPORT_C TPtrC8Des8()const

Gets an 8 bit non-modifiable pointer descriptor to the data type string.

Returns: A pointer descriptor to the data type string.

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aWriteStream)const

Externalizes the data type to a stream.

The presence of this function means that the standard templated stream operator<<() is available to externalise objects of this class.

ParameterDescription
aWriteStreamThe write stream.

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aReadStream)

Internalizes the data type from a stream.

The presence of this function means that the standard templated stream operator>>() is available to internalize objects of this class.

ParameterDescription
aReadStreamThe read stream.

IsNative ( )

IMPORT_C TBoolIsNative()const

Tests whether the data type is a native Symbian type.

Returns: True, if the data type is a native Symbian type; false, otherwise.

Uid ( )

IMPORT_C TUidUid()const

Gets the UID associated with this data type.

Returns: The UID.

operator!= ( const TDataType & )

IMPORT_C TIntoperator!=(const TDataType &aDataType)const

Compares this data type for inequality with the specified data type.

Two data types are only equal if their data type strings are the same. Text is folded for the purpose of the comparison, removing accents and converting letters to a common case form.

ParameterDescription
aDataTypeThe data type taking part in the comparison.

Returns: True, if the data types are not equal; false, otherwise.

operator== ( const TDataType & )

IMPORT_C TIntoperator==(const TDataType &aDataType)const

Compares this data type for equality with the specified data type.

Two data types are equal if their data type strings are the same. Text is folded for the purpose of the comparison, removing accents and converting letters to a common case form.

ParameterDescription
aDataTypeThe data type taking part in the comparison.

Returns: True, if the data types are equal; false, otherwise.