This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::Xml Class

Header: #include <UnigineXml.h>

As Unigine extensively uses XML for storing different types of data, it also provides functionality for parsing and saving files of this type.

See Also#

  • C++ API sample <UnigineSDK>/source/samples/Api/Systems/Xml
  • C# API sample <UnigineSDK>/source/csharp/samples/Api/Systems/Xml

Xml Class

Members


static XmlPtr create ( ) #

Default constructor that creates an empty instance.

static XmlPtr create ( const char * name, const char * args = 0 ) #

Creates an XML tree with a given node as a root.

Arguments

  • const char * name - Name of the node that will be a root.
  • const char * args - Optional arguments to the root node. If provided, they should be in this form:

    arg1=\"value1\" arg2=\"value2\" …

    If values do not contain spaces, escaped quotes can be omitted.

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

Constructor. Creates a path out of the specified XML file.

Arguments

  • const Ptr<Xml> & xml - Pointer to the XML file.

bool setArg ( const char * name, const char * value ) #

Sets a literal value of a given argument.

Arguments

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

Return value

true if the argument is set successfully; otherwise, false.

const char * getArg ( const char * name ) const#

Gets an XML argument.

Arguments

  • const char * name - The XML argument name.

Return value

Value of the argument, if it is found; otherwise, 0.

bool isArg ( const char * name ) const#

Checks whether an argument with a given name exists.

Arguments

  • const char * name - Name of XML argument.

Return value

true if the argument exists; otherwise, false.

void setArgName ( int num, const char * name ) #

Sets the XML argument name.

Arguments

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

const char * getArgName ( int num ) const#

Returns argument name by its number.

Arguments

  • int num - Argument number.

Return value

Argument name.

void setArgValue ( int num, const char * value ) #

Sets the XML argument value.

Arguments

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

const char * getArgValue ( int num ) const#

Returns the XML argument value.

Arguments

  • int num - The argument number.

Return value

Argument value.

bool setBoolArg ( const char * name, bool value ) #

Sets a value of a given boolean argument.

Arguments

  • const char * name - Name of an argument.
  • bool value - Value of the argument. Any non-zero value means true, the zero value means false.

Return value

true if the operation was successful; otherwise, false.

bool getBoolArg ( const char * name, bool value ) const#

Returns a value of a given boolean argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.
  • bool value - Default value of the argument.

Return value

1 if the argument has a value 1, true or TRUE; 0, if the argument has a value 0, false or FALSE; otherwise, 0.

bool getBoolArg ( const char * name ) const#

Returns a value of a given boolean argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

1 if the argument has a value 1, true or TRUE; 0, if the argument has a value 0, false or FALSE; otherwise, 0.

void setBoolData ( bool data ) #

Sets a boolean content for the node. This can be done only for nodes with no children.

Arguments

  • bool data - Content to set. Any non-zero value means true, the zero value means false.

bool getBoolData ( ) const#

Returns a boolean interpretation of data stored in the node.

Return value

1 if a value equals to 1, true or TRUE; 0, if the value equals to 0, false or FALSE; otherwise, 0.

Ptr<Xml> getChild ( const char * name ) const#

Returns the child of the XML tree.

Arguments

  • const char * name - The child number.

Return value

Pointer to XML.

Ptr<Xml> getChild ( int num ) const#

Returns a child node by its name or index number in the child list.
Notice
To check, if a child with a given name exists, use the isChild() method.

Arguments

  • int num - The child number.

Return value

Target child node, if it is found; otherwise, 0.

bool isChild ( const char * name ) const#

Checks if a child element with a given name exists.

Arguments

  • const char * name - Element name to check.

Return value

true if a child with the provided name exists; otherwise, false.

const char * getChildData ( const char * name ) const#

Gets the data from the XML child node.

Arguments

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

Return value

The value of the child node.

void setData ( const char * data ) #

Sets an XML data.

Arguments

  • const char * data - The XML data.

const char * getData ( ) const#

Gets a data from the XML file.

Return value

Data.

bool setDMat4Arg ( const char * name, const Math::dmat4 & value ) #

Sets a value of a given dmat4 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::dmat4 & value - Value of an argument.

Return value

Always true.

Math::dmat4 getDMat4Arg ( const char * name ) const#

