|
||
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.
Defined in MMDXMLParserDataProvider
:
Disconnect()
Called to indicate that use of the data source is complete.GetData(TPtrC8 &,TRequestStatus &)
The XML Parser calls this on a specific data provider to get more data when requ...KDataStreamEnd
Returned by the interface when there is no more data to come. KDataStreamError
Returned by the interface when an unrecoverable error prevents obtaining more da...KMoreData
Returned by the interface implementation when it is returning more data. TDataProviderResults
Status codes returned by MMDXMLParserDataProvider::GetData(TPtrC8 &,TRequest...virtual void GetData(TPtrC8 &aPtr, TRequestStatus &aStatus)=0;
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.
|
virtual void Disconnect()=0;
Called to indicate that use of the data source is complete.
TDataProviderResults
Status codes returned by MMDXMLParserDataProvider::GetData(TPtrC8 &,TRequestStatus &)
implementations.
|