IoXmlParser Class Reference IO

#include <ioxmlparser.h>

详细描述

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

静态公共成员函数

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)

私有成员函数

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

成员函数文档编制

◆  MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( IoXmlParser   ,
MAXON_REFERENCE_NONE   ,
"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.

参数
[in] xmlFile Input path of the file.
[out] line Line number in which an error occurred. This value will be zero if error is not XMLERROR::PARSE.
返回
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.

参数
[in] xmlFile Input memory block.
[in] length Length of the input block.
[out] line Line number in which an error occurred. This value will be zero if error is not XMLERROR::PARSE.
返回
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.

参数
[in] file Output path of the file.
[in] rootNode Root node of the XML document in memory.
[in] tabs If true a tab stop will be written instead of two spaces for indentation.
[in] header Can be nullptr. If provided, this text will be written as header (the first line) instead of the regular header.
返回
Success of operation.