Returns a value of a given dmat4 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setDMat4Data ( const Math::dmat4 & data ) #

Sets a dmat4 matrix content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::dmat4 & data - Content to set.

Math::dmat4 getDMat4Data ( ) const#

Returns a dmat4 matrix interpretation of data stored in the node.

Return value

Data stored in the node.

bool setDoubleArg ( const char * name, double value ) #

Sets a value of a given double argument.

Arguments

  • const char * name - Name of an argument.
  • double value - Value of an argument.

Return value

Always 1.

double getDoubleArg ( const char * name, double value ) const#

Returns a value of a given double argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.
  • double value - Default value of the argument.

Return value

Argument value.

double getDoubleArg ( const char * name ) const#

Returns a value of a given double argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

bool setDoubleArrayArg ( const char * name, double[] src ) #

Sets a vector of double as a value of a given argument.

Arguments

  • const char * name - Name of an argument.
  • double[] src - Reference to a vector with double components.

Return value

Always 1.

bool getDoubleArrayArg ( const char * name, out double[] dest ) const#

Returns a set of double values stored in an argument and puts them in a vector.

Arguments

  • const char * name - Name of a target argument.
  • out double[] dest

Return value

1 if dest contains anything; otherwise, 0.

bool setDoubleArrayData ( double[] src ) #

Sets a vector of double components as a content for the node. This can be done only for nodes with no children.

Arguments

  • double[] src - Reference to a vector with double components.

Return value

1 if the content is set successfully; otherwise, 0.

bool getDoubleArrayData ( out double[] dest ) const#

Returns an interpretation of data stored in the node as a vector of double components.

Arguments

  • out double[] dest - Reference to a vector with double components.

Return value

1 if dest contains anything; otherwise, 0.

void setDoubleData ( double data ) #

Sets a double content for the node. This can be done only for nodes with no children.

Arguments

  • double data - Content to set.

double getDoubleData ( ) const#

Returns a double interpretation of data stored in the node.

Return value

Data stored in the node.

bool setDVec2Arg ( const char * name, const Math::dvec2 & value ) #

Sets a value of a given dvec2 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::dvec2 & value - Value of an argument.

Return value

Always 1.

Math::dvec2 getDVec2Arg ( const char * name ) const#

Returns a value of a given dvec2 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setDVec2Data ( const Math::dvec2 & data ) #

Sets a dvec2 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::dvec2 & data - Content to set.

Math::dvec2 getDVec2Data ( ) const#

Returns a dvec2 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setDVec3Arg ( const char * name, const Math::dvec3 & value ) #

Sets a value of a given dvec3 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::dvec3 & value - Value of an argument.

Return value

Always 1.

Math::dvec3 getDVec3Arg ( const char * name ) const#

Returns a value of a given dvec3 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setDVec3Data ( const Math::dvec3 & data ) #

Sets a dvec3 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::dvec3 & data - Content to set.

Math::dvec3 getDVec3Data ( ) const#

Returns a dvec3 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setDVec4Arg ( const char * name, const Math::dvec4 & value ) #

Sets a value of a given dvec4 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::dvec4 & value - Value of an argument.

Return value

Always 1.

Math::dvec4 getDVec4Arg ( const char * name ) const#

Returns a value of a given dvec4 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setDVec4Data ( const Math::dvec4 & data ) #

Sets a dvec4 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::dvec4 & data - Content to set.

Math::dvec4 getDVec4Data ( ) const#

Returns a dvec4 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setFloatArg ( const char * name, float value ) #

Sets a value of a given float argument.

Arguments

  • const char * name - Name of an argument.
  • float value - Value of an argument.

Return value

Always 1.

float getFloatArg ( const char * name, float value ) const#

Returns a value of a given float argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.
  • float value - Default value of the argument.

Return value

Argument value.

float getFloatArg ( const char * name ) const#

Returns a value of a given float argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

bool setFloatArrayArg ( const char * name, float[] src ) #

Sets a vector of floats as a value of a given argument.

Arguments

  • const char * name - Name of an argument.
  • float[] src

Return value

Always 1.

bool getFloatArrayArg ( const char * name, out float[] dest ) const#

Returns a set of float values stored in an argument and puts them in a vector.

Arguments

  • const char * name - Name of a target argument.
  • out float[] dest - Target vector.

Return value

