IoXmlParser Class Reference

#include <ioxmlparser.h>

Detailed Description

XML parser class. Use this class to read an XML file into memory or write an XML file to disc.

Static Public Member Functions

static MAXON_METHOD Result< IoXmlNodeInterface * > ReadDocument (const Url &xmlFile, Int &line)
 
static MAXON_METHOD Result< IoXmlNodeInterface * > ReadDocument (const Char *xmlFile, Int length, Int &line)
 
static MAXON_METHOD Result< void > WriteDocument (const Url &file, const IoXmlNodeRef &rootNode, Bool tabs, const Char *header)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (IoXmlParser, MAXON_REFERENCE_STATIC, "net.maxon.interface.ioxmlparser")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( IoXmlParser  ,
MAXON_REFERENCE_STATIC  ,
"net.maxon.interface.ioxmlparser"   
)
private

◆ ReadDocument() [1/2]

static MAXON_METHOD Result<IoXmlNodeInterface*> ReadDocument ( const Url xmlFile,
Int line 
)
static

Reads an XML document and transforms it into a memory representation.

Parameters
[in]xmlFileInput path of the file.
[out]lineLine number in which an error occurred. This value will be zero if error is not XMLERROR::PARSE.
Returns
Root node of the read XML document or nullptr in case of an error.

◆ ReadDocument() [2/2]

static MAXON_METHOD Result<IoXmlNodeInterface*> ReadDocument ( const Char xmlFile,
Int  length,
Int line 
)
static

Reads an XML document and transforms it into a memory representation.

Parameters
[in]xmlFileInput memory block.
[in]lengthLength of the input block.
[out]lineLine number in which an error occurred. This value will be zero if error is not XMLERROR::PARSE.
Returns
Root node of the read XML document or nullptr in case of an error.

◆ WriteDocument()

static MAXON_METHOD Result<void> WriteDocument ( const Url file,
const IoXmlNodeRef &  rootNode,
Bool  tabs,
const Char header 
)
static

Writes an XML document.

Parameters
[in]fileOutput path of the file.
[in]rootNodeRoot node of the XML document in memory.
[in]tabsIf true a tab stop will be written instead of two spaces for indentation.
[in]headerCan be nullptr. If provided, this text will be written as header (the first line) instead of the regular header.
Returns
Success of operation.