|
|
This class impliments a basic XML stream parser that can be used to examine an XML resource thru virtual I/O methods. This class must be derived into one that can impliment the physical I/O required to parse actual data. A mixer class using XMLStream and URLStream would seem a likely combination for this purpose.
bool Open (const char *resource)
| Open |
[virtual]
May perform an open operation on behalf of a parsed resource. In some cases, the parser may be merged with a class that already has performed some kind of open, and this method can then be ignored.
Parameters:
resource | passed to Parse methods. |
Returns: true if open is successful.
void Close (void)
| Close |
[virtual]
May perform a close operation of an i/o source when the parser has completed operation.
slog_level_t getLogging (void)
| getLogging |
[virtual]
Get error logging level.
Returns: error logging level.
void comment (const unsigned char *text)
| comment |
[virtual]
Virtual to receive embedded comments in an XML document being parsed.
Parameters:
text | comment extracted. |
int Read (unsigned char *buffer, int len)
| Read |
[pure virtual]
Read method to aquire data for the parser.
Parameters:
buffer | to read data into. |
number | of bytes to read. |
Returns: number of bytes actually read.
void characters (const unsigned char *text, unsigned len)
| characters |
[pure virtual]
Virtual to receive character text extracted from the document in the current element.
Parameters:
text | received. |
length | of text received. |
void startDocument (void)
| startDocument |
[virtual]
Identify start of document event.
void endDocument (void)
| endDocument |
[virtual]
Identify end of document event.
void startElement (const unsigned char *name, const unsigned char **attr)
| startElement |
[pure virtual]
Identify start of an element in the document.
Parameters:
name | of element found. |
list | of attributes extracted. |
void endElement (const unsigned char *name)
| endElement |
[pure virtual]
Identify end of an element in the document.
Parameters:
name | of element found. |
bool Parse (const char *resource = NULL)
| Parse |
Parse a resource as a stream thru the virtual read method.
Parameters:
optional | name of resource. |
Returns: true if well formed document has been fully parsed.