XmlSerializer class implements functions for parsing xml files or xml streams using libxml2 library and for writing to an xml file or streams.
More...
#include <xml_serializer.h>
XmlSerializer class implements functions for parsing xml files or xml streams using libxml2 library and for writing to an xml file or streams.
◆ dxDocumentCreate()
| static DxDocumentPtr XmlSerializer::dxDocumentCreate |
( |
| ) |
|
|
static |
◆ dxDocumentDestroy()
| static void XmlSerializer::dxDocumentDestroy |
( |
DxDocumentPtr & |
document | ) |
|
|
static |
Function recursively clears all child nodes and sets document pointer to nullptr.
- Parameters
-
| document | Shared pointer to a document |
◆ dxDocumentGetStartNode()
| static DxNodePtr XmlSerializer::dxDocumentGetStartNode |
( |
const DxDocumentPtr & |
document | ) |
|
|
static |
Function returns a shared pointer to a root node (start node).
- Parameters
-
| document | Shared pointer to a document |
- Returns
- A shared pointer to a root node
◆ dxDocumentParse()
| static DxDocumentPtr XmlSerializer::dxDocumentParse |
( |
const std::string & |
fileName | ) |
|
|
static |
Function reads and parses an xml file using libxml2 library and returns parsed document.
- Parameters
-
- Returns
- A shared pointer to a newly created document. If xml file is not valid it returns a nullptr
◆ dxDocumentParseStream()
| static DxDocumentPtr XmlSerializer::dxDocumentParseStream |
( |
std::istream & |
inStream | ) |
|
|
static |
Function reads and parses an xml istream using libxml2 library and returns parsed document.
- Parameters
-
- Returns
- A shared pointer to a newly created document.
◆ dxDocumentSetStartNode()
| static void XmlSerializer::dxDocumentSetStartNode |
( |
const DxDocumentPtr & |
document, |
|
|
const DxNodePtr & |
startNode |
|
) |
| |
|
static |
Function sets a root node (start node) to a given document.
- Parameters
-
| document | Shared pointer to a document |
| startNode | Shared pointer to a node |
◆ dxDocumentWriteToFile()
| static void XmlSerializer::dxDocumentWriteToFile |
( |
const DxDocumentPtr & |
document, |
|
|
const std::string & |
fileName, |
|
|
const DxDocumentWriteParameters |
writeParams |
|
) |
| |
|
static |
Function writes a document to a file stream.
- Parameters
-
| document | Shared pointer to a document |
| fileName | Xml file name |
| writeParams | A struct that contains information if document nodes should be indented |
◆ dxDocumentWriteToStream()
| static void XmlSerializer::dxDocumentWriteToStream |
( |
const DxDocumentPtr & |
document, |
|
|
std::ostream & |
outStream, |
|
|
const DxDocumentWriteParameters |
writeParams |
|
) |
| |
|
static |
Function writes a document to a ostream.
- Parameters
-
| document | Shared pointer to a document |
| outStream | output stream |
| writeParams | A struct that contains information if document nodes should be indented |
The documentation for this class was generated from the following file: