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 &)

void AddPreloadedDictionaryL ( 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 & aCallback client to pass data to.
const RContentProcessorUids & aPlugins the list of plugins in the chain.

Close()

void Close ( )

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 & aMatchData Detailed criteria for parser resolution.
MContentHandler & aCallback client 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 & aImplementationUid The implementation uid of the plugin.
MContentHandler & aCallback client to pass data to.

DestroyChain()

void DestroyChain ( ) [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 *)

void DestroyContentProcessorPtrMapping ( TAny * aPtr ) [private, static]

Tidy memory associated with this object.

Parameters

TAny * aPtr The ContentProcessor pointer.

DisableFeature(TInt)

TInt DisableFeature ( TInt aParserFeature )

Parameters

TInt aParserFeature

EnableFeature(TInt)

TInt EnableFeature ( TInt aParserFeature )

Parameters

TInt aParserFeature

IsFeatureEnabled(TInt)

TBool IsFeatureEnabled ( TInt aParserFeature ) const

Parameters

TInt aParserFeature

OpenL(const CMatchData &, MContentHandler &)

void OpenL ( 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 & aMatchData Detailed criteria for parser resolution.
MContentHandler & aCallback client to pass data to.

ParseChunkL(const TDesC8 &)

void ParseChunkL ( 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 & aChunk the chunk to parse - not the last chunk

ParseFileL(RFs &, const TDesC &)

void ParseFileL ( RFs & aFs,
const TDesC & aFilename
)

Parameters

RFs & aFs
const TDesC & aFilename

ParseLastChunkL(const TDesC8 &)

void ParseLastChunkL ( 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 & aFinalChunk the final chunk to parse

ResetMimeTypeL()

void ResetMimeTypeL ( )

SetContentHandler(MContentHandler &)

void SetContentHandler ( MContentHandler & aCallback )

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

Pre-condition
OpenL has been called

Parameters

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

SetMimeTypeL(const CMatchData &)

void SetMimeTypeL ( 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 &)

void SetProcessorChainL ( 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 & aPlugins a 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

CMatchData iCurrentParserMatchData [private]

CMatchData iDefParserMatchData

CMatchData iDefParserMatchData [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]