Parse an XML document. More...
#include <hpp/util/parser.hh>
Public Types | |
typedef boost::function < ObjectFactory *(ObjectFactory *, const XMLElement *) | FactoryType ) |
Public Member Functions | |
Parser (FactoryType defaultFactory=create< ObjectFactory >) | |
Constructor. | |
virtual | ~Parser () |
void | addObjectFactory (const std::string &tagname, FactoryType factory) |
virtual void | parse (const char *xmlString) |
virtual void | parseFile (const std::string &filename) |
ObjectFactory * | root () const |
Friends | |
std::ostream & | operator<< (std::ostream &, const Parser &) |
Parse an XML document.
This class uses the tinyXML library and derived classes of ObjectFactory to build object from an XML document. To extend its capabilities, see ObjectFactory.
typedef boost::function<ObjectFactory* (ObjectFactory*, const XMLElement*) hpp::util::parser::Parser::FactoryType) |
hpp::util::parser::Parser::Parser | ( | FactoryType | defaultFactory = create <ObjectFactory> | ) |
Constructor.
defaultFactory | The factory used when a tag is not known. |
hpp::util::parser::Parser::~Parser | ( | ) | [virtual] |
void hpp::util::parser::Parser::addObjectFactory | ( | const std::string & | tagname, |
FactoryType | factory | ||
) |
void hpp::util::parser::Parser::parse | ( | const char * | xmlString | ) | [virtual] |
References parse().
Referenced by parse(), and parseFile().
void hpp::util::parser::Parser::parseFile | ( | const std::string & | filename | ) | [virtual] |
References parse().
ObjectFactory * hpp::util::parser::Parser::root | ( | ) | const |
std::ostream& operator<< | ( | std::ostream & | os, |
const Parser & | p | ||
) | [friend] |