1 if dest contains anything; otherwise, 0.

bool setFloatArrayData ( float[] src ) #

Sets a vector of floats as a content for the node. This can be done only for nodes with no children.

Arguments

  • float[] src - A float array data.

Return value

1 if the content is set successfully; otherwise, 0.

bool getFloatArrayData ( out float[] dest ) const#

Returns an interpretation of data stored in the node as a vector of floats.

Arguments

  • out float[] dest - Reference to a vector.

Return value

1 if dest contains anything; otherwise, 0.

void setFloatData ( float data ) #

Sets a float content for the node. This can be done only for nodes with no children.

Arguments

  • float data - Content to set.

float getFloatData ( ) const#

Returns a float interpretation of data stored in the node.

Return value

Data stored in the node.

String getFormattedSubTree ( const char * path = 0, const char * indent = "\t" ) const#

Converts the specified XML subtree into a formatted string for "pretty printing". If no arguments are passed, the entire XML tree is converted.

Arguments

  • const char * path - Path to the XML subtree to be formatted. See the description of find() for more details.
  • const char * indent - String to be used for indenting (e.g. "\t").

Return value

Multi-line indented output of the specified XML subtree.

bool setIntArg ( const char * name, int value, int radix = 10 ) #

Sets a value for a given int argument in a given number notation. By default, the decimal number notation is used.

Arguments

  • const char * name - Name of an argument.
  • int value - Value of an argument.
  • int radix - Radix to use when setting a value.

Return value

1 if the value is set successfully; otherwise, 0.

int getIntArg ( const char * name ) const#

Returns a value of a given int argument.
Notice
To check whether the argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

int getIntArg ( const char * name, int value ) const#

Returns a value of a given int argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.
  • int value - Default value of the argument.

Return value

Argument value.

bool setIntArrayArg ( const char * name, int[] src, int radix = 10 ) #

Sets an array of integers as xml argument in a given number notation. By default, the decimal number notation is used.

Arguments

  • const char * name - Name of an argument.
  • int[] src - An array of integers.
  • int radix - Radix to use when setting a value.

Return value

1 if the array is set successfully; otherwise, 0.

bool getIntArrayArg ( const char * name, out int[] dest ) const#

Returns a set of int values stored in an argument and puts them in a vector.

Arguments

  • const char * name - Name of a target argument.
  • out int[] dest - Reference to a vector or an array of integers.

Return value

1 if values are read successfully; otherwise, 0.

bool setIntArrayData ( int[] src, int radix ) #

Sets a vector of integers as a content for the XML node in a given number notation. By default, the decimal number notation is used. This can be done only for XML nodes with no children.

Arguments

  • int[] src - Reference to a vector.
  • int radix - Radix to use when setting a value.

Return value

1 if the content is set successfully; otherwise, 0.

bool getIntArrayData ( out int[] dest ) const#

Returns an interpretation of data stored in the node as a vector of integers.

Arguments

  • out int[] dest - Reference to a vector.

Return value

1 if values are read successfully; otherwise, 0.

bool setIntData ( int value, int radix = 10 ) #

Sets an integer as a content for the XML node in a given number notation. By default, the decimal number notation is used. This can be done only for XML nodes with no children.

Arguments

  • int value - Content to set.
  • int radix - Radix to use when setting a value.

Return value

1 if the content is set successfully; otherwise, 0.

int getIntData ( ) const#

Returns an integer interpretation of data stored in the node.

Return value

Data stored in the node.

bool setIVec2Arg ( const char * name, const Math::ivec2 & value ) #

Sets a value of a given ivec2 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::ivec2 & value - Value of an argument.

Return value

Always 1.

Math::ivec2 getIVec2Arg ( const char * name ) const#

Returns a value of a given ivec2 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setIVec2Data ( const Math::ivec2 & data ) #

Sets a ivec2 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::ivec2 & data - Content to set.

Math::ivec2 getIVec2Data ( ) const#

Returns a ivec2 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setIVec3Arg ( const char * name, const Math::ivec3 & value ) #

Sets a value of a given ivec3 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::ivec3 & value - Value of an argument.

Return value

Always 1.

Math::ivec3 getIVec3Arg ( const char * name ) const#

Returns a value of a given ivec3 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setIVec3Data ( const Math::ivec3 & data ) #

