Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: VCARD.H
Link against: vcard.lib

Class CParserVCard

class CParserVCard : public CVersitParser;

Description

A vCard parser.

Adds support for property groups (see CParserGroupedProperty) and agents (see CParserPropertyValueAgent) to the functionality of CVersitParser.

Provides a constructor and overrides CVersitParser::InternalizeL(), ExternalizeL(), RecognizeToken(), ConvertAllPropertyDateTimesToMachineLocalL(), ParsePropertyL() and MakePropertyValueL().

The vCard data is read from or written to a stream or file, using the InternalizeL() and ExternalizeL() functions. Most users of this class will only need to use these functions.

If you are sequentially creating and destroying multiple parsers, a major performance improvement may be achieved by using thread local storage to store an instance of CVersitUnicodeUtils which persists and can be used by all of the parsers.

See CVersitTlsData for more information.

Derivation

Members

Defined in CParserVCard:
ConvertAllPropertyDateTimesToMachineLocalL(), ConvertDateTimesToMachineLocalAndDeleteTZL(), ExternalizeL(), GetGroupNamesL(), GroupOfPropertiesL(), InternalizeL(), MakePropertyValueAgentL(), MakePropertyValueL(), MakePropertyValueSoundL(), NewL(), ParsePropertyL(), RecognizeToken(), Reserved1(), Reserved2()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CVersitParser:
AddEntityL(), AddPropertyL(), AdjustAllPropertyDateTimesToMachineLocalL(), AnalysesEncodingCharset(), AppendBeginL(), AppendEndL(), ArrayOfEntities(), ArrayOfProperties(), BufPtr(), ClearSupportsVersion(), ConstructL(), ConvertFromUnicodeToISOL(), ConvertToUnicodeFromISOL(), DecodeDateTimeL(), DecodePropertyValueL(), DecodeTimePeriodL(), DecodeTimeZoneL(), DefaultCharSet(), DefaultCharSetId(), DefaultEncoding(), DoAddPropertyL(), ECarriageReturn, ECharSetIdentified, EHTab, EImportSyncML, ELineFeed, ENoVersionProperty, ESpace, ESupportsVersion, EUseAutoDetection, EUseDefaultCharSetForAllProperties, EntityL(), EntityName(), FindFirstField(), FindRemainingField(), GetNumberL(), GetPropertyParamsLC(), IsValidLabel(), IsValidParameterValue(), LineCharSet(), LineCharSetId(), LineEncoding(), LineEncodingId(), LoadBinaryValuesFromFilesL(), MakeEntityL(), MakePropertyL(), MakePropertyValueCDesCArrayL(), MakePropertyValueDaylightL(), MakePropertyValueMultiDateTimeL(), Observer(), ParseBeginL(), ParseEndL(), ParseEntityL(), ParseParamL(), ParsePropertiesL(), PlugIn(), PropertyL(), ReadLineAndDecodeParamsLC(), ReadMultiLineValueL(), RecognizeEntityName(), ResetAndDestroyArrayOfDateTimes(), ResetAndDestroyArrayOfEntities(), ResetAndDestroyArrayOfParams(), ResetAndDestroyArrayOfProperties(), RestoreLineCodingDetailsToDefault(), SaveBinaryValuesToFilesL(), SetAutoDetect(), SetCharacterConverter(), SetDefaultCharSet(), SetDefaultCharSetId(), SetDefaultEncoding(), SetEntityNameL(), SetFlags(), SetLineCharacterSet(), SetLineCharacterSetId(), SetLineCoding(), SetLineEncoding(), SetObserver(), SetPlugIn(), SetSupportsVersion(), SupportsVersion(), TCharCodes, TParserCodingDetails, TVersitParserFlags, UnicodeUtils(), Val(), iArrayOfEntities, iArrayOfProperties, iAutoDetectCharSets, iCurrentProperty, iCurrentPropertyCodingDetails, iDecodedValue, iDefaultCodingDetails, iDefaultVersion, iEntityName, iFlags, iLargeDataBuf, iLineReader, iObserver, iOwnedLineReader, iPlugIn, iStaticUtils, iWriteStream

See also


Construction and destruction


NewL()

static IMPORT_C CParserVCard *NewL();

Description

Allocates and constructs a vCard parser.

Return value

CParserVCard *

A pointer to the newly constructed vCard parser.

[Top]


Member functions


GroupOfPropertiesL()

IMPORT_C CArrayPtr< CParserProperty > *GroupOfPropertiesL(const TDesC8 &aName) const;

Description

Gets an array of all properties in the named property group from the vCard entity.

A property group is a collection of related properties, identified by a group name.

Ownership of the properties is not transferred.

Parameters

const TDesC8 &aName

The name of the property group of interest.

Return value

CArrayPtr< CParserProperty > *

An array of all properties in the specified group. NULL if the named property group was not found.


InternalizeL()

virtual IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Internalises a vCard entity from a read stream.

