Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: apmstd.h
Link against: apmime.lib

Class TDataType

TDataType

Support

Supported from 5.0

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.

Defined in TDataType:
Des(), Des8(), ExternalizeL(), InternalizeL(), IsNative(), TDataType(), Uid(), operator!=(), operator==()


Construction


TDataType()

TDataType();

Description

Default constructor.

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


TDataType()

TDataType(const TDataType& aDataType);

Description

Copy constructor.

Parameters

const TDataType& aDataType

The data type to be copied.


TDataType()

TDataType(const TDesC8& aDataType);

Description

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.

Parameters

const TDesC8& aDataType

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


TDataType()

TDataType(TUid aUid);

Description

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.

Parameters

TUid aUid

The associated UID.

[Top]


Enquiries


operator==()

TInt operator==(const TDataType& aDataType) const;

Description

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.

Parameters

const TDataType& aDataType

The data type taking part in the comparison.

Return value

TInt

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


operator!=()

TInt operator!=(const TDataType& aDataType) const;

Description

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.

Parameters

const TDataType& aDataType

The data type taking part in the comparison.

Return value

TInt

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


IsNative()

TBool IsNative() const;

Description

Tests whether the data type is a native Symbian type.

Return value

TBool

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


Uid()

TUid Uid() const;

Description

Gets the UID associated with this data type.

Return value

TUid

The UID.


Des()

TBuf<KMaxDataTypeLength> Des() const;

Description

Gets a copy of the data type string.

Return value

TBuf<KMaxDataTypeLength>

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


Des8()

TPtrC8 Des8() const;

Description

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

Return value

TPtrC8

A pointer descriptor to the data type string.

[Top]


Streaming


ExternalizeL()

void ExternalizeL(RWriteStream& aWriteStream) const;

Description

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.

Parameters

RWriteStream& aWriteStream

The write stream.


InternalizeL()

void InternalizeL(RReadStream& aReadStream);

Description

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.

Parameters

RReadStream& aReadStream

The read stream.