Sets a ivec3 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::ivec3 & data - Content to set.

Math::ivec3 getIVec3Data ( ) const#

Returns a ivec3 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setIVec4Arg ( const char * name, const Math::ivec4 & value ) #

Sets a value of a given ivec4 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::ivec4 & value - Value of an argument.

Return value

Always 1.

Math::ivec4 getIVec4Arg ( const char * name ) const#

Returns a value of a given ivec4 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setIVec4Data ( const Math::ivec4 & data ) #

Sets a ivec4 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::ivec4 & data - Content to set.

Math::ivec4 getIVec4Data ( ) const#

Returns a ivec4 interpretation of data stored in the node.

Return value

Data stored in the node.

void setLongData ( long long data ) #

Sets a long content for the node. This can be done only for nodes with no children.

Arguments

  • long long data - Content to be set.

long long getLongData ( ) const#

Returns a long interpretation of data stored in the node.

Return value

Data stored in the node.

bool setMat4Arg ( const char * name, const Math::mat4 & value ) #

Sets a value of a given mat4 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::mat4 & value - Value of an argument.

Return value

Always 1.

Math::mat4 getMat4Arg ( const char * name ) const#

Returns a value of a given mat4 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setMat4Data ( const Math::mat4 & data ) #

Sets a mat4 matrix content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::mat4 & data - Content to set.

Math::mat4 getMat4Data ( ) const#

Returns a mat4 matrix interpretation of data stored in the node.

Return value

Data stored in the node.

void setName ( const char * name ) #

Sets a name of the node.

Arguments

  • const char * name - Node name.

const char * getName ( ) const#

Returns a name of the node.

Return value

Node name.

int getNumArgs ( ) const#

Returns a number of arguments.

Return value

Number of arguments.

int getNumChildren ( ) const#

Returns the number of the node children.

Return value

The result.

Ptr<Xml> getParent ( ) const#

Returns the parent of the current XML node.

Return value

XML node.

bool setQuatArg ( const char * name, const Math::quat & value ) #

Sets a value of a given quat argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::quat & value - Value of an argument.

Return value

Always 1.

Math::quat getQuatArg ( const char * name ) const#

Returns a value of a given quat argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setQuatData ( const Math::quat & data ) #

Sets a quaternion content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::quat & data - Content to set.

Math::quat getQuatData ( ) const#

Returns a quaternion interpretation of data stored in the node.

Return value

Data stored in the node.

bool setRawData ( const char * data ) #

Sets a raw content for the node. Raw data will be automatically formatted as a CDATA section. This can be done only for nodes with no children.

Arguments

  • const char * data - Content to set.

Return value

1 if the content is set successfully; otherwise, 0.

bool setStringArrayArg ( const char * name, const Vector< String > & src ) #

Sets a vector of strings as a value of a given argument in a given number notation. By default, the decimal number notation is used.

Arguments

  • const char * name - Name of an argument.
  • const Vector< String > & src - An array of strings.

Return value

Always 1.

bool getStringArrayArg ( const char * name, Vector< String > & dest ) const#

Returns a set of string values stored in an argument and puts them in a vector.

Arguments

Return value

1 if dest contains anything; otherwise, 0.

bool setStringArrayData ( const Vector< String > & src, const char * delimiter = "," ) #

Sets a vector of strings as a content for the node. This can be done only for nodes with no children.

Arguments

  • const Vector< String > & src - Reference to a vector of strings.
  • const char * delimiter - Character(s) to be used as a delimiter to split tokens.

Return value

true if the content is set successfully; otherwise, false.

bool getStringArrayData ( Vector< String > & dest, const char * delimiter = "," ) const#

Returns an interpretation of data stored in the node as a vector of strings.

Arguments

  • Vector< String > & dest - Reference to a vector of strings.
  • const char * delimiter - Character(s) to be used as a delimiter to split tokens.

Return value

1 if dest contains anything; otherwise, 0.

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

Dumps the node tree.

Arguments

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

Return value

Single-line non-indented output of the node tree. If no arguments are passed, the entire XML tree would be output.

bool setVec2Arg ( const char * name, const Math::vec2 & value ) #

Sets a value of a given vec2 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::vec2 & value - Value of an argument.

Return value

Always 1.

Math::vec2 getVec2Arg ( const char * name ) const#

