PandA-2024.02
Public Member Functions | Protected Attributes
XMLDomParser Class Reference

XML DOM parser. More...

#include <xml_dom_parser.hpp>

Public Member Functions

 XMLDomParser (const std::string &name, const std::string &string_to_be_parsed)
 Constructor from string. More...
 
 XMLDomParser (const std::string &filename)
 Constructor from file. More...
 
void Exec ()
 Parse an XML document from a file. More...
 
 operator bool () const
 Test whether a document has been parsed. More...
 
xml_documentRef get_document ()
 Obtain the parsed document. More...
 
const xml_documentRef get_document () const
 Obtain the parsed document. More...
 

Protected Attributes

const std::string name
 The name of the parsed file or of the string. More...
 
const std::string to_be_parsed
 The string to be parsed or the name for the file to be parsed. More...
 
xml_documentRef doc
 The data structure extracted from the file. More...
 

Detailed Description

XML DOM parser.

Definition at line 61 of file xml_dom_parser.hpp.

Constructor & Destructor Documentation

◆ XMLDomParser() [1/2]

XMLDomParser::XMLDomParser ( const std::string &  _name,
const std::string &  string_to_be_parsed 
)

Constructor from string.

Header include.

Parameters
nameis the name of the string
string_to_be_parsedis the string to be parsed

Utility include

Definition at line 50 of file xml_dom_parser.cpp.

◆ XMLDomParser() [2/2]

XMLDomParser::XMLDomParser ( const std::string &  filename)
explicit

Constructor from file.

Parameters
filenameis the file to be parsed

Definition at line 56 of file xml_dom_parser.cpp.

Member Function Documentation

◆ Exec()

void XMLDomParser::Exec ( )

◆ get_document() [1/2]

xml_documentRef XMLDomParser::get_document ( )

◆ get_document() [2/2]

const xml_documentRef XMLDomParser::get_document ( ) const

Obtain the parsed document.

Const version.

Returns
the xml document pointer.

Definition at line 70 of file xml_dom_parser.cpp.

References doc.

◆ operator bool()

XMLDomParser::operator bool ( ) const

Test whether a document has been parsed.

Definition at line 60 of file xml_dom_parser.cpp.

References doc.

Field Documentation

◆ doc

xml_documentRef XMLDomParser::doc
protected

The data structure extracted from the file.

Definition at line 71 of file xml_dom_parser.hpp.

Referenced by get_document(), and operator bool().

◆ name

const std::string XMLDomParser::name
protected

The name of the parsed file or of the string.

Definition at line 65 of file xml_dom_parser.hpp.

◆ to_be_parsed

const std::string XMLDomParser::to_be_parsed
protected

The string to be parsed or the name for the file to be parsed.

Definition at line 68 of file xml_dom_parser.hpp.


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

Generated on Mon Feb 12 2024 13:04:11 for PandA-2024.02 by doxygen 1.8.13