Xml::TParserImpl Class Reference

class Xml::TParserImpl

The TParserImpl class hides the implementation of the CParser. It is responsible for building and maintaining the list of plugins in the parsing chain, and has ownership of several key objects within the framework.

Constructor & Destructor Documentation

TParserImpl()

TParserImpl()

Default constructor

Post-condition
This object is properly constructed.

TParserImpl(const TParserImpl &)

TParserImpl(const TParserImpl &aOriginal)[private]

Parameters

const TParserImpl & aOriginal

Member Functions Documentation

AddPreloadedDictionaryL(const TDesC8 &)

voidAddPreloadedDictionaryL(const TDesC8 &aPublicId)

Parameters

const TDesC8 & aPublicId

BuildChainL(MContentHandler &, const RContentProcessorUids &)

MContentHandler *BuildChainL(MContentHandler &aCallback,
const RContentProcessorUids &aPlugins
)[private]

This method builds the chain of plugins, so that information may flow down the chain.

The first in the chain is the parser, the last is the client.

Parameters

MContentHandler & aCallbackclient to pass data to.
const RContentProcessorUids & aPluginsthe list of plugins in the chain.

Close()

voidClose()

This method cleans up the object before destruction. It releases all resources in accordance to the R Class pattern.

The framework will Close the StringDictionaryCollection and if owned will delete it.

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

ConstructParserL(const CMatchData &, MContentHandler &)

MParser *ConstructParserL(const CMatchData &aMatchData,
MContentHandler &aCallback
)[private]

This method constructs a MParser derived object.

leave
KErrXmlParserPluginNotFound If ECom fails to find the object a leave occurs.
leave
KErrArgument If CMatchData is lacking mandatory mime type field.

Parameters

const CMatchData & aMatchDataDetailed criteria for parser resolution.
MContentHandler & aCallbackclient to pass data to.

ConstructPluginInReverseL(const TUid &, MContentHandler &)

MContentProcessor *ConstructPluginInReverseL(const TUid &aImplementationUid,
MContentHandler &aCallback
)[private]

This method constructs a CContentProcessor and places it in reverse order in the chain.

leave
KErrXmlPluginNotFound If ECom fails to find the object a leave occurs.

Parameters

const TUid & aImplementationUidThe implementation uid of the plugin.
MContentHandler & aCallbackclient to pass data to.

DestroyChain()

voidDestroyChain()[private]

Destroys the client and the chain of plugins not including the parser.

Post-condition
The chain and client are destroyed and parsing cannot take place.

DestroyContentProcessorPtrMapping(TAny *)

voidDestroyContentProcessorPtrMapping(TAny *aPtr)[private, static]

Tidy memory associated with this object.

Parameters

TAny * aPtrThe ContentProcessor pointer.

DisableFeature(TInt)

TInt DisableFeature(TIntaParserFeature)

Parameters

TInt aParserFeature

EnableFeature(TInt)

TInt EnableFeature(TIntaParserFeature)

Parameters

TInt aParserFeature

IsFeatureEnabled(TInt)

TBool IsFeatureEnabled(TIntaParserFeature)const

Parameters

TInt aParserFeature

OpenL(const CMatchData &, MContentHandler &)

voidOpenL(const CMatchData &aMatchData,
MContentHandler &aCallback
)

This method opens and sets all the objects contents. The StringDictionaryCollection is created and Opened.

Pre-condition
The object has just been constructed and no other values have been set.
Post-condition
The objects members have been set to the values given.

Parameters

const CMatchData & aMatchDataDetailed criteria for parser resolution.
MContentHandler & aCallbackclient to pass data to.

ParseChunkL(const TDesC8 &)

voidParseChunkL(const TDesC8 &aChunk)

This method starts the parser parsing a descriptor. The descriptor does not contain the last part of the document.

Pre-condition
OpenL has been called

Parameters

const TDesC8 & aChunkthe chunk to parse - not the last chunk

ParseFileL(RFs &, const TDesC &)

voidParseFileL(RFs &aFs,
const TDesC &aFilename
)

Parameters

RFs & aFs
const TDesC & aFilename

ParseLastChunkL(const TDesC8 &)

voidParseLastChunkL(const TDesC8 &aFinalChunk)

This method starts the parser parsing a descriptor. The descriptor contains the last part of the document.

Pre-condition
OpenL has been called

Parameters

const TDesC8 & aFinalChunkthe final chunk to parse

ResetMimeTypeL()

voidResetMimeTypeL()

SetContentHandler(MContentHandler &)

voidSetContentHandler(MContentHandler &aCallback)

Allows the user to set/change the client for this parse session.

Pre-condition
OpenL has been called

Parameters

MContentHandler & aCallbackthe client at the end of the callback chain that is to receive the parsed document information.

SetMimeTypeL(const CMatchData &)

voidSetMimeTypeL(const CMatchData &aCriteria)

Allows the user to set/change the parser mime type used for this parse session.

Pre-condition
OpenL has been called

Parameters

const CMatchData & aCriteria

SetProcessorChainL(const RContentProcessorUids &)

voidSetProcessorChainL(const RContentProcessorUids &aPlugins)

Allows the user to change the client and set the plugin chain for this parse session.

Pre-condition
OpenL has been called

Parameters

const RContentProcessorUids & aPluginsa list of plugin implementation uids that make up the callback chain.

StringDictionaryCollection()

RStringDictionaryCollection &StringDictionaryCollection()

StringPool()

RStringPool &StringPool()

operator=(const TParserImpl &)

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

Parameters

const TParserImpl & aRhs

Member Data Documentation

CCharSetConverter * iCharSetConverter

CCharSetConverter *iCharSetConverter[private]

MContentHandler * iClient

MContentHandler *iClient[private]

CMatchData iCurrentParserMatchData

CMatchDataiCurrentParserMatchData[private]

CMatchData iDefParserMatchData

CMatchDataiDefParserMatchData[private]

RPointerArray< TDtorContentProcessorPtrMapping > iDtorKeyAndPluginList

RPointerArray< TDtorContentProcessorPtrMapping >iDtorKeyAndPluginList[private]

The collection of MContentProcessor pointers and Dtor keys that make up the chain of command. The chain order is determined by the the index, 0 being the first plugin in the chain.

RElementStack iElementStack

RElementStack iElementStack[private]

The common element stack for this collection of plugins.

MParser * iParser

MParser *iParser[private]

TUid iParserDtorKey

TUid iParserDtorKey[private]

RStringDictionaryCollection * iStringDictionaryCollection

RStringDictionaryCollection *iStringDictionaryCollection[private]