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

  • Xml::CDictionaryCodePage
Public Member Functions
~CDictionaryCodePage()
IMPORT_C TUint8CodePage()
IMPORT_C voidConstructIndexMappingL(const TInt *, TStringType)
IMPORT_C CDictionaryCodePage *NewL(const TStringTable *, const TStringTable *, const TStringTable *, TUint8)
IMPORT_C TIntStringPoolIndexFromToken(TInt, TStringType)
IMPORT_C const TStringTable *StringTable(TStringType)
IMPORT_C TIntTokenFromStringPoolIndex(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
enumTStringType { 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,
TUint8aCodePage
)[private]

Constructor.

Post-condition
This object is properly constructed.

Parameters

const TStringTable * aElementTablethe element string table associated with this code page.
const TStringTable * aAttributeTablethe attribute string table associated with this code page.
const TStringTable * aValueTablethe attributevalue string table associated with this code page.
TUint8 aCodePagethe 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 TUint8CodePage()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 & aFirstthe first object.
const TStringPoolTokenMapping & aSecondthe second object.

ConstructIndexMappingL(const TInt *, TStringType)

IMPORT_C voidConstructIndexMappingL(const TInt *aStringPoolToTokenMapping,
TStringTypeaType
)

This method constructs the internal correlation between indices and tokens.

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

const TInt * aStringPoolToTokenMappingarray of token values, NULL terminated.
TStringType aTypeis 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,
TUint8aCodePage
)[static]

Parameters

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

StringPoolIndexFromToken(TInt, TStringType)

IMPORT_C TIntStringPoolIndexFromToken(TIntaToken,
TStringTypeaType
)const

This method obtains a String Pool index from a token value

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

TInt aTokenis the token value.
TStringType aTypeis the type of the token, e.g. element.

StringTable(TStringType)

IMPORT_C const TStringTable *StringTable(TStringTypeaType)const

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

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

TStringType aTypethe type of string table required, e.g. element.

TokenFromStringPoolIndex(TInt, TStringType)

IMPORT_C TIntTokenFromStringPoolIndex(TIntaIndex,
TStringTypeaType
)const

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

panic
EXmlFrameworkPanicUnexpectedLogic If the type cannot be recognised.

Parameters

TInt aIndexis the String Pool index
TStringType aTypeis 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.