Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: vprop.h
Link against: versit.lib

Class CParserPropertyValue

CParserPropertyValue

Support

Supported from 5.0

Description

Abstract base class for all property values. Defines a pure virtual ExternalizeL() function which is implemented by all concrete derived classes. The type of derived class is returned by the Uid() function; the UID value is specified on construction.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CParserPropertyValueAbstract base class for all property values

Defined in CParserPropertyValue:
EncodeL(), ExternalizeL(), IsAsciiCharacterSetSufficient(), SupportsInterface(), Uid()

Inherited from CBase:
operator new()


Stream persistence


ExternalizeL()

virtual void ExternalizeL(RWriteStream& aStream,const TUid& aEncodingUid)=0;

Description

Externalizes the property value to a write stream — pure virtual function. Implementations of this function are invoked by the parser's ExternalizeL() function.

Parameters

RWriteStream& aStream

Stream to which the property value should be externalized.

const TUid& aEncodingUid

An encoding UID. This is only used for text properties (HBufC or DesCArray types). Specify a NULL UID if no encoding is required. This value is used in EncodeL() to convert the text value into another character set. Possible values are defined in vuid.h.

[Top]


Character set conversion


EncodeL()

virtual void EncodeL(CBufFlat* aValue,const TUid& aEncoding) const;

Description

Encodes a text property value. The function escapes any semi colons in the property value with a backslash and converts the descriptor into another character set if an encoding UID is specified. Invoked by implementations of ExternalizeL().

Parameters

CBufFlat* aValue

Pointer to a buffer containing the property value.

const TUid& aEncoding

An encoding UID. This is only used for text properties (HBufC or DesCArray property types). Specify a NULL UID if no encoding is required. The possible values are defined in vuid.h.


IsAsciiCharacterSetSufficient()

virtual TBool IsAsciiCharacterSetSufficient();

Support

Supported from 5.1

Description

This function is called by CParserProperty::ExternalizeL() to test whether a property value stored as text can be represented using the ASCII character set. If it is, implementations of this function return ETrue. If not, (because the value contains characters which cannot be represented using ASCII), they return EFalse and the CParserProperty class will select an appropriate character set instead. The character set used is the parser’s default character set, (as set by CVersitParser::SetDefaultCharSet()) or, if this is ASCII, then the encoding defaults to UTF-8. Note that if the parser’s default character set is UTF-7, then this will always be used in preference to ASCII or any other character set, and this function will not be called.

This implementation of the function simply returns ETrue. Overriden by classes CParserPropertyValueHBufC and CParserPropertyValueCDesCArray.

Return value

TBool

ETrue.

[Top]


Property value type


SupportsInterface()

virtual TBool SupportsInterface(const TUid& /*aInterfaceUid*/) const;

Description

Tests whether a property value supports the CParserTimePropertyValue interface. This implementation returns EFalse. Overriden by the CParserTimePropertyValue class to return ETrue.

Parameters

const TUid& /*aInterfaceUid*/

UID which identifies the property value type. Not used in this implementation.

Return value

TBool

EFalse


Uid()

TUid Uid() const;

Description

Returns the property value's UID. This UID identifies the property value's type and is specified on construction. The values are defined in vuid.h.

Return value

TUid

The property value's UID.