An XML parser. More...
#include <xmlparser.h>
Public Member Functions | |
XMLParser () | |
virtual | ~XMLParser () |
bool | consume (const char *data, u_int32_t len) |
XMLElement * | extract () |
unsigned int | bufLen () const |
void | getBuffer (String &dest) const |
void | reset () |
Static Public Attributes | |
static u_int32_t | s_maxDataBuffer |
static TiXmlEncoding | s_xmlEncoding |
An XML parser.
This class is responsable of parsing incoming data. Keeps the resulting XML elements and the input buffer
XMLParser | ( | ) | [inline] |
Constructor. Constructs an XML parser
virtual ~XMLParser | ( | ) | [inline, virtual] |
Destructor
unsigned int bufLen | ( | ) | const [inline] |
Get the buffer length (incomplete data)
bool consume | ( | const char * | data, | |
u_int32_t | len | |||
) |
Add data to buffer. Parse the buffer. On success, the already parsed data is removed from buffer. This method is thread safe
data | Pointer to the data to consume | |
len | Data length |
XMLElement* extract | ( | ) |
Extract the first XML element from document. Remove non-element children of the document (e.g. declaration). This method is thread safe
void getBuffer | ( | String & | dest | ) | const [inline] |
Get a copy of the parser's buffer
dest | Destination string |
void reset | ( | ) |
Clear the parser's input buffer and already parsed elements. Reset data
u_int32_t s_maxDataBuffer [static] |
The maximum allowed buffer length
TiXmlEncoding s_xmlEncoding [static] |
The XML encoding