XML parser to read and write standard XML files.
More...
◆ DOM()
Copy constructor.
- Parameters
-
[in] | dom | The object to copy from |
◆ findNode()
bool 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 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 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 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()
Check whether this DOM is empty.
- Returns
true
if empty, false
otherwise
◆ load()
bool 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& operator= |
( |
const DOM & |
dom | ) |
|
Copy assignment.
- Parameters
-
[in] | dom | The element to copy from |
- Returns
- Reference to *this
◆ reset()
Resets the instance to the empty state.
- Postcondition
this->IsNull()
◆ save()
bool 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 toString |
( |
| ) |
const |
Creates an xml string representation of the dom.
- Returns
- XML string representation of the dom