MMDXMLParserDataProvider Class Reference

#include <gmxmlparser.h>

class MMDXMLParserDataProvider
Public Member Enumerations
enumTDataProviderResults { KMoreData, KDataStreamError, KDataStreamEnd }
Public Member Functions
pure virtual voidDisconnect()
pure virtual voidGetData(TPtrC8 &, TRequestStatus &)

Detailed Description

Abstract data source interface for XML data source.

The user of CMDXMLParser must build one of these to encapsulate the data source that they wish to parse. CMDXMLParser implements a file-based data source to implement the functionality of the ParseFile function.

Member Enumeration Documentation

Enum TDataProviderResults

Status codes returned by GetData() implementations.

EnumeratorValueDescription
KMoreData
KDataStreamError
KDataStreamEnd

Member Function Documentation

Disconnect ( )

voidDisconnect()[pure virtual]

Called to indicate that use of the data source is complete.

GetData ( TPtrC8 &, TRequestStatus & )

voidGetData(TPtrC8 &aPtr,
TRequestStatus &aStatus
)[pure virtual]

The XML Parser calls this on a specific data provider to get more data when required.

Note that the TPtrC supplied may be used by the parser at any time between the return of this call and the next call that the parser makes out.

Your data provider must not move the data pointed to until the parser has indicated that it's done with that block by asking for another.

Ownership of the data pointed to remains with the data provider.

General comments on efficiency ------------------------------

The parser is designed such that it processes the whole data block provided in one go. It will automatically become asynchronous when another block is required - the data provider only needs to supply data.

Because of this design, it allows the data provider to indirectly control the amount of processing time that will be needed in a single block.

It is a good idea to balance the need for the fastest possible processing with the need for client application responsiveness by ensuring that the amount of data passed in a single block is not too large. However, it is worth bearing in mind that the parser will convert UTF8 data streams in blocks of 32 characters, and supplying blocks of smaller length than this will result in a slight loss of efficiency.

Parameters
aPtrOn return, the data provided
aStatusAsynchronous status to be completed by the function with a TDataProviderResults value