hpp-util 7.0.0
Debugging tools for the HPP project.
Loading...
Searching...
No Matches
hpp::util::parser::Parser Class Reference

Parse an XML document. More...

#include <hpp/util/parser.hh>

Public Types

typedef std::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 &os, const Parser &p)

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(FactoryTypedefaultFactory = 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,
FactoryTypefactory )

◆ 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

◆ operator<<

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

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