Returns a value of a given vec2 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setVec2Data ( const Math::vec2 & data ) #

Sets a vec2 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::vec2 & data - Content to set.

Math::vec2 getVec2Data ( ) const#

Returns a vec2 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setVec3Arg ( const char * name, const Math::vec3 & value ) #

Sets a value of a given vec3 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::vec3 & value - Value of an argument.

Return value

Always 1.

Math::vec3 getVec3Arg ( const char * name ) const#

Returns a value of a given vec3 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setVec3Data ( const Math::vec3 & data ) #

Sets a vec3 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::vec3 & data - Content to set.

Math::vec3 getVec3Data ( ) const#

Returns a vec3 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setVec4Arg ( const char * name, const Math::vec4 & value ) #

Sets a value of a given vec4 argument.

Arguments

  • const char * name - Name of an argument.
  • const Math::vec4 & value - Value of an argument.

Return value

Always 1.

Math::vec4 getVec4Arg ( const char * name ) const#

Returns a value of a given vec4 argument.
Notice
To check, if an argument exists, use the isArg() method.

Arguments

  • const char * name - Name of a target argument.

Return value

Argument value.

void setVec4Data ( const Math::vec4 & data ) #

Sets a vec4 content for the node. This can be done only for nodes with no children.

Arguments

  • const Math::vec4 & data - Content to set.

Math::vec4 getVec4Data ( ) const#

Returns a vec4 interpretation of data stored in the node.

Return value

Data stored in the node.

bool setXmlData ( const char * data ) #

Sets an unquoted string to data stored in the node. This string can also contain XML sub-tree with rich text formatting.

Arguments

  • const char * data - Unquoted string to set.

Return value

1 if the string is set successfully; otherwise, 0.

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

Appends a new XML node to the current XML node as a child.

Arguments

  • const char * name - Name of the XML node.
  • const char * args - Arguments of the XML node. The default value is 0.
    Notice
    This value should be passed if the first argument is a string

Return value

Created XML node.

Ptr<Xml> addChild ( const Ptr<Xml> & xml ) const#

Appends a new XML node to the current XML node as a child.

Arguments

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

Return value

Created XML node.

void clear ( ) #

Clears all data associated with the node.

void clearChildren ( ) #

Clears all children of the current XML node.

void clearUnusedData ( ) #

Clears the unused nodes and arguments.

void copy ( const Ptr<Xml> & source ) #

Copies all data (name, arguments, data, flags and a child hierarchy) from the source XML node to the current one.

Arguments

  • const Ptr<Xml> & source - Source XML node.

String decode ( const char * arg1 ) #

Decodes special XML characters (less-than, greater-than, ampersand, double-quote and apostrophe) and numeric character references.

Arguments

  • const char * arg1 - Data to decode.

Return value

Decoded string.

String encode ( const char * arg1 ) #

Encodes special XML characters (less-than, greater-than, ampersand, double-quote and apostrophe) to their character entity reference.

Arguments

  • const char * arg1 - Data to encode.

Return value

Encoded string.

Ptr<Xml> find ( const char * path ) const#

Searches for an XML sub-tree.

Arguments

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

Return value

Pointer to the XML node.

int findArg ( const char * name ) const#

Searches for a XML argument by its name.

Arguments

  • const char * name - XML argument name.

Return value

XML argument number.

int findChild ( const char * name ) const#

Searches for the number of the XML node child by name.

Arguments

  • const char * name - Name of the XML node child.

Return value

The number of the XML node child if it is exists; otherwise, -1.

bool load ( const char * name, bool skip_errors = false ) #

Loads an XML document and sets the current node to be the root of the parsed tree.

Arguments

  • const char * name - File name.
  • bool skip_errors - true to enable automatic skipping of errors (the file will be loaded in any case); false — to disable it (the file will not be loaded in case of any error).

Return value

true if the file is read and parsed successfully; otherwise, false.

bool load ( Ptr<Stream> & stream, size_t read_size, bool binary = false, bool skip_errors = false ) #

Loads XML data from the specified stream and sets the current node to be the root of the parsed tree.

Arguments

  • Ptr<Stream> & stream - Stream from which the data of the XML node is to be loaded.
  • size_t read_size - Size of the data block to be read from the stream, in bytes.
  • bool binary - Binary format flag: use true to load data in binary format, or false - to load it in text format.
  • bool skip_errors - true to enable automatic skipping of errors (the data will be loaded in any case); false — to disable it (the data will not be loaded in case of any error).

