hpp-util  4.9.0
Debugging tools for the HPP project.
hpp::util::parser::Parser Class Reference

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 >)
 
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

◆ FactoryType

Constructor & Destructor Documentation

◆ Parser()

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

Constructor

Parameters
defaultFactoryThe factory used when a tag is not known.

◆ ~Parser()

hpp::util::parser::Parser::~Parser ( )
virtual

Member Function Documentation

◆ addObjectFactory()

void hpp::util::parser::Parser::addObjectFactory ( const std::string &  tagname,
FactoryType  factory 
)

◆ parse()

void hpp::util::parser::Parser::parse ( const char *  xmlString)
virtual

◆ parseFile()

void hpp::util::parser::Parser::parseFile ( const std::string &  filename)
virtual

◆ root()

ObjectFactory * hpp::util::parser::Parser::root ( ) const

Friends And Related Function Documentation

◆ operator<<

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

The documentation for this class was generated from the following files: