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. More... | |
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. |
|
virtual |
void hpp::util::parser::Parser::addObjectFactory | ( | const std::string & | tagname, |
FactoryType | factory | ||
) |
References hpp::util::parser::ObjectFactory::addTextChild(), hpp::util::parser::ObjectFactory::finishAttributes(), hpp::util::parser::ObjectFactory::finishTags(), hppDout, hpp::util::parser::ObjectFactory::init(), hpp::util::parser::ObjectFactory::setAttribute(), and hpp::util::parser::ObjectFactory::tagName().
|
virtual |
References parse().
Referenced by parse(), and parseFile().
|
virtual |
ObjectFactory * hpp::util::parser::Parser::root | ( | ) | const |
|
friend |