CParserVCard Class Reference

class CParserVCard : public CVersitParser

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.

Inherits from

Public Member Functions
IMPORT_C voidConvertAllPropertyDateTimesToMachineLocalL(const TTimeIntervalSeconds &, const CVersitDaylight *)
IMPORT_C voidConvertDateTimesToMachineLocalAndDeleteTZL()
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C CArrayPtr< CParserProperty > *GroupOfPropertiesL(const TDesC8 &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C CParserVCard *NewL()
CParserVCard *NewL(TBool)
IMPORT_C TUidRecognizeToken(const TDesC8 &)
Protected Member Functions
CParserVCard()
CParserVCard(TBool)
IMPORT_C CDesC8Array *GetGroupNamesL(TPtr8 &)
IMPORT_C CParserPropertyValue *MakePropertyValueAgentL(TPtr16)
IMPORT_C CParserPropertyValue *MakePropertyValueL(const TUid &, HBufC16 *&)
IMPORT_C CParserPropertyValue *MakePropertyValueSoundL(HBufC16 *&)
IMPORT_C voidParsePropertyL()
Private Member Functions
IMPORT_C voidReserved1()
IMPORT_C voidReserved2()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CVersitParser::AddEntityL(CVersitParser *)
CVersitParser::AddPropertyL(CParserProperty *,TBool)
CVersitParser::AdjustAllPropertyDateTimesToMachineLocalL()
CVersitParser::AnalysesEncodingCharset(CArrayPtr< CParserParam > *)
CVersitParser::AppendBeginL()
CVersitParser::AppendEndL()
CVersitParser::AppendEntityNameL()
CVersitParser::ArrayOfEntities(TBool)
CVersitParser::ArrayOfProperties(TBool)
CVersitParser::BufPtr()
CVersitParser::CVersitParser(TUint)
CVersitParser::ClearSupportsVersion()
CVersitParser::ConstructL()
CVersitParser::ConvertFromUnicodeToISOL(TDes8 &,const TDesC16 &,CCnvCharacterSetConverter *)
CVersitParser::ConvertToUnicodeFromISOL(TDes16 &,const TDesC8 &,TUint)
CVersitParser::ConvertToUnicodeL(const TDesC8 &)
CVersitParser::DecodeDateTimeL(TDes &)const
CVersitParser::DecodePropertyValueL(const TDesC8 &)
CVersitParser::DecodePropertyValueL(const TDesC8 &,const TUid &)
CVersitParser::DecodeTimePeriodL(const TDesC &)const
CVersitParser::DecodeTimeZoneL(const TDesC &)const
CVersitParser::DefaultCharSet()const
CVersitParser::DefaultCharSetId()const
CVersitParser::DefaultEncoding()const
CVersitParser::DoAddPropertyL(CParserProperty *)
CVersitParser::EntityL(const TDesC &,TBool)
CVersitParser::EntityName()const
CVersitParser::ExternalizeL(RFile &)
CVersitParser::FindFirstField(TPtr16 &,TPtr16 &,TBool)
CVersitParser::FindRemainingField(TPtr16 &,TPtr16 &)
CVersitParser::GetNumberL(const TDesC &,TInt &)const
CVersitParser::GetPropertyParamsLC(TPtr8)
CVersitParser::InternalizeL(HBufC *,CLineReader *)
CVersitParser::InternalizeL(RFile &,TInt &)
CVersitParser::IsPunctuationToken(TUint)
CVersitParser::IsValidLabel(const TDesC &,TInt &)
CVersitParser::IsValidParameterValue(TInt &,const TDesC &)
CVersitParser::LineCharSet()const
CVersitParser::LineCharSetId()const
CVersitParser::LineEncoding()const
CVersitParser::LineEncodingId()const
CVersitParser::LoadBinaryValuesFromFilesL()
CVersitParser::LoadBinaryValuesFromFilesL(RFs &)
CVersitParser::MakeDefaultPropertyValueL(HBufC16 *&)
CVersitParser::MakeEntityL(TInt,HBufC *)
CVersitParser::MakePropertyL(TPtr8 &,TInt)
CVersitParser::MakePropertyValueCDesCArrayL(TPtr16)
CVersitParser::MakePropertyValueDaylightL(TPtr16)
CVersitParser::MakePropertyValueMultiDateTimeL(TPtr16)
CVersitParser::MapVersitCharsetToCharConvCharset(Versit::TVersitCharSet)
CVersitParser::MapVersitEncodingToConArcUid(Versit::TVersitEncoding)
CVersitParser::Observer()
CVersitParser::ParseBeginL()
CVersitParser::ParseEndL()
CVersitParser::ParseEndL(HBufC16 &)
CVersitParser::ParseEntityL()
CVersitParser::ParseParamL(CArrayPtr< CParserParam > *,TPtr8)
CVersitParser::ParsePropertiesL()
CVersitParser::PlugIn()
CVersitParser::PropertyL(const TDesC8 &,const TUid &,TBool)const
CVersitParser::ReadLineAndDecodeParamsLC(TInt &,TInt &)
CVersitParser::ReadMultiLineValueL(TPtr8 &,TInt,TBool)
CVersitParser::RecognizeEntityName()const
CVersitParser::ResetAndDestroyArrayOfDateTimes(TAny *)
CVersitParser::ResetAndDestroyArrayOfEntities(TAny *)
CVersitParser::ResetAndDestroyArrayOfParams(TAny *)
CVersitParser::ResetAndDestroyArrayOfProperties(TAny *)
CVersitParser::RestoreLineCodingDetailsToDefault()
CVersitParser::SaveBinaryValuesToFilesL(TInt,const TDesC &)
CVersitParser::SaveBinaryValuesToFilesL(TInt,const TDesC &,RFs &)
CVersitParser::SetAutoDetect(TBool,const CArrayFix< CCnvCharacterSetConverter::SCharacterSet > *)
CVersitParser::SetCharacterConverter(Versit::TEncodingAndCharset &)
CVersitParser::SetDefaultCharSet(const Versit::TVersitCharSet)
CVersitParser::SetDefaultCharSetId(TUint)
CVersitParser::SetDefaultEncoding(const Versit::TVersitEncoding)
CVersitParser::SetEntityNameL(const TDesC &)
CVersitParser::SetFlags(TUint)
CVersitParser::SetLineCharacterSet(Versit::TVersitCharSet)
CVersitParser::SetLineCharacterSetId(TUint)
CVersitParser::SetLineCoding(Versit::TVersitCharSet,Versit::TVersitEncoding)
CVersitParser::SetLineEncoding(TUint)
CVersitParser::SetLineEncoding(Versit::TVersitEncoding)
CVersitParser::SetObserver(MVersitObserver *)
CVersitParser::SetPlugIn(MVersitPlugIn *)
CVersitParser::SetSupportsVersion()
CVersitParser::SupportsVersion()const
CVersitParser::UnicodeUtils()
CVersitParser::Val(const TDesC &,TInt &)
CVersitParser::~CVersitParser()
Inherited Enumerations
CVersitParser:TCharCodes
CVersitParser:TVersitParserFlags
Private Attributes
TBool iParsingAgent
Inherited Attributes
CVersitParser::iArrayOfEntities
CVersitParser::iArrayOfProperties
CVersitParser::iAutoDetectCharSets
CVersitParser::iCurrentProperty
CVersitParser::iCurrentPropertyCodingDetails
CVersitParser::iDecodedValue
CVersitParser::iDefaultCodingDetails
CVersitParser::iDefaultVersion
CVersitParser::iEntityName
CVersitParser::iFlags
CVersitParser::iLargeDataBuf
CVersitParser::iLineReader
CVersitParser::iObserver
CVersitParser::iOwnedLineReader
CVersitParser::iPlugIn
CVersitParser::iStaticUtils
CVersitParser::iWriteStream

Constructor & Destructor Documentation

CParserVCard()

CParserVCard()[protected]

CParserVCard(TBool)

CParserVCard(TBoolaParsingAgent)[protected]

Parameters

TBool aParsingAgent

Member Functions Documentation

ConvertAllPropertyDateTimesToMachineLocalL(const TTimeIntervalSeconds &, const CVersitDaylight *)

IMPORT_C voidConvertAllPropertyDateTimesToMachineLocalL(const TTimeIntervalSeconds &aIncrement,
const CVersitDaylight *aDaylight
)[virtual]

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.

since 9.1

Parameters

const TTimeIntervalSeconds & aIncrementA 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 * aDaylightPointer 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).