Return value

true if the data is read and parsed successfully; otherwise, false.

bool parse ( const char * src ) #

Parses a string with XML mark-up and sets the current node to be the root of the parsed tree.

Arguments

  • const char * src - String pointer.

Return value

true if a string is successfully parsed; otherwise false.

void printUnusedData ( const char * name ) const#

Logs warnings of unused data for debugging.

Arguments

  • const char * name

int removeArg ( const char * name ) #

Removes the argument with the given name from the list of the current XML node arguments.

Arguments

  • const char * name - Name of the target argument.

Return value

1 if the argument is deleted successfully; otherwise, 0.

Ptr<Xml> removeChild ( const Ptr<Xml> & xml ) #

Removes a child node and its descendants from the current XML node.

Arguments

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

Return value

Removed child node and its descendants, if they are found; otherwise, 0.

bool save ( const char * name, bool binary = false, const char * indent = "\t" ) const#

Formats the tree of the current node and writes it to the specified file in the specified format. Creates the given file path if it doesn’t exist yet (including subdirectories).

Arguments

  • const char * name - Path to the file.
  • bool binary - Binary format flag: use true to save data to a binary file, or false - to save it to a text file.
  • const char * indent - String to be used for indentation (e.g. "\t").

Return value

true if the file is written successfully; otherwise, false.

bool save ( Ptr<Stream> & stream, bool binary = false, const char * indent = "\t" ) const#

Formats the tree of the current node and writes is to the specified stream in the specified format.

Arguments

  • Ptr<Stream> & stream - Stream to which the data of the XML node is to be written.
  • bool binary - Binary format flag: use true to save data to a binary file, or false - to save it to a text file.
  • const char * indent - String to be used for indentation (e.g. "\t").

Return value

true if the file is written successfully; otherwise, false.

String symbols ( const char * arg1 ) #

Replaces ampersand characters with character entity references.

Arguments

  • const char * arg1 - String to encode.

Return value

String which contains replaced ampersand characters with character entity references.

const char * getLoadPath ( ) const#

Returns the path to an XML file from which the data of the XML instance was loaded.

Return value

Path to the XML file.

bool setData ( const UGUID & guid ) #

Sets a UGUID content for the node.

Arguments

  • const UGUID & guid - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( bool value ) #

Sets a boolean content for the node.

Arguments

  • bool value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( int value, int radix = 10 ) #

Sets an integer content in the specified form (binary, octal, decimal, hexadecimal) for the node.

Arguments

  • int value - Content to set.
  • int radix - Radix (base) specifying the form of representation of the value, one of the following:
    • 2 - binary
    • 8 - octal
    • 10 - decimal (default)
    • 16 - hexadecimal

Return value

true if the content is set successfully; otherwise, false.

bool setData ( long long value ) #

Sets a long integer content for the node.

Arguments

  • long long value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( float value ) #

Sets a float content for the node.

Arguments

  • float value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( double value ) #

Sets a double content for the node.

Arguments

  • double value

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::vec2 & value ) #

Sets a vec2 vector content for the node.

Arguments

  • const Math::vec2 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::vec3 & value ) #

Sets a vec3 vector content for the node.

Arguments

  • const Math::vec3 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::vec4 & value ) #

Sets a vec4 vector content for the node.

Arguments

  • const Math::vec4 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::dvec2 & value ) #

Sets a dvec2 vector content for the node.

Arguments

  • const Math::dvec2 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::dvec3 & value ) #

Sets a dvec3 vector content for the node.

Arguments

  • const Math::dvec3 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::dvec4 & value ) #

Sets a dvec4 vector content for the node.

Arguments

  • const Math::dvec4 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::ivec3 & value ) #

Sets an ivec3 vector content for the node.

Arguments

  • const Math::ivec3 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::ivec2 & value ) #

Sets an ivec2 vector content for the node.

Arguments

  • const Math::ivec2 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::ivec4 & value ) #

Sets an ivec4 vector content for the node.

Arguments

  • const Math::ivec4 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::mat4 & value ) #

Sets a mat4 matrix content for the node.

