Pin
Public Member Functions | Protected Member Functions
LEVEL_BASE::SimpleXMLParser Class Reference

List of all members.

Public Member Functions

 SimpleXMLParser (std::istream *input)
bool parse ()
std::string getErrorString ()

Protected Member Functions

virtual void visitNode ()=0
size_t getElementsStackCount ()
const std::string & getElementName (size_t n)
std::string getInnermostElementText ()

Detailed Description

class that provides XML parsing capabilities


Constructor & Destructor Documentation

LEVEL_BASE::SimpleXMLParser::SimpleXMLParser ( std::istream *  input) [inline]

Creates a new XML parser instance.

Parameters:
[in]input- Pointer to an instance of istream from while the XML can be read.

Member Function Documentation

const std::string& LEVEL_BASE::SimpleXMLParser::getElementName ( size_t  n) [inline, protected]

Gets the name of one of the nested nodes we're currently visiting (valid only inside visitNode()).

Parameters:
[in]n- The nesting level of the node that we want to get its name. while 0 being the outermode node.
Returns:
The name of the n-th node.
size_t LEVEL_BASE::SimpleXMLParser::getElementsStackCount ( ) [inline, protected]
Returns:
The number of nested nodes we're currently visiting (valid only inside visitNode()).
std::string LEVEL_BASE::SimpleXMLParser::getErrorString ( ) [inline]

Get a string denoting the last error reason. Valid only after calling parse().

Returns:
String with error message.
std::string LEVEL_BASE::SimpleXMLParser::getInnermostElementText ( ) [inline, protected]
Returns:
The text in the innermost node that is being parsed (valid only inside visitNode()).
bool LEVEL_BASE::SimpleXMLParser::parse ( )

Parse the XML by reading characters from the input stream.

Returns:
TRUE upon success, FALSE upon failure.
virtual void LEVEL_BASE::SimpleXMLParser::visitNode ( ) [protected, pure virtual]

This function should be overriden by subclasses of this class. It is called after parsing on each XML node (particularily when the parser encounters the node closes token).


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator