XML parser to read and write standard XML files.
More...
#include <dom.h>
XML parser to read and write standard XML files.
◆ DOM()
| a_util::xml::DOM::DOM |
( |
const DOM & | dom | ) |
|
Copy constructor
- Parameters
-
| [in] | dom | The object to copy from |
◆ findNode()
| bool a_util::xml::DOM::findNode |
( |
const std::string & | query, |
|
|
DOMElement & | element_ptr ) const |
Finds a node based on a query See DOMElement::findNode() for the syntax.
- Parameters
-
| [in] | query | The query string |
| [out] | element_ptr | This will point to the found element. |
- Returns
- Whether or not the node was found
◆ findNodes()
| bool a_util::xml::DOM::findNodes |
( |
const std::string & | query, |
|
|
DOMElementList & | elements ) const |
Finds nodes based on a query. See DOMElement::findNode() for the syntax.
- Parameters
-
| [in] | query | The query string |
| [out] | elements | This list will be filled with the found elements |
- Returns
- Whether or not any nodes where found
◆ fromString()
| bool a_util::xml::DOM::fromString |
( |
const std::string & | xml | ) |
|
Create the dom from an input string
- Parameters
-
| [in] | xml | String which must have a valid XML syntax |
- Returns
false string is invalid (check DOM::getLastError()), otherwise true
◆ getLastError()
| std::string a_util::xml::DOM::getLastError |
( |
| ) |
const |
Get the last error description occurred
- Returns
- The last occurred error
◆ getRoot()
Get root element of the dom
- Returns
- The root element of the dom
◆ isNull()
| bool a_util::xml::DOM::isNull |
( |
| ) |
const |
Check whether this DOM is empty
- Returns
true if empty, false otherwise
◆ load()
| bool a_util::xml::DOM::load |
( |
const std::string & | file_path | ) |
|
Loads an xml file
- Parameters
-
| [in] | file_path | Path to the filename |
- Returns
false if file could not be loaded (check DOM::getLastError()), otherwise true
◆ operator=()
| DOM & a_util::xml::DOM::operator= |
( |
const DOM & | dom | ) |
|
Copy assignment
- Parameters
-
| [in] | dom | The element to copy from |
- Returns
- Reference to *this
◆ reset()
| void a_util::xml::DOM::reset |
( |
| ) |
|
Resets the instance to the empty state
- Postcondition
this->IsNull()
◆ save()
| bool a_util::xml::DOM::save |
( |
const std::string & | file_path | ) |
const |
save document to an xml file
- Parameters
-
| [in] | file_path | Path to the file to save |
- Returns
false if file could not be safed (check DOM::getLastError()), otherwise true
◆ toString()
| std::string a_util::xml::DOM::toString |
( |
| ) |
const |
Creates an xml string representation of the dom
- Returns
- XML string representation of the dom
The documentation for this class was generated from the following file: