This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Xml Class

Interface for Xml manipulation.

To use this class, include the UnigineXml.h file.

Unigine::Xml Class

Members


virtual ~Xml ()

Virtual destructor.

static Ptr< Xml > create ()

Xml constructor.

Return value

Pointer to the created xml.

static Ptr< Xml > create (const char * name, const char * args)

Xml constructor.

Arguments

  • const char * name - Xml name.
  • const char * args - Xml arguments.

Return value

Pointer to the created xml with specified name.

static Ptr< Xml > create (const Ptr< Xml > & xml)

Xml constructor.

Arguments

  • const Ptr< Xml > & xml - Xml smart pointer.

Return value

Pointer to the created xml.

virtual void grab () =0

Grab Xml. The Xml should not be handled by the engine after this function is called.

virtual void release () =0

Release Xml. The Xml should be handled by the engine after this function is called.

virtual int isOwner () const =0

Return the "owner" flag.

Return value

Returns the "owner" flag.

virtual int parse (const char * src) const =0

Parses string and creates the Xml tree.

Arguments

  • const char * src - String pointer.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int load (const char * name) const =0

Loads the Xml tree from the specified file.

Arguments

  • const char * name - File name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int save (const char * name, int binary) const =0

Saves the Xml tree into the specified file.

Arguments

  • const char * name - File name.
  • int binary - Binary Xml format.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual void clear () const =0

Clears the Xml tree.

virtual Ptr< Xml > find (const char * path) const =0

Finds an Xml sub-tree.

Arguments

  • const char * path - Path to the Xml sub-tree.

Return value

The result.

virtual Ptr< Xml > addChild (const char * name, const char * args) const =0

Appends a new Xml child.

Arguments

  • const char * name - Name of the Xml node.
  • const char * args - Arguments of the Xml node.

Return value

Created Xml node.

virtual Ptr< Xml > removeChild (const Ptr< Xml > & xml) const =0

Removes an Xml sub-tree.

Arguments

  • const Ptr< Xml > & xml - Xml sub-tree smart pointer.

Return value

Removed Xml sub-tree.

virtual String getSubTree (const char * path) const =0

Converts an Xml tree into the string.

Arguments

  • const char * path - Path to Xml sub-tree.

Return value

The result.

virtual String getFormattedSubTree (const char * path) const =0

Converts an Xml tree into the formatted string.

Arguments

  • const char * path - Path to Xml sub-tree.

Return value

The result.

virtual void printUnusedData (const char * name) const =0

Prints the unused nodes and arguments.

Arguments

  • const char * name - Name of the Xml file.

virtual void clearUnusedData () const =0

Clear the unused nodes and arguments.

virtual void setName (const char * name) const =0

Sets the Xml node name.

Arguments

  • const char * name - Name of the Xml node.

virtual const char * getName () const =0

Returns the Xml node name.

Return value

The result.

virtual int isChild (const char * name) const =0

Check if the Xml has specified child.

Arguments

  • const char * name - Name of the Xml child.

Return value

The result.

virtual int getNumChilds () const =0

Returns the number of Xml children.

Return value

The result.

virtual Ptr< Xml > getChild (int num) const =0

Returns the child of the Xml tree.

Arguments

  • int num - The child number.

Return value

The result.

virtual Ptr< Xml > getChild (const char * name) const =0

Returns the child of the Xml tree.

Arguments

  • const char * name - Name of the child.

Return value

The result.

virtual int isArg (const char * name) const =0

Check if the Xml has specified argument.

Arguments

  • const char * name - Name of Xml argument.

Return value

The result.

virtual int getNumArgs () const =0

Returns the number of Xml arguments.

Return value

The result.

virtual int findArg (const char * name) const =0

Find a Xml argument by its name.

Arguments

  • const char * name - Xml argument name.

Return value

Xml argument number.

virtual void setArgName (int num, const char * name) const =0

Set the Xml argument name.

Arguments

  • int num - The argument number.
  • const char * name - The argument name.

virtual const char * getArgName (int num) const =0

Return the Xml argument name.

Arguments

  • int num - The argument number.

Return value

The result.

virtual void setArgValue (int num, const char * value) const =0

Set the Xml argument value.

Arguments

  • int num - The argument number.
  • const char * value - The argument value.

virtual const char * getArgValue (int num) const =0

Return the Xml argument value.

Arguments

  • int num - The argument number.

Return value

The result.

virtual int setArg (const char * name, const char * value) const =0

Sets a Xml argument.

Arguments

  • const char * name - The Xml argument name.
  • const char * value - The Xml argument value.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual const char * getArg (const char * name) const =0

Gets a Xml argument.

Arguments

  • const char * name - The Xml argument name.

Return value

The result.

virtual int setBoolArg (const char * name, int value) const =0

Sets a boolean as Xml argument.

Arguments

  • const char * name - The Xml argument name.
  • int value - The Xml argument value.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int getBoolArg (const char * name) const =0

Gets a boolean Xml argument.

Arguments

  • const char * name - The Xml argument name.

Return value

The result.

virtual int setIntArg (const char * name, int value) const =0

Sets an integer as Xml argument.

Arguments

  • const char * name - The Xml argument name.
  • int value - The Xml argument value.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int getIntArg (const char * name) const =0

Gets an integer Xml argument.

Arguments

  • const char * name - The Xml argument name.

Return value

The result.

virtual int setIntArrayArg (const char * name, const int * src, int size) const =0

Sets an array of integers as Xml argument.

Arguments

  • const char * name - The Xml argument name.
  • const int * src - The pointer to the array of integers.
  • int size - The size of the array of integers.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int getIntArrayArg (const char * name, int * dest, int size) const =0

Gets an array of integers from Xml argument.

Arguments

  • const char * name - The Xml argument name.
  • int * dest - The pointer to the array of integers.
  • int size - The size of the array of integers.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int setData (const char * data) const =0

Sets a Xml data.

Arguments

  • const char * data - The Xml data.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int setRawData (const char * data) const =0

Sets a Xml raw data.

Arguments

  • const char * data - The Xml raw data.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int setXmlData (const char * data) const =0

Sets a Xml xml data.

Arguments

  • const char * data - The Xml xml data.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual const char * getData () const =0

Gets a Xml data.

Return value

The result.

virtual int setBoolData (int value) const =0

Sets a boolean as Xml data.

Arguments

  • int value - The Xml argument value.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int getBoolData () const =0

Gets a boolean Xml data.

Return value

The result.

virtual int setIntData (int value) const =0

Sets an integer as Xml data.

Arguments

  • int value - The Xml argument value.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int getIntData () const =0

Gets an integer Xml data.

Return value

The result.

virtual int setIntArrayData (const int * src, int size) const =0

Sets an array of integers as Xml data.

Arguments

  • const int * src - The pointer to the array of integers.
  • int size - The size of the array of integers.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int getIntArrayData (int * dest, int size) const =0

Gets an array of integers from Xml data.

Arguments

  • int * dest - The pointer to the array of integers.
  • int size - The size of the array of integers.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.
Last update: 2017-07-03
Build: ()