← Documentation
ADS-IDAC Engine 5.0.0
faulttree::xml Namespace Reference

Classes

struct  Attribute
 One attribute of an element. More...
 
struct  Element
 One XML element with its attributes and child elements. More...
 
class  XmlError
 Exception thrown by parse() and parseFile(). More...
 

Functions

Element parse (const std::string &text)
 
Element parseFile (const std::string &path)
 

Function Documentation

◆ parse()

Element faulttree::xml::parse ( const std::string &  text)

Parses a document held in memory. Throws XmlError on malformed input.

The document is an optional <?xml ...?> declaration, then exactly one root element. Whitespace and comments may appear before, between and after elements. Attribute values must be quoted with single or double quotes and must not contain <. The entities &, <, >, " and ' are decoded, as are decimal (&#65;) and hexadecimal (&#x41;) character references up to 0x7F.

Parameters
textComplete XML document.
Returns
The root element.
Exceptions
XmlErrorif there is no root element, a tag, attribute, comment or declaration is unterminated, a closing tag does not match, content follows the root element, an entity is unknown or a character reference is above 0x7F, or the text uses DOCTYPE, CDATA or a processing instruction.

Definition at line 259 of file xml_lite.cpp.

Referenced by RestApiSolver::createSession(), parseFile(), faulttree::parseFtaString(), RestApiSolver::populateR5Pars(), RestApiSolver::restore(), and RestApiSolver::runSequence().

Here is the caller graph for this function:

◆ parseFile()

Element faulttree::xml::parseFile ( const std::string &  path)

Reads and parses a file. Throws XmlError if the file cannot be read.

The file is opened in binary mode and read completely before parsing.

Parameters
pathPath of the file.
Returns
The root element.
Exceptions
XmlErrorif the file cannot be opened, or for any reason listed at parse().

Definition at line 261 of file xml_lite.cpp.

References parse().

Referenced by faulttree::parseFtaFile().

Here is the call graph for this function:
Here is the caller graph for this function: