class MMDXMLParserDataProvider |
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.
Public Member Functions | |
---|---|
void | Disconnect() |
void | GetData(TPtrC8 &, TRequestStatus &) |
Public Member Enumerations | |
---|---|
enum | TDataProviderResults { KMoreData, KDataStreamError, KDataStreamEnd } |
void | Disconnect | ( | ) | [pure virtual] |
Called to indicate that use of the data source is complete.
void | GetData | ( | 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.
TPtrC8 & aPtr | On return, the data provided |
TRequestStatus & aStatus | Asynchronous status to be completed by the function with a TDataProviderResults value |
Status codes returned by GetData() implementations.
KMoreData | |
KDataStreamError | |
KDataStreamEnd |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.