Inscoper::XMLDocument¶
XMLDocument class represents an entire XML document. More...
#include <XMLDocument.h>
Public Functions¶
| Name | |
|---|---|
| XMLDocument() Default constructor. |
|
| ~XMLDocument() Destructor. |
|
| void | loadFile(const std::string & xmlFile) Load from file. |
| bool | tryLoadingFile(const std::string & xmlFile) Try loading from file. |
| void | saveFile(const std::string & xmlFile) Save to file. |
| Inscoper::XMLNode | getChild(const std::string & name) Get child node by name. |
| Inscoper::XMLNode | toXMLNode() Convert to XML node. |
Detailed Description¶
XMLDocument class represents an entire XML document.
Note: This class is non-copyable and non-movable.
This class handles loading and saving of XML documents and access to the root node.
Public Functions Documentation¶
function XMLDocument¶
Default constructor.
function ~XMLDocument¶
Destructor.
function loadFile¶
Load from file.
Parameters:
- xmlFile : The path to the XML file
Exceptions:
- InscoperException If an error occurs during loading
Loads the XML document from a file path.
function tryLoadingFile¶
Try loading from file.
Parameters:
- xmlFile : The path to the XML file
Return: True if loading was successful, false otherwise
Attempts to load the XML document without throwing an exception.
function saveFile¶
Save to file.
Parameters:
- xmlFile : The path where the XML file will be saved
Exceptions:
- InscoperException If an error occurs during saving
Saves the current XML document to a file.
function getChild¶
Get child node by name.
Parameters:
- name : The name of the child node
Return: The child XML node
Retrieves a direct child node with the name.
function toXMLNode¶
Convert to XML node.
Return: The root XML node
Returns the root element of the document as an XML node.
Updated on 2026-04-02 at 10:55:36 +0200