The presence of this function means that the standard templated operator>>() (defined in s32strm.h) is available to internalise objects of this class.

Parameters

RReadStream &aStream

Stream from which the vCard entity should be internalised.

See also:


ExternalizeL()

virtual IMPORT_C void ExternalizeL(RWriteStream &aStream);

Description

Externalises a vCard entity (and all sub-entities) to a write stream.

Sets the entity name to KVersitVarTokenVCARD if it hasn't already been set.

Adds a version property to the start of the current entity's array of properties if the entity supports this. (If there isn't an array of properties then one is made).

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

Parameters

RWriteStream &aStream

Stream to which the vCard entity should be externalised.

See also:


ConvertAllPropertyDateTimesToMachineLocalL()

virtual IMPORT_C void ConvertAllPropertyDateTimesToMachineLocalL(const TTimeIntervalSeconds &aIncrement, const CVersitDaylight *aDaylight);

Description

Converts all date/time property values contained in the vCard entity into machine local values (including all date/time values contained in agent properties).

This conversion is needed because of differences in universal and local times due to time zones and daylight savings (seasonal time shifts).

If there is a daylight savings rule associated with the date/time (held in the aDaylight parameter) then this will be used to compensate for differences between universal and local times due to both time zones and the daylight savings rule. Otherwise, the aIncrement parameter is used to compensate for any difference due to time zones alone.

Parameters

const TTimeIntervalSeconds &aIncrement

A time interval in seconds which represents the negative of the time zone of the originating machine. For instance, if the time zone is +04:30, aIncrement should be set to -04:30.

const CVersitDaylight *aDaylight

Pointer to the specification for daylight saving. If the date/time value is within the period for daylight saving, the value is modified by the daylight saving offset (which accounts for both the time zone and daylight saving rule).


MakePropertyValueAgentL()

protected: virtual IMPORT_C CParserPropertyValue *MakePropertyValueAgentL(TPtr16 aValue);

Description

Parameters

TPtr16 aValue

Return value

CParserPropertyValue *


GetGroupNamesL()

protected: IMPORT_C CDesC8Array *GetGroupNamesL(TPtr8 &aGroupsAndName);

Description

Parameters

TPtr8 &aGroupsAndName

Return value

CDesC8Array *


ParsePropertyL()

protected: virtual IMPORT_C void ParsePropertyL();

Description


MakePropertyValueL()

protected: virtual IMPORT_C CParserPropertyValue *MakePropertyValueL(const TUid &aPropertyUid, HBufC16 *&aValue);

Description

Creates a property value, by parsing the specified descriptor.

This function overrides CVersitParser::MakePropertyValueL() to ensure that agent and sound properties are correctly recognised and constructed.

Note that aValue may be set to NULL on return from this method.

Parameters

const TUid &aPropertyUid

The UID type associated with the raw property string.

HBufC16 *&aValue

The raw property value descriptor. The function removes anything that is not part of the property.

Return value

CParserPropertyValue *

A property value.


MakePropertyValueSoundL()

protected: IMPORT_C CParserPropertyValue *MakePropertyValueSoundL(HBufC16 *&aValue);

Description

Creates a property value object from a SOUND property value.

SOUND property values can either contain a single string (using HBufC storage) or, following the addition of Japanese pronunciation support to Symbian's Versit API, an array (using CDesCArray storage). This method allocates the additional storage needed to support array-based sound properties, when necessary.

Note that aValue will be set to NULL on return from this method.

Parameters

HBufC16 *&aValue

The raw property value descriptor.

Return value

CParserPropertyValue *

A constructed sound property value.


RecognizeToken()

virtual IMPORT_C TUid RecognizeToken(const TDesC8 &aToken) const;

Description

Returns a UID that identifies a specified token's type.

For example, if aToken contains the property name BDAY, the function returns KVersitPropertyDateUid. If the token is not recognized as vCard-specific, the function calls CVersitParser::RecognizeToken(), which recognizes generic Versit tokens.

Parameters

const TDesC8 &aToken

The token to be recognized.

Return value

TUid

A defined UID value if the token is recognized and KVersitTokenUnknownUid if not.


ConvertDateTimesToMachineLocalAndDeleteTZL()

IMPORT_C void ConvertDateTimesToMachineLocalAndDeleteTZL();

Description

Converts all date/time property values contained in the vCard entity into machine local values (including all date/time values contained in agent properties).

This conversion is needed because of differences in universal and local times due to time zones.

Finds the necessary increment to compensate for the time zone, using the value given by the first time zone property (named KVersitTokenTZ) in the array of properties. This increment is passed as a parameter to ConvertAllPropertyDateTimesToMachineLocalL(). The CVersitDaylight* parameter passed to ConvertAllPropertyDateTimesToMachineLocalL() is NULL, so no compensation can be made by this function for any daylight saving (seasonal time shift).


Reserved1()

private: virtual IMPORT_C void Reserved1();

Description


Reserved2()

private: virtual IMPORT_C void Reserved2();

Description