ConvertDateTimesToMachineLocalAndDeleteTZL()

IMPORT_C voidConvertDateTimesToMachineLocalAndDeleteTZL()

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). since 9.1

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)[virtual]

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.

CVersitParser::ExternalizeL()

Parameters

RWriteStream & aStreamStream to which the vCard entity should be externalised.

GetGroupNamesL(TPtr8 &)

IMPORT_C CDesC8Array *GetGroupNamesL(TPtr8 &aGroupsAndName)[protected]

Parameters

TPtr8 & aGroupsAndName

GroupOfPropertiesL(const TDesC8 &)

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

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 & aNameThe name of the property group of interest.

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aStream)[virtual]

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.

CVersitParser::InternalizeL()

Parameters

RReadStream & aStreamStream from which the vCard entity should be internalised.

MakePropertyValueAgentL(TPtr16)

IMPORT_C CParserPropertyValue *MakePropertyValueAgentL(TPtr16aValue)[protected, virtual]

Parameters

TPtr16 aValue

MakePropertyValueL(const TUid &, HBufC16 *&)

IMPORT_C CParserPropertyValue *MakePropertyValueL(const TUid &aPropertyUid,
HBufC16 *&aValue
)[protected, virtual]

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 & aPropertyUidThe UID type associated with the raw property string.
HBufC16 *& aValueThe raw property value descriptor. The function removes anything that is not part of the property.

MakePropertyValueSoundL(HBufC16 *&)

IMPORT_C CParserPropertyValue *MakePropertyValueSoundL(HBufC16 *&aValue)[protected]

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 *& aValueThe raw property value descriptor.

NewL()

IMPORT_C CParserVCard *NewL()[static]

Allocates and constructs a vCard parser.

NewL(TBool)

CParserVCard *NewL(TBoolaParsingAgent)[static]

Parameters

TBool aParsingAgent

ParsePropertyL()

IMPORT_C voidParsePropertyL()[protected, virtual]

RecognizeToken(const TDesC8 &)

IMPORT_C TUidRecognizeToken(const TDesC8 &aToken)const [virtual]

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 & aTokenThe token to be recognized.

Reserved1()

IMPORT_C voidReserved1()[private, virtual]

Reserved2()

IMPORT_C voidReserved2()[private, virtual]

Member Data Documentation

TBool iParsingAgent

TBool iParsingAgent[private]