XMLParser Class Reference

An XML parser. More...

#include <xmlparser.h>

Inheritance diagram for XMLParser:
TiXmlDocument Mutex TiXmlNode Lockable TiXmlBase

List of all members.

Public Member Functions

 XMLParser ()
virtual ~XMLParser ()
bool consume (const char *data, u_int32_t len)
XMLElementextract ()
unsigned int bufLen () const
void getBuffer (String &dest) const
void reset ()

Static Public Attributes

static u_int32_t s_maxDataBuffer
static TiXmlEncoding s_xmlEncoding

Detailed Description

An XML parser.

This class is responsable of parsing incoming data. Keeps the resulting XML elements and the input buffer


Constructor & Destructor Documentation

XMLParser (  )  [inline]

Constructor. Constructs an XML parser

virtual ~XMLParser (  )  [inline, virtual]

Destructor


Member Function Documentation

unsigned int bufLen (  )  const [inline]

Get the buffer length (incomplete data)

Returns:
The number of bytes belonging to an incomplete XML element
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

Parameters:
data Pointer to the data to consume
len Data length
Returns:
True on successfully parsed
XMLElement* extract (  ) 

Extract the first XML element from document. Remove non-element children of the document (e.g. declaration). This method is thread safe

Returns:
Pointer to an XMLElement or 0 if the document is empty
void getBuffer ( String dest  )  const [inline]

Get a copy of the parser's buffer

Parameters:
dest Destination string
void reset (  ) 

Clear the parser's input buffer and already parsed elements. Reset data


Member Data Documentation

u_int32_t s_maxDataBuffer [static]

The maximum allowed buffer length

TiXmlEncoding s_xmlEncoding [static]

The XML encoding


The documentation for this class was generated from the following file:
Generated on Thu Apr 8 18:19:43 2010 for Yate by  doxygen 1.6.3