Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GMXMLParser.h>
This item is not part of the S60 5th Edition SDK

Class MMDXMLParserDataProvider

class MMDXMLParserDataProvider;

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.

Members

Defined in MMDXMLParserDataProvider:


Member functions


GetData(TPtrC8 &,TRequestStatus &)

virtual void GetData(TPtrC8 &aPtr, TRequestStatus &aStatus)=0;

Description

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

TPtrC8 &aPtr

On return, the data provided

TRequestStatus &aStatus

Asynchronous status to be completed by the function with a TDataProviderResults value


Disconnect()

virtual void Disconnect()=0;

Description

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

[Top]


Member enumerations


Enum TDataProviderResults

TDataProviderResults

Description

Status codes returned by MMDXMLParserDataProvider::GetData(TPtrC8 &,TRequestStatus &) implementations.

KMoreData

Returned by the interface implementation when it is returning more data.

KDataStreamError

Returned by the interface when an unrecoverable error prevents obtaining more data. A recoverable error should be represented by KDataNotReady.

KDataStreamEnd

Returned by the interface when there is no more data to come.