RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DOMParser Class Referenceabstract

interface for parsing documents in a DOM fasion. More...

#include <DOMParser.hpp>

Inherited by BoostXMLParser.

Classes

class  Factory
 a factory for DOMParsers. This factory defines an extension point for DOMParsers. Typically this is for parsing xml files, however, anything that parses from some stream or file into a DOM structure can be a DOMParser. More...
 

Public Types

typedef rw::core::Ptr< DOMParserPtr
 smart pointer type
 

Public Member Functions

virtual ~DOMParser ()
 destructor
 
virtual void load (const std::string &filename)=0
 parse from file More...
 
virtual void load (std::istream &input)=0
 parse from stream More...
 
virtual void save (const std::string &filename)=0
 save DOM structure to file More...
 
virtual void save (std::ostream &input)=0
 save DOM structure to stream More...
 
virtual void setSchema (const std::string &filename)
 specify the schema file More...
 
virtual DOMElem::Ptr getRootElement ()=0
 get the top/root element in the DOM structure More...
 
virtual void setDebug (bool debug)=0
 Enable/disable debugging to the debug Log. More...
 

Static Public Member Functions

static rw::core::Ptr< DOMParsermake ()
 make an instance of the default DOM parser More...
 

Protected Member Functions

 DOMParser ()
 constructor
 

Protected Attributes

std::string _schemaFile
 Filename of schema.
 

Detailed Description

interface for parsing documents in a DOM fasion.

The factory method in the DOM parser enables extensions to be added by the user through plugins.

Member Function Documentation

◆ getRootElement()

virtual DOMElem::Ptr getRootElement ( )
pure virtual

get the top/root element in the DOM structure

Returns
root element of dom structure

Implemented in BoostXMLParser.

◆ load() [1/2]

virtual void load ( const std::string &  filename)
pure virtual

parse from file

Parameters
filename[in] name of file

Implemented in BoostXMLParser.

◆ load() [2/2]

virtual void load ( std::istream &  input)
pure virtual

parse from stream

Parameters
input[in] input stream

Implemented in BoostXMLParser.

◆ make()

static rw::core::Ptr<DOMParser> make ( )
static

make an instance of the default DOM parser

Returns
a DOM parser for xml files

◆ save() [1/2]

virtual void save ( const std::string &  filename)
pure virtual

save DOM structure to file

Parameters
filename[in] filename

Implemented in BoostXMLParser.

◆ save() [2/2]

virtual void save ( std::ostream &  input)
pure virtual

save DOM structure to stream

Parameters
input

Implemented in BoostXMLParser.

◆ setDebug()

virtual void setDebug ( bool  debug)
pure virtual

Enable/disable debugging to the debug Log.

Parameters
debug[in] true to enable debug output.

Implemented in BoostXMLParser.

◆ setSchema()

virtual void setSchema ( const std::string &  filename)
inlinevirtual

specify the schema file

Note
not all DOMParser implementations support schema validation
Parameters
filename

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