CVersitParser Class Reference

#include <app/versit.h>

Link against: versit.lib

class CVersitParser : public CBase

Inherits from

  • CVersitParser

    Nested Classes and Structures

    Protected Attributes
    CArrayPtr< CVersitParser > *iArrayOfEntities
    CArrayPtr< CParserProperty > *iArrayOfProperties
    const CArrayFix< CCnvCharacterSetConverter::SCharacterSet > *iAutoDetectCharSets
    CParserProperty *iCurrentProperty
    TParserCodingDetails iCurrentPropertyCodingDetails
    HBufC8 *iDecodedValue
    TParserCodingDetails iDefaultCodingDetails
    TBuf< KVersitMaxVersionLength >iDefaultVersion
    HBufC *iEntityName
    TInt iFlags
    CBufSeg *iLargeDataBuf
    CLineReader *iLineReader
    MVersitObserver *iObserver
    CLineReader *iOwnedLineReader
    MVersitPlugIn *iPlugIn
    CVersitTlsData *iStaticUtils
    RWriteStream *iWriteStream
    Public Member Enumerations
    enumTCharCodes { ESpace, EHTab, ELineFeed, ECarriageReturn, EColon }
    enumTVersitParserFlags { ENoVersionProperty, ESupportsVersion, EImportSyncML, EUseAutoDetection, ..., EUseDefaultCharSetForAllProperties }
    Public Member Functions
    CVersitParser(TUint)
    ~CVersitParser()
    IMPORT_C voidAddEntityL(CVersitParser *)
    IMPORT_C voidAddPropertyL(CParserProperty *, TBool)
    IMPORT_C voidAdjustAllPropertyDateTimesToMachineLocalL()
    IMPORT_C CArrayPtr< CVersitParser > *ArrayOfEntities(TBool)
    IMPORT_C CArrayPtr< CParserProperty > *ArrayOfProperties(TBool)
    IMPORT_C voidConstructL()
    virtual IMPORT_C voidConvertAllPropertyDateTimesToMachineLocalL(const TTimeIntervalSeconds &, const CVersitDaylight *)
    IMPORT_C TIntConvertFromUnicodeToISOL(TDes8 &, const TDesC16 &, CCnvCharacterSetConverter *)
    IMPORT_C TVersitDateTime *DecodeDateTimeL(TDes &)
    IMPORT_C Versit::TVersitCharSetDefaultCharSet()
    IMPORT_C TUintDefaultCharSetId()
    IMPORT_C Versit::TVersitEncodingDefaultEncoding()
    IMPORT_C CArrayPtr< CVersitParser > *EntityL(const TDesC &, TBool)
    IMPORT_C TPtrCEntityName()
    IMPORT_C voidExternalizeL(RFile &)
    virtual IMPORT_C voidExternalizeL(RWriteStream &)
    IMPORT_C voidInternalizeL(RFile &, TInt &)
    virtual IMPORT_C voidInternalizeL(RReadStream &)
    virtual IMPORT_C voidInternalizeL(HBufC *, CLineReader *)
    IMPORT_C TBoolIsValidLabel(const TDesC &, TInt &)
    IMPORT_C TBoolIsValidParameterValue(TInt &, const TDesC &)
    IMPORT_C TIntLoadBinaryValuesFromFilesL()
    IMPORT_C TIntLoadBinaryValuesFromFilesL(RFs &)
    TUint MapVersitCharsetToCharConvCharset(Versit::TVersitCharSet)
    TUint MapVersitEncodingToConArcUid(Versit::TVersitEncoding)
    MVersitObserver *Observer()
    MVersitPlugIn *PlugIn()
    IMPORT_C CArrayPtr< CParserProperty > *PropertyL(const TDesC8 &, const TUid &, TBool)
    virtual IMPORT_C TIntRecognizeEntityName()
    virtual IMPORT_C TUidRecognizeToken(const TDesC8 &)
    IMPORT_C voidResetAndDestroyArrayOfDateTimes(TAny *)
    IMPORT_C voidResetAndDestroyArrayOfEntities(TAny *)
    IMPORT_C voidResetAndDestroyArrayOfParams(TAny *)
    IMPORT_C voidResetAndDestroyArrayOfProperties(TAny *)
    IMPORT_C TIntSaveBinaryValuesToFilesL(TInt, const TDesC &)
    IMPORT_C TIntSaveBinaryValuesToFilesL(TInt, const TDesC &, RFs &)
    IMPORT_C voidSetAutoDetect(TBool, const CArrayFix< CCnvCharacterSetConverter::SCharacterSet > *)
    IMPORT_C voidSetCharacterConverter(Versit::TEncodingAndCharset &)
    IMPORT_C voidSetDefaultCharSet(const Versit::TVersitCharSet)
    IMPORT_C voidSetDefaultCharSetId(TUint)
    IMPORT_C voidSetDefaultEncoding(const Versit::TVersitEncoding)
    IMPORT_C voidSetEntityNameL(const TDesC &)
    voidSetFlags(TUint)
    voidSetObserver(MVersitObserver *)
    voidSetPlugIn(MVersitPlugIn *)
    IMPORT_C TIntVal(const TDesC &, TInt &)
    Protected Member Functions
    IMPORT_C voidAnalysesEncodingCharset(CArrayPtr< CParserParam > *)
    IMPORT_C voidAppendBeginL()
    IMPORT_C voidAppendEndL()
    voidAppendEntityNameL()
    TPtr8 &BufPtr()
    voidClearSupportsVersion()
    IMPORT_C TIntConvertToUnicodeFromISOL(TDes16 &, const TDesC8 &, TUint)
    HBufC *ConvertToUnicodeL(const TDesC8 &)
    IMPORT_C HBufC *DecodePropertyValueL(const TDesC8 &)
    IMPORT_C voidDecodePropertyValueL(const TDesC8 &, const TUid &)
    IMPORT_C TTime *DecodeTimePeriodL(const TDesC &)
    IMPORT_C TTimeIntervalSecondsDecodeTimeZoneL(const TDesC &)
    IMPORT_C voidDoAddPropertyL(CParserProperty *)
    IMPORT_C TBoolFindFirstField(TPtr16 &, TPtr16 &, TBool)
    IMPORT_C voidFindRemainingField(TPtr16 &, TPtr16 &)
    IMPORT_C TIntGetNumberL(const TDesC &, TInt &)
    IMPORT_C CArrayPtr< CParserParam > *GetPropertyParamsLC(TPtr8)
    TBool IsPunctuationToken(TUint)
    IMPORT_C Versit::TVersitCharSetLineCharSet()
    IMPORT_C TUintLineCharSetId()
    IMPORT_C Versit::TVersitEncodingLineEncoding()
    IMPORT_C TUintLineEncodingId()
    CParserPropertyValueHBufC *MakeDefaultPropertyValueL(HBufC16 *&)
    virtual IMPORT_C CVersitParser *MakeEntityL(TInt, HBufC *)
    IMPORT_C voidMakePropertyL(TPtr8 &, TInt)
    IMPORT_C CDesCArray *MakePropertyValueCDesCArrayL(TPtr16)
    IMPORT_C CVersitDaylight *MakePropertyValueDaylightL(TPtr16)
    virtual IMPORT_C CParserPropertyValue *MakePropertyValueL(const TUid &, HBufC16 *&)
    IMPORT_C CArrayPtr< TVersitDateTime > *MakePropertyValueMultiDateTimeL(TPtr16)
    IMPORT_C voidParseBeginL()
    IMPORT_C voidParseEndL()
    voidParseEndL(HBufC16 &)
    IMPORT_C TBoolParseEntityL()
    IMPORT_C voidParseParamL(CArrayPtr< CParserParam > *, TPtr8)
    IMPORT_C voidParsePropertiesL()
    virtual IMPORT_C voidParsePropertyL()
    IMPORT_C CArrayPtr< CParserParam > *ReadLineAndDecodeParamsLC(TInt &, TInt &)
    IMPORT_C voidReadMultiLineValueL(TPtr8 &, TInt, TBool)
    IMPORT_C voidRestoreLineCodingDetailsToDefault()
    IMPORT_C voidSetLineCharacterSet(Versit::TVersitCharSet)
    IMPORT_C voidSetLineCharacterSetId(TUint)
    IMPORT_C voidSetLineCoding(Versit::TVersitCharSet, Versit::TVersitEncoding)
    IMPORT_C voidSetLineEncoding(Versit::TVersitEncoding)
    IMPORT_C voidSetLineEncoding(TUint)
    voidSetSupportsVersion()
    TBool SupportsVersion()
    CVersitUnicodeUtils &UnicodeUtils()
    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()

    Detailed Description

    A generic Versit parser.

    Provides generic functions which implement behaviour common to both vCalendar and vCard parsers. For instance:

    • adding/retrieving properties and sub-entities to/from an existing entity.

    • encoding and character set conversion capabilities.

    Although this is not an abstract class, in practice you would create and use objects of a derived class instead (CParserVCal or CParserVCard), as these provide additional functionality needed for parsing vCalendars and vCards.

    Note: a flag used in the class constructor indicates whether the entity needs a version property. The version property will be inserted at the start of the array of properties for the entity, and specifies the version of the vCard/vCalendar specification used by the data of this particular vCard/vCalendar. The versions that are currently supported are vCard v2.1 and vCalendar v1.0.

    A typical vCard looks like this:

    BEGIN VCARD

    VERSION 2.1 ...

    END VCARD

    Note: 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 details.

    Member Attribute Documentation

    iArrayOfEntities

    CArrayPtr< CVersitParser > *iArrayOfEntities[protected]

    iArrayOfProperties

    CArrayPtr< CParserProperty > *iArrayOfProperties[protected]

    iAutoDetectCharSets

    const CArrayFix< CCnvCharacterSetConverter::SCharacterSet > *iAutoDetectCharSets[protected]

    iCurrentProperty

    CParserProperty *iCurrentProperty[protected]

    iCurrentPropertyCodingDetails

    TParserCodingDetails iCurrentPropertyCodingDetails[protected]

    iDecodedValue

    HBufC8 *iDecodedValue[protected]

    iDefaultCodingDetails

    TParserCodingDetails iDefaultCodingDetails[protected]

    iDefaultVersion

    TBuf< KVersitMaxVersionLength >iDefaultVersion[protected]

    iEntityName

    HBufC *iEntityName[protected]

    iFlags

    TInt iFlags[protected]

    iLargeDataBuf

    CBufSeg *iLargeDataBuf[protected]

    iLineReader

    CLineReader *iLineReader[protected]

    iObserver

    MVersitObserver *iObserver[protected]

    iOwnedLineReader

    CLineReader *iOwnedLineReader[protected]

    iPlugIn

    MVersitPlugIn *iPlugIn[protected]

    iStaticUtils

    CVersitTlsData *iStaticUtils[protected]

    iWriteStream

    RWriteStream *iWriteStream[protected]

    Member Enumeration Documentation

    Enum TCharCodes

    White space character codes: used while analysing the syntax of the received data and while externalising data.

    EnumeratorValueDescription
    ESpace' '

    ' '

    EHTab9

    9

    ELineFeed10

    10

    ECarriageReturn13

    13

    EColon':'

    ':'

    Enum TVersitParserFlags

    Flags that can be specified on construction.

    EnumeratorValueDescription
    ENoVersionProperty0

    This entity does not need a version property.

    ESupportsVersion0x01

    This entity should have a version property.

    EImportSyncML0x1000
    EUseAutoDetection0x4000

    Indicates whether the parser should use auto-detection of character sets when one has not been explicitly specified.

    ECharSetIdentified0x8000

    The current property has specified a character set.

    EUseDefaultCharSetForAllProperties0x2000

    If the charset is not explicitly specified, the default charset will be used instead of US-ASCII as required by the Versit specification .

    Constructor & Destructor Documentation

    CVersitParser ( TUint )

    IMPORT_CCVersitParser(TUintaFlags)

    The first phase constructor for a Versit parser.

    Sets the default encoding to Versit::ENoEncoding and the default character set to Versit::EUSAsciiCharSet.

    Note: this function is called by the CParserVCal and CParserVCard constructors. It should only be called directly by a user if creating a new parser

    ParameterDescription
    aFlagsThe flag to indicate whether this entity needs a version property. The possible values for this flag are given in the TVersitParserFlags enumeration. If a version property is needed, one will be created and appended to the start of the array of properties.

    ~CVersitParser ( )

    IMPORT_C~CVersitParser()

    Frees all resources owned by the object, prior to its destruction.

    Member Function Documentation

    AddEntityL ( CVersitParser * )

    IMPORT_C voidAddEntityL(CVersitParser *aEntity)

    Adds a sub-entity (e.g. a to-do, event or a nested vCard) to the current entity.

    Sets the default encoding and character set to the default ones of the current Versit parser, then adds the entity to the array of entities owned by the parser.

    Note: This function may be used when building up a Versit parser object from a client application.

    Called by ParseEntityL().

    ParameterDescription
    aEntityThe entity to be added into the array of entities. Ownership of aEntity is taken at beginning of the function.

    AddPropertyL ( CParserProperty *, TBool )

    IMPORT_C voidAddPropertyL(CParserProperty *aProperty,
    TBoolaInternalizing = EFalse
    )

    Appends a property to the current entity's array of properties.

    This function may be used when building up a Versit parser object from a client application. It is not called internally.

    ParameterDescription
    aPropertyPointer to the property to add to the entity.
    aInternalizingThis parameter is used to distinguish between reading an entity from a stream or file (i.e. internalising), in which case the argument should have a value of ETrue, and building an entity "by hand" (e.g. creating a vCard in the Contacts application), in which case the argument should have a value of EFalse.

    AdjustAllPropertyDateTimesToMachineLocalL ( )

    IMPORT_C voidAdjustAllPropertyDateTimesToMachineLocalL()

    AnalysesEncodingCharset ( CArrayPtr< CParserParam > * )

    IMPORT_C voidAnalysesEncodingCharset(CArrayPtr< CParserParam > *aArrayOfParams)[protected]

    AppendBeginL ( )

    IMPORT_C voidAppendBeginL()[protected]

    AppendEndL ( )

    IMPORT_C voidAppendEndL()[protected]

    AppendEntityNameL ( )

    voidAppendEntityNameL()[protected]

    ArrayOfEntities ( TBool )

    IMPORT_C CArrayPtr< CVersitParser > *ArrayOfEntities(TBoolaTakeOwnership = ETrue)

    Gets the current entity's array of sub-entities.

    Note: the current entity may be a top level entity, or may itself be a sub-entity.

    ParameterDescription
    aTakeOwnershipIf ETrue, the calling code takes ownership of the array; the array of entities owned by the current entity is then deleted. If EFalse, ownership remains with the Versit parser.

    Returns: Array of pointers to the current entity's array of sub-entities.

    ArrayOfProperties ( TBool )

    IMPORT_C CArrayPtr< CParserProperty > *ArrayOfProperties(TBoolaTakeOwnership = ETrue)

    Gets the current entity's array of properties.

    ParameterDescription
    aTakeOwnershipIf ETrue, the calling code takes ownership of the array; the entity's array of properties is then deleted . If EFalse, ownership remains with the entity.

    Returns: Array of pointers to the entity's properties.

    BufPtr ( )

    TPtr8 &BufPtr()[protected, inline]

    ClearSupportsVersion ( )

    voidClearSupportsVersion()[protected, inline]

    ConstructL ( )

    IMPORT_C voidConstructL()

    The second phase constructor for a Versit parser.

    Stores a pointer to a CVersitTlsData (thread local storage data class). This is used to allow an instance of CVersitUnicodeUtils to be shared by all co-existing parsers, which provides a major performance improvement.

    Called by the CParserVCal and CParserVCard constructors.

    Should only be called directly by a user if creating a new parser.

    ConvertAllPropertyDateTimesToMachineLocalL ( const TTimeIntervalSeconds &, const CVersitDaylight * )

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

    Converts all date/time property values contained in the current entity's array of properties into machine local values.

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

    First, all of the date/times are converted to universal time, if they are not already:

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

    Then, these universal time values are converted into machine local times by adding the universal time offset for the machine's locale.

    Deprecatedsince 9.1

    ParameterDescription
    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.
    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).

    ConvertFromUnicodeToISOL ( TDes8 &, const TDesC16 &, CCnvCharacterSetConverter * )

    IMPORT_C TIntConvertFromUnicodeToISOL(TDes8 &aIso,
    const TDesC16 &aUnicode,
    CCnvCharacterSetConverter *aConverter
    )[static]

    Converts text in the Unicode character set (UCS-2) into a non-unicode (International Standards Organisation) character set.

    Which ISO character set the string is converted to is determined by the value of the character set identifier in the aConverter parameter.

    ParameterDescription
    aIsoOn return, the converted text string in the specified ISO character set.
    aUnicodeThe Unicode text string to be converted.
    aConverterThe character set converter.

    Returns: If no error occurs, this is the number of unconverted characters left at the end of the input descriptor. This is zero if the whole string is converted, but may be greater than zero (e.g. because the output descriptor is not long enough to hold all the text). Otherwise, one of the error values defined in TError in the CCnvCharacterSetConverter class, or KErrNotFound if aConverter does not point to a valid character set converter object.

    ConvertToUnicodeFromISOL ( TDes16 &, const TDesC8 &, TUint )

    IMPORT_C TIntConvertToUnicodeFromISOL(TDes16 &aUnicode,
    const TDesC8 &aIso,
    TUintaCharacterSet
    )[protected]

    Converts text in a non-Unicode character set into Unicode (UCS-2).

    ParameterDescription
    aUnicodeOn return, the converted text string in the Unicode character set.
    aIsoThe non-Unicode text string to be converted.
    aCharacterSetThe non-Unicode character set in which aIso is encoded.

    Returns: If no error occurs, the number of unconverted bytes left at the end of the input descriptor. This is zero if the whole string is converted; but it may be greater than zero, e.g. because the output descriptor is not long enough to hold all the text. Otherwise, one of the error values defined in TError in the CCnvCharacterSetConverter class, or KErrNotFound if aCharacterSet cannot be converted.

    ConvertToUnicodeL ( const TDesC8 & )

    HBufC *ConvertToUnicodeL(const TDesC8 &aValue)[protected]

    DecodeDateTimeL ( TDes & )

    IMPORT_C TVersitDateTime *DecodeDateTimeL(TDes &aToken)const

    DecodePropertyValueL ( const TDesC8 & )

    IMPORT_C HBufC *DecodePropertyValueL(const TDesC8 &aValue)[protected]

    DecodePropertyValueL ( const TDesC8 &, const TUid & )

    IMPORT_C voidDecodePropertyValueL(const TDesC8 &aValue,
    const TUid &aEncodingUid
    )[protected]

    DecodeTimePeriodL ( const TDesC & )

    IMPORT_C TTime *DecodeTimePeriodL(const TDesC &aToken)const [protected]

    DecodeTimeZoneL ( const TDesC & )

    IMPORT_C TTimeIntervalSecondsDecodeTimeZoneL(const TDesC &aToken)const [protected]

    DefaultCharSet ( )

    IMPORT_C Versit::TVersitCharSetDefaultCharSet()const

    Gets the default character set or transformation format. This may be used to represent property values in Versit objects.

    Returns: The default character set.

    DefaultCharSetId ( )

    IMPORT_C TUintDefaultCharSetId()const

    Gets the default character set or transformation format.

    This may be used to represent property values in Versit objects.

    Returns: The default character set identifier. Possible values are defined in charconv.h.

    DefaultEncoding ( )

    IMPORT_C Versit::TVersitEncodingDefaultEncoding()const

    Gets the parser's default encoding.

    This value is initialised on construction, to ENoEncoding.

    Returns: The parser's default encoding.

    DoAddPropertyL ( CParserProperty * )

    IMPORT_C voidDoAddPropertyL(CParserProperty *aProperty)[protected]

    EntityL ( const TDesC &, TBool )

    IMPORT_C CArrayPtr< CVersitParser > *EntityL(const TDesC &aEntityName,
    TBoolaTakeOwnership = ETrue
    )

    Gets all sub-entities in the current entity, whose name matches the name specified.

    ParameterDescription
    aEntityNameThe sub-entity name of interest, e.g. KVersitVarTokenVEVENT or KVersitVarTokenVTODO. All sub-entities which match this name are returned in the array of pointers.
    aTakeOwnershipIf ETrue, the calling code takes ownership of each matching sub-entity, in which case the sub-entities are deleted from the current object's array of entities. If EFalse, ownership remains with the Versit parser.

    Returns: An array of pointers to all sub-entities with the specified name. (Ownership is taken by the calling code).

    EntityName ( )

    IMPORT_C TPtrCEntityName()const

    Gets the current entity's name.

    If no name has been set, returns an empty descriptor.

    Returns: The current entity's name.

    ExternalizeL ( RFile & )

    IMPORT_C voidExternalizeL(RFile &aOutputFile)

    Externalises a Versit entity (vCard or vCalendar) and all of its sub-entities and properties to a file.

    Adds a version property to the start of the current entity's array of properties if the entity supports this.

    This is a thin layer over the CVersitParser::ExternalizeL(RWriteStream& aStream) function to enable a versit entity to be externalised into an RFile.

    ParameterDescription
    aOutputFileThe file to which to write the entity.

    ExternalizeL ( RWriteStream & )

    IMPORT_C voidExternalizeL(RWriteStream &aStream)[virtual]

    Externalises a Versit entity (vCard or vCalendar) and all of its sub-entities and properties to a write stream.

    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.

    This virtual function serves as a base function for derived classes to externalise an entity.

    ParameterDescription
    aStreamStream to which the entity should be externalised.

    FindFirstField ( TPtr16 &, TPtr16 &, TBool )

    IMPORT_C TBoolFindFirstField(TPtr16 &aField,
    TPtr16 &aRemaining,
    TBoolaTrimSpace = ETrue
    )[protected]

    FindRemainingField ( TPtr16 &, TPtr16 & )

    IMPORT_C voidFindRemainingField(TPtr16 &aField,
    TPtr16 &aRemaining
    )[protected]

    Sets up a pointer to the remaining field. Sets the original remaining field pointers length to 0.

    ParameterDescription
    aFieldon return points to the data and length that aRemaining originally pointed to.
    aRemainingas input references a location that the descriptor is to represent. On return length is set to 0.

    GetNumberL ( const TDesC &, TInt & )

    IMPORT_C TIntGetNumberL(const TDesC &aToken,
    TInt &aNumChars
    )const [protected]

    GetPropertyParamsLC ( TPtr8 )

    IMPORT_C CArrayPtr< CParserParam > *GetPropertyParamsLC(TPtr8aParams)[protected]

    InternalizeL ( RFile &, TInt & )

    IMPORT_C voidInternalizeL(RFile &aInputFile,
    TInt &aBytesThroughFile
    )

    Internalises a versit entity (vCard or vCalendar) and all of its sub-entities and properties from a file.

    Stores all date/time in same format as received

    leave
    KErrEof The file position specified is beyond the end of the file.
    ParameterDescription
    aInputFileThe file from which to internalise the entity.
    aBytesThroughFileThe number of bytes into the file at which to begin reading. On return, is updated to contain the last position in the file which was read.

    InternalizeL ( RReadStream & )

    IMPORT_C voidInternalizeL(RReadStream &aStream)[virtual]

    Internalises a Versit entity (vCard or vCalendar) contained in the incoming stream and parses it, breaking it down into its constituent sub-entities (e.g. to-dos, events, and nested vCards) and properties.

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

    This virtual function serves as a base function for derived classes to internalise an entity.

    ParameterDescription
    aStreamStream from which the vCalendar should be internalised.

    InternalizeL ( HBufC *, CLineReader * )

    IMPORT_C voidInternalizeL(HBufC *aEntityName,
    CLineReader *aLineReader
    )[virtual]

    Internalises a vCalendar or vCard sub-entity.

    (Assumes "BEGIN : <EntityName> CRLF" has been parsed).

    This virtual function serves as a base function for derived classes to parse a sub-entity.

    ParameterDescription
    aEntityNameThe entity name to be parsed. Ownership of aEntityName is taken by the parser.
    aLineReaderPointer to a line reader which is used by the super-entity.

    IsPunctuationToken ( TUint )

    TBool IsPunctuationToken(TUintaChar)[protected, static]

    IsValidLabel ( const TDesC &, TInt & )

    IMPORT_C TBoolIsValidLabel(const TDesC &aLabel,
    TInt &aPos
    )[static]

    Tests whether a property name is valid.

    The property name is invalid if it contains any of the following characters:-

    [] (left or right square bracket)

    = (equals sign)

    : (colon)

    . (dot)

    , (comma)

    ParameterDescription
    aLabelThe property name to test.
    aPosOn return, contains the character position within the property name of the first invalid character found.

    Returns: ETrue if valid, EFalse if invalid.

    IsValidParameterValue ( TInt &, const TDesC & )

    IMPORT_C TBoolIsValidParameterValue(TInt &aPos,
    const TDesC &aParamValue
    )[static]

    Tests whether a property parameter name or value is valid.

    If the string aParamValue contains any punctuation characters, the string is invalid. Otherwise, it is valid. Punctuation characters are defined as any of the following:-

    [] (left or right square bracket)

    = (equals sign)

    : (colon)

    ; (semi colon)

    . (dot)

    , (comma)

    ParameterDescription
    aPosOn return, contains the character position of the first invalid character in the property parameter name or value.
    aParamValueThe property parameter name or value to test.

    Returns: ETrue if valid, EFalse if invalid.

    LineCharSet ( )

    IMPORT_C Versit::TVersitCharSetLineCharSet()const [protected]

    LineCharSetId ( )

    IMPORT_C TUintLineCharSetId()const [protected]

    LineEncoding ( )

    IMPORT_C Versit::TVersitEncodingLineEncoding()const [protected]

    LineEncodingId ( )

    IMPORT_C TUintLineEncodingId()const [protected]

    LoadBinaryValuesFromFilesL ( )

    IMPORT_C TIntLoadBinaryValuesFromFilesL()

    Loads all files represented by URI property values and sets the binary data contained in the files to be the property values instead of the URIs.

    For every property in the parser, if its value is a URI containing file:// followed by a path and filename, then the file is opened and the binary data it contains is read into a CParserPropertyValueBinary object. This replaces the URI as the property value. The function also operates on any agents in the vCard that contain URI property values.

    The function creates its own file server session, which is needed to open the files. It leaves if there is a problem opening any of the files.

    Returns: The number of files that were read.

    LoadBinaryValuesFromFilesL ( RFs & )

    IMPORT_C TIntLoadBinaryValuesFromFilesL(RFs &aFileSession)

    Loads all files represented by URI property values and sets the binary data contained in the files to be the property values instead of the URIs.

    For every property in the parser, if its value is a URI containing file:// followed by a path and filename, then the file is opened and the binary data it contains is read into a CParserPropertyValueBinary object. This replaces the URI as the property value. The function also operates on any agents in the vCard that contain URI property values.

    The function uses the file server session supplied, which is needed to open the files. It leaves if there is a problem opening any of the files.

    ParameterDescription
    aFileSessionThe file server session used to open the files.

    Returns: The number of files that were read.

    MakeDefaultPropertyValueL ( HBufC16 *& )

    CParserPropertyValueHBufC *MakeDefaultPropertyValueL(HBufC16 *&aValue)[protected]

    Instantiates and gives ownership of a CParserPropertyValueHBufC object.

    MakeEntityL ( TInt, HBufC * )

    IMPORT_C CVersitParser *MakeEntityL(TIntaEntityUid,
    HBufC *aEntityName
    )[protected, virtual]

    MakePropertyL ( TPtr8 &, TInt )

    IMPORT_C voidMakePropertyL(TPtr8 &aPropName,
    TIntaValueStart
    )[protected]

    MakePropertyValueCDesCArrayL ( TPtr16 )

    IMPORT_C CDesCArray *MakePropertyValueCDesCArrayL(TPtr16aStringValue)[protected]

    Parses a compound property value string.

    The sub-values found are appended to an array, after removal of escape characters. The array is returned, and ownership is transferred to the caller.

    ParameterDescription
    aStringValueCompound property value string.

    Returns: Array of property values found in the string.

    MakePropertyValueDaylightL ( TPtr16 )

    IMPORT_C CVersitDaylight *MakePropertyValueDaylightL(TPtr16aDaylightValue)[protected]

    MakePropertyValueL ( const TUid &, HBufC16 *& )

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

    MakePropertyValueMultiDateTimeL ( TPtr16 )

    IMPORT_C CArrayPtr< TVersitDateTime > *MakePropertyValueMultiDateTimeL(TPtr16aDateTimeGroup)[protected]

    MapVersitCharsetToCharConvCharset ( Versit::TVersitCharSet )

    TUint MapVersitCharsetToCharConvCharset(Versit::TVersitCharSetaVersitSet)[static]

    MapVersitEncodingToConArcUid ( Versit::TVersitEncoding )

    TUint MapVersitEncodingToConArcUid(Versit::TVersitEncodingaVersitEncoding)[static]

    Observer ( )

    MVersitObserver *Observer()[inline]

    Gets a pointer to the Versit observer.

    Returns: A pointer to the observer.

    ParseBeginL ( )

    IMPORT_C voidParseBeginL()[protected]

    ParseEndL ( )

    IMPORT_C voidParseEndL()[protected]

    ParseEndL ( HBufC16 & )

    voidParseEndL(HBufC16 &aEntityName)[protected]

    ParseEntityL ( )

    IMPORT_C TBoolParseEntityL()[protected]

    ParseParamL ( CArrayPtr< CParserParam > *, TPtr8 )

    IMPORT_C voidParseParamL(CArrayPtr< CParserParam > *aArray,
    TPtr8aParam
    )[protected]

    ParsePropertiesL ( )

    IMPORT_C voidParsePropertiesL()[protected]

    ParsePropertyL ( )

    IMPORT_C voidParsePropertyL()[protected, virtual]

    PlugIn ( )

    MVersitPlugIn *PlugIn()[inline]

    Gets a pointer to the Versit plug-in.

    Returns: A pointer to the plug-in.

    PropertyL ( const TDesC8 &, const TUid &, TBool )

    IMPORT_C CArrayPtr< CParserProperty > *PropertyL(const TDesC8 &aPropertyName,
    const TUid &aPropertyUid,
    TBoolaTakeOwnership = ETrue
    )const

    Gets all properties in the current entity's array of properties whose name and value match the name and value specified.

    ParameterDescription
    aPropertyNameThe property name of interest. Property names are defined in vtoken.h.
    aPropertyUidThe ID of the property value of interest (which has the format "K<Versit/Card/Cal>Property<Type>Uid"). The values are defined in file vuid.h.
    aTakeOwnershipIf ETrue, the calling code takes ownership of each matching property; the property is then deleted from the current entity's array. If EFalse, ownership remains with the entity.

    Returns: An array of pointers to all properties with the name and value specified, or NULL if there are none.

    ReadLineAndDecodeParamsLC ( TInt &, TInt & )

    IMPORT_C CArrayPtr< CParserParam > *ReadLineAndDecodeParamsLC(TInt &aValueStart,
    TInt &aNameLen
    )[protected]

    ReadMultiLineValueL ( TPtr8 &, TInt, TBool )

    IMPORT_C voidReadMultiLineValueL(TPtr8 &aValue,
    TIntaValueStart,
    TBoolaBinaryData
    )[protected]

    RecognizeEntityName ( )

    IMPORT_C TIntRecognizeEntityName()const [virtual]

    Tests the current entity to see if it is a vEvent or vTodo.

    This function is virtual. Actual testing only occurs in derived classes which implement this function.

    Returns: Zero. Derived classes' implementations would return a value that indicates the current entity's type.

    RecognizeToken ( const TDesC8 & )

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

    Returns a UID for the specified token.

    This function only recognizes generic Versit tokens. For example, if aToken contains the property name KVersitTokenBEGIN, the function returns KVersitTokenBeginUid. More specific recognition should occur in derived classes which implement this function, using this as the base recogniser.

    ParameterDescription
    aTokenThe token to be recognized.

    Returns: A defined UID value if the token has been recognized; KVersitTokenUnknownUid otherwise.

    ResetAndDestroyArrayOfDateTimes ( TAny * )

    IMPORT_C voidResetAndDestroyArrayOfDateTimes(TAny *aObject)[static]

    Destroys an array of Versit dates and times.

    ParameterDescription
    aObjectPointer to the array of Versit dates and times to be destroyed.

    ResetAndDestroyArrayOfEntities ( TAny * )

    IMPORT_C voidResetAndDestroyArrayOfEntities(TAny *aObject)[static]

    Destroys an array of entities.

    ParameterDescription
    aObjectPointer to the array of entities to be destroyed.

    ResetAndDestroyArrayOfParams ( TAny * )

    IMPORT_C voidResetAndDestroyArrayOfParams(TAny *aObject)[static]

    Destroys an array of parameters.

    ParameterDescription
    aObjectPointer to the array of parameters to be destroyed.

    ResetAndDestroyArrayOfProperties ( TAny * )

    IMPORT_C voidResetAndDestroyArrayOfProperties(TAny *aObject)[static]

    Destroys an array of properties.

    ParameterDescription
    aObjectPointer to the array of properties to be destroyed.

    RestoreLineCodingDetailsToDefault ( )

    IMPORT_C voidRestoreLineCodingDetailsToDefault()[protected]

    SaveBinaryValuesToFilesL ( TInt, const TDesC & )

    IMPORT_C TIntSaveBinaryValuesToFilesL(TIntaSizeThreshold,
    const TDesC &aPath
    )

    Saves all binary property values larger than a specified threshold to files, and sets each property value to be a URI representing the file, rather than the binary data iself.

    The files are created in the folder identified by aPath, and are assigned unique filenames that consist of the property name and some random numbers.

    Each new URI property value is prefixed with file:// and contains the path and filename of the file created.

    If a vCard contains any agent property values and if they contain binary data whose size exceeds the threshold, these property values are replaced with URI property values.

    The function sets up its own file server session, which is needed to create the files. It leaves if there is a problem creating any of the files.

    ParameterDescription
    aSizeThresholdThe threshold number of bytes for the binary data, above which the binary data is stored in a file.
    aPathThe path identifying the location in which the files are created. This must not be greater than 240 characters long or the function leaves with KErrArgument. If it doesn't end in a slash, then one is appended.

    Returns: The number of files created.

    SaveBinaryValuesToFilesL ( TInt, const TDesC &, RFs & )

    IMPORT_C TIntSaveBinaryValuesToFilesL(TIntaSizeThreshold,
    const TDesC &aPath,
    RFs &aFileSession
    )

    Saves all binary property values larger than a specified threshold to files, and sets each property value to be a URI representing the file rather than the binary data iself.

    The files are created in the folder identified by aPath, and are assigned unique filenames that consist of the property name and some random numbers.

    Each new URI property value is prefixed with file:// and contains the path and filename of the file created.

    If a vCard contains any agent property values and if they contain binary data whose size exceeds the threshold, these property values are replaced with URI property values.

    The function uses the file server session supplied, which is needed to create the files. It leaves if there is a problem creating any of the files.

    ParameterDescription
    aSizeThresholdThe threshold number of bytes for the binary data, above which the binary data is stored in a file.
    aPathThe path identifying the location in which the files are created. This must not be greater than 240 characters long or the function leaves with KErrArgument. If it doesn't end in a slash, then one is appended.
    aFileSessionThe file server session used to create the files.

    Returns: The number of files created.

    SetAutoDetect ( TBool, const CArrayFix< CCnvCharacterSetConverter::SCharacterSet > * )

    IMPORT_C voidSetAutoDetect(TBoolaOn,
    const CArrayFix< CCnvCharacterSetConverter::SCharacterSet > *aAutoDetectCharSets = NULL
    )

    Turns auto detection of character sets on or off.

    If a property does not specify a character set, then it is possible to guess its character set. This function turns this behaviour on or off. When the behaviour is on, it also lets the caller specify a restricted set of character sets to be considered.

    Auto-detection of character sets is used (if auto detection is on) when converting a property value to Unicode while internalising a stream.

    ParameterDescription
    aOnIf ETrue, auto detection is turned on; if EFalse (the default value), auto detection is turned off
    aAutoDetectCharSetsIf specified then auto detection will only consider the character sets listed. If NULL, all available character sets are considered.

    SetCharacterConverter ( Versit::TEncodingAndCharset & )

    IMPORT_C voidSetCharacterConverter(Versit::TEncodingAndCharset &encodingAndCharset)

    Sets a character converter suitable for converting strings between Unicode and the specified character set.

    The function finds a suitable converter for the character set specified in aEncodingAndCharset.iCharSetId, if one is available, and assigns it to aEncodingAndCharset.iConverter.

    If there is no converter available for the specified character set then iConverter is set to NULL.

    This function is only of use if executing a major change to the externalisation behaviour, particularly if overriding CParserProperty::ExternalizeL() - the function from which this function is called.

    ParameterDescription
    encodingAndCharsetA utility class from which the character set information is extracted (from its member iCharSetId) and to which the suitable character converter is set (to its member iConverter).

    SetDefaultCharSet ( const Versit::TVersitCharSet )

    IMPORT_C voidSetDefaultCharSet(const Versit::TVersitCharSetaCharSet)

    Sets the default character set or transformation format.

    This may be used to represent property values in Versit objects.

    ParameterDescription
    aCharSetThe default character set.

    SetDefaultCharSetId ( TUint )

    IMPORT_C voidSetDefaultCharSetId(TUintaCharSetId)

    Sets the default character set or transformation format.

    This may be used to represent property values in Versit objects.

    ParameterDescription
    aCharSetIdThe UID for the character set. These are defined in charconv.h.

    SetDefaultEncoding ( const Versit::TVersitEncoding )

    IMPORT_C voidSetDefaultEncoding(const Versit::TVersitEncodingaEncoding)

    Sets the parser's default encoding to aEncoding.

    panic
    Versit-Parser 7 aEncoding is Versit::EEightBitEncoding.
    ParameterDescription
    aEncodingAn encoding. Cannot be 8-bit.

    SetEntityNameL ( const TDesC & )

    IMPORT_C voidSetEntityNameL(const TDesC &aEntityName)

    Sets the name for the current entity to one of: VCARD, VCALENDAR, VEVENT or VTODO.

    leave
    KErrNoMemory Memory is allocated for the new entity name on the heap, so it can leave if there is insufficient memory available.
    ParameterDescription
    aEntityNameThe new name for the current parser entity. Any existing name is first deleted.

    SetFlags ( TUint )

    voidSetFlags(TUintaFlags)[inline]

    SetLineCharacterSet ( Versit::TVersitCharSet )

    IMPORT_C voidSetLineCharacterSet(Versit::TVersitCharSetaLineCharSet)[protected]

    SetLineCharacterSetId ( TUint )

    IMPORT_C voidSetLineCharacterSetId(TUintaLineCharSetId)[protected]

    SetLineCoding ( Versit::TVersitCharSet, Versit::TVersitEncoding )

    IMPORT_C voidSetLineCoding(Versit::TVersitCharSetaLineCharSet,
    Versit::TVersitEncodingaLineEncoding
    )[protected]

    SetLineEncoding ( Versit::TVersitEncoding )

    IMPORT_C voidSetLineEncoding(Versit::TVersitEncodingaLineEncoding)[protected]

    SetLineEncoding ( TUint )

    IMPORT_C voidSetLineEncoding(TUintaVersitEncodingUid)[protected]

    SetObserver ( MVersitObserver * )

    voidSetObserver(MVersitObserver *aObserver)[inline]

    Sets the Versit observer.

    ParameterDescription
    aObserverA pointer to the observer.

    SetPlugIn ( MVersitPlugIn * )

    voidSetPlugIn(MVersitPlugIn *aPlugIn)[inline]

    Sets the Versit plug-in.

    If there is one, the Versit plug-in needs to be set before any properties are added to the parser. This is done for you when internalising (using InternalizeL()) or adding properties (using AddPropertyL()).

    ParameterDescription
    aPlugInA pointer to the plug in.

    SetSupportsVersion ( )

    voidSetSupportsVersion()[protected, inline]

    SupportsVersion ( )

    TBool SupportsVersion()const [protected, inline]

    UnicodeUtils ( )

    CVersitUnicodeUtils &UnicodeUtils()[protected, inline]

    Val ( const TDesC &, TInt & )

    IMPORT_C TIntVal(const TDesC &aString,
    TInt &aNumber
    )[static]

    Converts a string into an integer, for example, it converts "438" to 438.

    ParameterDescription
    aStringThe string to be converted. Every character contained in the string needs to be number presentable, i.e. between '0' and '9'.
    aNumberOn return, the integer corresponding to aString.

    Returns: KErrNone if the number has been converted from the string; KVersitErrNumberExpected otherwise.