UQTk: Uncertainty Quantification Toolkit 3.1.5
XMLExpatParser Class Reference

#include <XMLExpatParser.h>

Inheritance diagram for XMLExpatParser:
XMLParser Object

Public Member Functions

 XMLExpatParser ()
 Construct a new parser.
 
virtual ~XMLExpatParser () throw ()
 Destructor.
 
RefPtr< XMLElementparse (std::istream &)
 Parse the given input buffer and return a parse tree.
 
- Public Member Functions inherited from XMLParser
 XMLParser ()
 Default constructor. Intended for derived classes.
 
virtual ~XMLParser ()
 Destructor.
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new reference counted object with a zero reference count.
 
virtual ~Object ()
 Destroy this object.
 
long int reference_count () const
 Returns the number of references that are held to this object.
 

Static Public Member Functions

static void start_ (void *, const XML_Char *, const XML_Char **)
 
static void end_ (void *, const XML_Char *)
 
static void character_data_ (void *, const XML_Char *, int)
 

Private Member Functions

 XMLExpatParser (const XMLExpatParser &)
 
XMLExpatParseroperator= (const XMLExpatParser &)
 Blocked assignment operator. Not for public consumption.
 
void do_start (const XML_Char *, const XML_Char **)
 The method used to parse the start tag.
 
void do_end (const XML_Char *)
 The method used to parse the end tag.
 
void do_character_data (const XML_Char *, int)
 The method used to parse character (content) data.
 
void init ()
 Initialize the state of the parser.
 

Private Attributes

XML_Parser parser_
 The Expat parser.
 
std::vector< RefPtr< XMLElement > > path_
 The path that we have traversed so far in building the tree.
 
RefPtr< XMLElementleaf_
 The current leaf of the parse tree.
 

Friends

template<class T >
class RefPtr
 
template<class T >
class ConstRefPtr
 

Additional Inherited Members

- Protected Member Functions inherited from Object
long int reference_grab () const
 
long int reference_release () const
 

Detailed Description

An XML parser that uses the Expat library to handle the gruntwork. This class requires that the Expat be installed on your system.

Expat is available at the Expat site

This class may not be fully exception safe, since there is no good way of enforcing that the Expat parser is destroyed cleanly.

Constructor & Destructor Documentation

◆ XMLExpatParser() [1/2]

XMLExpatParser::XMLExpatParser ( )

Construct a new parser.

◆ XMLExpatParser() [2/2]

XMLExpatParser::XMLExpatParser ( const XMLExpatParser & )
private

Blocked copy constructor. It is not safe to copy this object since the Expat parser may save state which cannot be duplicated.

◆ ~XMLExpatParser()

XMLExpatParser::~XMLExpatParser ( )
throw ( )
virtual

Destructor.

Member Function Documentation

◆ character_data_()

void XMLExpatParser::character_data_ ( void * object,
const XML_Char * data,
int size )
static

Static wrapper method used as a callback to get character data. This method is for internal use only. Calling this method directly will most likely result in a segmentation fault.

◆ do_character_data()

void XMLExpatParser::do_character_data ( const XML_Char * data,
int size )
private

The method used to parse character (content) data.

◆ do_end()

void XMLExpatParser::do_end ( const XML_Char * )
private

The method used to parse the end tag.

◆ do_start()

void XMLExpatParser::do_start ( const XML_Char * lbl,
const XML_Char ** attr )
private

The method used to parse the start tag.

◆ end_()

void XMLExpatParser::end_ ( void * object,
const XML_Char * label )
static

Static wrapper method used as a callback to get the 'end' tag. This method is for internal use only. Calling this method directly will most likely result in a segmentation fault.

◆ init()

void XMLExpatParser::init ( )
private

Initialize the state of the parser.

◆ operator=()

XMLExpatParser & XMLExpatParser::operator= ( const XMLExpatParser & )
private

Blocked assignment operator. Not for public consumption.

◆ parse()

RefPtr< XMLElement > XMLExpatParser::parse ( std::istream & buf)
virtual

Parse the given input buffer and return a parse tree.

Implements XMLParser.

◆ start_()

void XMLExpatParser::start_ ( void * object,
const XML_Char * label,
const XML_Char ** attributes )
static

Static wrapper method used as a callback to get the 'start' tag. This method is for internal use only. Calling this method directly will most likely result in a segmentation fault.

Friends And Related Symbol Documentation

◆ ConstRefPtr

template<class T >
friend class ConstRefPtr
friend

◆ RefPtr

template<class T >
friend class RefPtr
friend

Member Data Documentation

◆ leaf_

RefPtr<XMLElement> XMLExpatParser::leaf_
private

The current leaf of the parse tree.

◆ parser_

XML_Parser XMLExpatParser::parser_
private

The Expat parser.

◆ path_

std::vector< RefPtr<XMLElement> > XMLExpatParser::path_
private

The path that we have traversed so far in building the tree.


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