Arguments

  • const Math::mat4 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::dmat4 & value ) #

Sets a dmat4 matrix content for the node.

Arguments

  • const Math::dmat4 & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

bool setData ( const Math::quat & value ) #

Sets a quaternion content for the node.

Arguments

  • const Math::quat & value - Content to set.

Return value

true if the content is set successfully; otherwise, false.

void readChildData ( const char * name, bool & value ) const#

Reads a boolean interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • bool & value - Target boolean variable.

void readChildData ( const char * name, int & value ) const#

Reads an integer interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • int & value - Target integer variable.

void readChildData ( const char * name, char & value ) const#

Reads a character interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • char & value - Target character variable.

void readChildData ( const char * name, long long & value ) const#

Reads a long integer interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • long long & value - Target long integer variable.

void readChildData ( const char * name, float & value ) const#

Reads a float interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • float & value - Target float variable.

void readChildData ( const char * name, double & value ) const#

Reads a double interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • double & value - Target double variable.

void readChildData ( const char * name, Math::vec2 & value ) const#

Reads a vec2 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::vec2 & value - Target vec2 variable.

void readChildData ( const char * name, Math::vec3 & value ) const#

Reads a vec3 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::vec3 & value - Target vec3 variable.

void readChildData ( const char * name, Math::vec4 & value ) const#

Reads a vec4 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::vec4 & value - Target vec4 variable.

void readChildData ( const char * name, Math::dvec2 & value ) const#

Reads a dvec2 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::dvec2 & value - Target dvec2 variable.

void readChildData ( const char * name, Math::dvec3 & value ) const#

Reads a dvec3 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::dvec3 & value - Target dvec3 variable.

void readChildData ( const char * name, Math::dvec4 & value ) const#

Reads a dvec4 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::dvec4 & value - Target dvec4 variable.

void readChildData ( const char * name, Math::ivec2 & value ) const#

Reads an ivec2 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::ivec2 & value - Target ivec2 variable.

void readChildData ( const char * name, Math::ivec3 & value ) const#

Reads an ivec3 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::ivec3 & value - Target ivec3 variable.

void readChildData ( const char * name, Math::ivec4 & value ) const#

Reads an ivec4 vector interpretation of the data stored in the node with the specified name and puts it to the specified target variable.

Arguments

  • const char * name - Child node name.
  • Math::ivec4 & value - Target ivec4 variable.

void readArg ( const char * name, bool & value ) const#

Reads a boolean interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • bool & value - Target boolean variable.

void readArg ( const char * name, int & value ) const#

Reads an integer interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • int & value - Target integer variable.

void readArg ( const char * name, char & value ) const#

Reads a character interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • char & value - Target character variable.

void readArg ( const char * name, float & value ) const#

Reads a float interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • float & value - Target float variable.

void readArg ( const char * name, double & value ) const#

Reads a double interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • double & value - Target double variable.

void readArg ( const char * name, Math::vec2 & value ) const#

Reads a vec2 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::vec2 & value - Target vec2 variable.

void readArg ( const char * name, Math::vec3 & value ) const#

Reads a vec3 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::vec3 & value - Target vec3 variable.

void readArg ( const char * name, Math::vec4 & value ) const#

Reads a vec4 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::vec4 & value - Target vec4 variable.

void readArg ( const char * name, Math::dvec2 & value ) const#

Reads a dvec2 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::dvec2 & value - Target dvec2 variable.

void readArg ( const char * name, Math::dvec3 & value ) const#

Reads a dvec3 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::dvec3 & value - Target dvec3 variable

void readArg ( const char * name, Math::dvec4 & value ) const#

Reads a dvec4 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::dvec4 & value - Target dvec4 variable.

void readArg ( const char * name, Math::ivec2 & value ) const#

Reads a ivec2 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::ivec2 & value - Target ivec2 variable.

void readArg ( const char * name, Math::ivec3 & value ) const#

Reads a ivec3 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::ivec3 & value - Target ivec3 variable.

void readArg ( const char * name, Math::ivec4 & value ) const#

Reads a ivec4 interpretation of the argument in the node with specified name and puts it to the specified target variable.

Arguments

  • const char * name - Name of the target argument.
  • Math::ivec4 & value - Target ivec4 variable.
Last update: 2021-12-13
Build: ()