|
FERS 1.0.0
The Flexible Extensible Radar Simulator
|
Class for managing XML documents. More...
#include "libxml_wrapper.h"
Public Member Functions | |
| XmlDocument () | |
| Constructor for XmlDocument. | |
| ~XmlDocument ()=default | |
| XmlDocument (const XmlDocument &)=delete | |
| XmlDocument (XmlDocument &&) noexcept=default | |
| XmlDocument & | operator= (const XmlDocument &)=delete |
| XmlDocument & | operator= (XmlDocument &&) noexcept=default |
| bool | loadFile (std::string_view filename) |
| Load an XML file into the document. | |
| bool | loadString (const std::string &content) |
| Load an XML document from a string in memory. | |
| bool | saveFile (const std::string_view filename) const |
| Save the document to a file. | |
| std::string | dumpToString () const |
| Dumps the document to a string. | |
| void | setRootElement (const XmlElement &root) const |
| Set the root element of the document. | |
| XmlElement | getRootElement () const |
| Get the root element of the document. | |
| bool | validateWithDtd (std::span< const unsigned char > dtdData) const |
| Validate the document using a DTD. | |
| bool | validateWithXsd (std::span< const unsigned char > xsdData) const |
| Validate the document using an XSD schema. | |
Class for managing XML documents.
Definition at line 204 of file libxml_wrapper.h.
| XmlDocument::XmlDocument | ( | ) |
Constructor for XmlDocument.
| std::runtime_error | if the document creation fails. |
Definition at line 214 of file libxml_wrapper.h.
|
default |
|
delete |
|
defaultnoexcept |
| std::string XmlDocument::dumpToString | ( | ) | const |
Dumps the document to a string.
Definition at line 128 of file libxml_wrapper.cpp.
References logging::ERROR, and LOG.
Referenced by serial::world_to_xml_string().
Here is the caller graph for this function:| XmlElement XmlDocument::getRootElement | ( | ) | const |
Get the root element of the document.
| std::runtime_error | if the document is not loaded or the root element is missing. |
Definition at line 292 of file libxml_wrapper.h.
Referenced by radar::FileTarget::FileTarget(), mergeXmlDocuments(), and removeIncludeElements().
Here is the caller graph for this function:| bool XmlDocument::loadFile | ( | std::string_view | filename | ) |
Load an XML file into the document.
| filename | The name of the file to load. |
Definition at line 116 of file libxml_wrapper.cpp.
Referenced by radar::FileTarget::FileTarget(), and serial::parseSimulation().
Here is the caller graph for this function:| bool XmlDocument::loadString | ( | const std::string & | content | ) |
Load an XML document from a string in memory.
| content | The string containing the XML document. |
Definition at line 122 of file libxml_wrapper.cpp.
Referenced by serial::parseSimulationFromString().
Here is the caller graph for this function:
|
delete |
|
defaultnoexcept |
| bool XmlDocument::saveFile | ( | const std::string_view | filename | ) | const |
Save the document to a file.
| filename | The name of the file to save to. |
Definition at line 254 of file libxml_wrapper.h.
References logging::ERROR, and LOG.
| void XmlDocument::setRootElement | ( | const XmlElement & | root | ) | const |
Set the root element of the document.
| root | The root element to set. |
| std::runtime_error | if the document is not created. |
Definition at line 277 of file libxml_wrapper.h.
References XmlElement::getNode().
Referenced by serial::world_to_xml_string().
Here is the call graph for this function:
Here is the caller graph for this function:| bool XmlDocument::validateWithDtd | ( | std::span< const unsigned char > | dtdData | ) | const |
Validate the document using a DTD.
| dtdData | The DTD data used for validation. |
| XmlException | if the DTD is invalid or the validation fails. |
Definition at line 20 of file libxml_wrapper.cpp.
| bool XmlDocument::validateWithXsd | ( | std::span< const unsigned char > | xsdData | ) | const |
Validate the document using an XSD schema.
| xsdData | The XSD data used for validation. |
| XmlException | if the XSD is invalid or the validation fails. |
Definition at line 51 of file libxml_wrapper.cpp.