Xml::CDictionaryCodePage Class Reference

class Xml::CDictionaryCodePage : public CBase

The CDictionaryCodePage , represents a single numeric code page for Elements, Attributes, and AttributeValues.

This object refers to the appropriate string pool tables, and creates mappings between strings in these tables and their token values.

Used mainly for wbxml document parsing, and allows for the quick comparison of strings.

This object is associated with a string dictionary via a user defined class.

RStringPool CStringDictionary

Inherits from

Public Member Functions
~CDictionaryCodePage ()
IMPORT_C TUint8 CodePage ()
IMPORT_C void ConstructIndexMappingL (const TInt *, TStringType )
IMPORT_C CDictionaryCodePage * NewL (const TStringTable *, const TStringTable *, const TStringTable *, TUint8 )
IMPORT_C TInt StringPoolIndexFromToken ( TInt , TStringType )
IMPORT_C const TStringTable * StringTable ( TStringType )
IMPORT_C TInt TokenFromStringPoolIndex ( TInt , TStringType )
Private Member Functions
CDictionaryCodePage (const TStringTable *, const TStringTable *, const TStringTable *, TUint8 )
CDictionaryCodePage (const CDictionaryCodePage &)
TInt CompareStringPoolTokenMappingTable (const TStringPoolTokenMapping &, const TStringPoolTokenMapping &)
CDictionaryCodePage & operator= (const CDictionaryCodePage &)
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()
Public Member Enumerations
enum TStringType { EStringTypeElement , EStringTypeAttribute , EStringTypeAttributeValue }
Private Attributes
RArray < TInt > iAttributeStringPoolIndexToToken
const TStringTable * iAttributeTable
RArray < TStringPoolTokenMapping > iAttributeTokenToStringPoolIndex
TUint8 iCodePage
RArray < TInt > iElementStringPoolIndexToToken
const TStringTable * iElementTable
RArray < TStringPoolTokenMapping > iElementTokenToStringPoolIndex
RArray < TInt > iValueStringPoolIndexToToken
const TStringTable * iValueTable
RArray < TStringPoolTokenMapping > iValueTokenToStringPoolIndex

Constructor & Destructor Documentation

CDictionaryCodePage(const TStringTable *, const TStringTable *, const TStringTable *, TUint8)

CDictionaryCodePage ( const TStringTable * aElementTable,
const TStringTable * aAttributeTable,
const TStringTable * aValueTable,
TUint8 aCodePage
) [private]

Constructor.

Post-condition
This object is properly constructed.

Parameters

const TStringTable * aElementTable the element string table associated with this code page.
const TStringTable * aAttributeTable the attribute string table associated with this code page.
const TStringTable * aValueTable the attributevalue string table associated with this code page.
TUint8 aCodePage the codepage number for this object.

CDictionaryCodePage(const CDictionaryCodePage &)

CDictionaryCodePage ( const CDictionaryCodePage & aOriginal ) [private]

Parameters

const CDictionaryCodePage & aOriginal

~CDictionaryCodePage()

IMPORT_C ~CDictionaryCodePage ( ) [virtual]

Destructor.

Post-condition
This object may be allowed to go out of scope.

Member Functions Documentation

CodePage()

IMPORT_C TUint8 CodePage ( ) const

This method returns the codepage number for this page.

CompareStringPoolTokenMappingTable(const TStringPoolTokenMapping &, const TStringPoolTokenMapping &)

TInt CompareStringPoolTokenMappingTable ( const TStringPoolTokenMapping & aFirst,
const TStringPoolTokenMapping & aSecond
) [private, static]

This method compares two codepages and determines the order of two objects of a given class type.

Parameters

const TStringPoolTokenMapping & aFirst the first object.
const TStringPoolTokenMapping & aSecond the second object.

ConstructIndexMappingL(const TInt *, TStringType)

IMPORT_C void ConstructIndexMappingL ( const TInt * aStringPoolToTokenMapping,
TStringType aType
)

This method constructs the internal correlation between indices and tokens.

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

const TInt * aStringPoolToTokenMapping array of token values, NULL terminated.
TStringType aType is the type of the token, e.g. element.

NewL(const TStringTable *, const TStringTable *, const TStringTable *, TUint8)

IMPORT_C CDictionaryCodePage * NewL ( const TStringTable * aElementTable,
const TStringTable * aAttributeTable,
const TStringTable * aValueTable,
TUint8 aCodePage
) [static]

Parameters

const TStringTable * aElementTable
const TStringTable * aAttributeTable
const TStringTable * aValueTable
TUint8 aCodePage

StringPoolIndexFromToken(TInt, TStringType)

IMPORT_C TInt StringPoolIndexFromToken ( TInt aToken,
TStringType aType
) const

This method obtains a String Pool index from a token value

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

TInt aToken is the token value.
TStringType aType is the type of the token, e.g. element.

StringTable(TStringType)

IMPORT_C const TStringTable * StringTable ( TStringType aType ) const

This method obtains the correct string table based on the type passed.

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

TStringType aType the type of string table required, e.g. element.

TokenFromStringPoolIndex(TInt, TStringType)

IMPORT_C TInt TokenFromStringPoolIndex ( TInt aIndex,
TStringType aType
) const

This method obtains a Token value from a String Pool index.

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

TInt aIndex is the String Pool index
TStringType aType is the type of the token, e.g. element.

operator=(const CDictionaryCodePage &)

CDictionaryCodePage & operator= ( const CDictionaryCodePage & aRhs ) [private]

Parameters

const CDictionaryCodePage & aRhs

Member Enumerations Documentation

Enum TStringType

A structure for describing the types of string pool table associated with this class.

Enumerators

EStringTypeElement
EStringTypeAttribute
EStringTypeAttributeValue

Member Data Documentation

RArray< TInt > iAttributeStringPoolIndexToToken

RArray < TInt > iAttributeStringPoolIndexToToken [private]

Array to obtain a Attribute Token from String Pool index.

const TStringTable * iAttributeTable

const TStringTable * iAttributeTable [private]

Pointer to the static Attribute string pool table. We do not own this.

RArray< TStringPoolTokenMapping > iAttributeTokenToStringPoolIndex

RArray < TStringPoolTokenMapping > iAttributeTokenToStringPoolIndex [private]

Array to obtain a Attribute String Pool Index from a token.

TUint8 iCodePage

TUint8 iCodePage [private]

The numeric codepage this object represents.

RArray< TInt > iElementStringPoolIndexToToken

RArray < TInt > iElementStringPoolIndexToToken [private]

Array to obtain a Element Token from String Pool index.

const TStringTable * iElementTable

const TStringTable * iElementTable [private]

Pointer to the static Element string pool table. We do not own this.

RArray< TStringPoolTokenMapping > iElementTokenToStringPoolIndex

RArray < TStringPoolTokenMapping > iElementTokenToStringPoolIndex [private]

Array to obtain a Element String Pool Index from a token.

RArray< TInt > iValueStringPoolIndexToToken

RArray < TInt > iValueStringPoolIndexToToken [private]

Array to obtain a Value Token from String Pool index.

const TStringTable * iValueTable

const TStringTable * iValueTable [private]

Pointer to the static AttributeValue string pool table. We do not own this.

RArray< TStringPoolTokenMapping > iValueTokenToStringPoolIndex

RArray < TStringPoolTokenMapping > iValueTokenToStringPoolIndex [private]

Array to obtain a Value String Pool Index from a token.