hpp::util::parser::Parser Class Reference

Parse an XML document. More...

#include <hpp/util/parser.hh>

List of all members.

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)
ObjectFactoryroot () const

Friends

std::ostream & operator<< (std::ostream &, const Parser &)

Detailed Description

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.


Member Typedef Documentation


Constructor & Destructor Documentation

hpp::util::parser::Parser::Parser ( FactoryType  defaultFactory = create <ObjectFactory>)

Constructor.

Parameters:
defaultFactoryThe factory used when a tag is not known.
hpp::util::parser::Parser::~Parser ( ) [virtual]

Member Function Documentation

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

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Parser p 
) [friend]