![]() |
CRM64Pro GDK v0.14.0
A free cross-platform game development kit built on top of SDL 3.0
|
XML Object class.
Public Member Functions | |
| bool | info (Sint32 iMode=0) override |
| Request XML object information. | |
| const string & | getName () const override |
| Get the name. | |
| Uint32 | getID () const override |
| Get the ID. | |
| bool | nodePointTo (Sint32 iParam, char *szNodes,...) |
| Point to a node using a va_list of node names. | |
| bool | nodeFirst () |
| Point to the first XML node (the root node). | |
| bool | nodeNext () |
| Point to the next node (from current pointed node). | |
| bool | nodePrev () |
| Point to the previous node (from current pointed node). | |
| bool | nodeParent () |
| Point to the parent node (from current pointed node). | |
| bool | nodeChild () |
| Point to the first child node (from current pointed node). | |
| bool | nodeStore () |
| Store node pointer position. | |
| bool | nodeRestore () |
| Restore node pointer position. | |
| bool | nodeRemove () |
| Remove pointed node and all its subnodes and attributes. | |
| bool | nodeCreate (const string &sNode) |
| Create a new node inside the pointed node and point to it. | |
| bool | nodeRename (const string &sNode) |
| Rename pointed node. | |
| bool | nodeGetName (string &sNode) |
| Get the name of pointed node. | |
| bool | setAttribute (const string &sAttr, const string &sValue) |
| Set an attribute inside pointed node with a string value. | |
| bool | setAttribute (const string &sAttr, const Sint32 &iValue) |
| Set an attribute inside pointed node with an integer value. | |
| bool | setAttribute (const string &sAttr, const float &fValue) |
| Set an attribute inside pointed node with a float value. | |
| bool | getAttribute (const string &sAttr, string &sValue) |
| Get the string value of an attribute inside the pointed node. | |
| bool | getAttribute (const string &sAttr, Sint32 &iValue) |
| Get the integer value of an attribute inside the pointed node. | |
| bool | getAttribute (const string &sAttr, float &fValue) |
| Get the float value of an attribute inside the pointed node. | |
| bool | removeAttribute (const string &sAttr) |
| Remove an attribute and its value inside the pointed node. | |
| bool | setText (const string &sText) |
| Set a text inside the pointed node. | |
| bool | getText (string &sText) |
| Get the text contained in the pointed node. | |
| bool | removeText () |
| Remove the text inside the pointed node. | |
| bool | setComment (const string &sComment) |
| Set a comment text inside the pointed node. | |
| bool | getComment (string &sComment) |
| Get the comment text contained in the pointed node. | |
| bool | removeComment () |
| Remove the comment text inside the pointed node. | |
| Sint32 | saveToFile (const string &sFile) |
| Export the XML to an external file. | |
| Sint32 | save (const string &sCDCFile, const string &sResourceName="") |
| Save the XML into a CDC file. | |
| Sint32 | save (const Sint32 idCDC, const string &sResourceName="") |
| Save the XML in to a CDC file. | |
|
override |
Request XML object information.
Writes information to the default log.
| iMode | unused for the time being. |
|
override |
Get the name.
|
override |
Get the ID.
| bool CRM64Pro::XML::nodePointTo | ( | Sint32 | iParam, |
| char * | szNodes, | ||
| ... ) |
Point to a node using a va_list of node names.
| iParam | number of arguments. |
| szNodes | variable arguments list of strings (char*) with the node names. |
| bool CRM64Pro::XML::nodeFirst | ( | ) |
Point to the first XML node (the root node).
| bool CRM64Pro::XML::nodeNext | ( | ) |
Point to the next node (from current pointed node).
| bool CRM64Pro::XML::nodePrev | ( | ) |
Point to the previous node (from current pointed node).
| bool CRM64Pro::XML::nodeParent | ( | ) |
Point to the parent node (from current pointed node).
| bool CRM64Pro::XML::nodeChild | ( | ) |
Point to the first child node (from current pointed node).
| bool CRM64Pro::XML::nodeStore | ( | ) |
Store node pointer position.
Each XML has a single slot, so it keeps only the most recently stored position.
| bool CRM64Pro::XML::nodeRestore | ( | ) |
Restore node pointer position.
Each XML has a single slot, so it restores the position saved by the last nodeStore() call.
| bool CRM64Pro::XML::nodeRemove | ( | ) |
Remove pointed node and all its subnodes and attributes.
| bool CRM64Pro::XML::nodeCreate | ( | const string & | sNode | ) |
Create a new node inside the pointed node and point to it.
| sNode | string containing the node name. |
| bool CRM64Pro::XML::nodeRename | ( | const string & | sNode | ) |
Rename pointed node.
| sNode | string containing the node name. |
| bool CRM64Pro::XML::nodeGetName | ( | string & | sNode | ) |
Get the name of pointed node.
| sNode | a string variable. Will not be modified when there is not a valid pointed node. |
| bool CRM64Pro::XML::setAttribute | ( | const string & | sAttr, |
| const string & | sValue ) |
Set an attribute inside pointed node with a string value.
If the attribute does not exist, it will be created.
| sAttr | attribute name string. |
| sValue | string value. |
| bool CRM64Pro::XML::setAttribute | ( | const string & | sAttr, |
| const Sint32 & | iValue ) |
Set an attribute inside pointed node with an integer value.
If the attribute does not exist, it will be created.
| sAttr | attribute name string. |
| iValue | integer value. |
| bool CRM64Pro::XML::setAttribute | ( | const string & | sAttr, |
| const float & | fValue ) |
Set an attribute inside pointed node with a float value.
If the attribute does not exist, it will be created.
| sAttr | attribute name string. |
| fValue | float value. |
| bool CRM64Pro::XML::getAttribute | ( | const string & | sAttr, |
| string & | sValue ) |
Get the string value of an attribute inside the pointed node.
| sAttr | attribute name string. |
| sValue | a string variable. Not modified if the attribute does not exist. |
| bool CRM64Pro::XML::getAttribute | ( | const string & | sAttr, |
| Sint32 & | iValue ) |
Get the integer value of an attribute inside the pointed node.
| sAttr | attribute name string. |
| iValue | an integer variable. Not modified if the attribute does not exist. |
| bool CRM64Pro::XML::getAttribute | ( | const string & | sAttr, |
| float & | fValue ) |
Get the float value of an attribute inside the pointed node.
| sAttr | attribute name string. |
| fValue | a float variable. Not modified if the attribute does not exist. |
| bool CRM64Pro::XML::removeAttribute | ( | const string & | sAttr | ) |
Remove an attribute and its value inside the pointed node.
| sAttr | attribute name string. |
| bool CRM64Pro::XML::setText | ( | const string & | sText | ) |
Set a text inside the pointed node.
If there is not any text, it will be created. Otherwise, the text will be appended to the exiting one.
| sText | text string. |
| bool CRM64Pro::XML::getText | ( | string & | sText | ) |
Get the text contained in the pointed node.
| sText | a string variable. Not modified if no text exists. |
| bool CRM64Pro::XML::removeText | ( | ) |
Remove the text inside the pointed node.
| bool CRM64Pro::XML::setComment | ( | const string & | sComment | ) |
Set a comment text inside the pointed node.
If a comment already exists, it will be pushed down and the new comment will be the first one.
| sComment | comment text string. |
| bool CRM64Pro::XML::getComment | ( | string & | sComment | ) |
Get the comment text contained in the pointed node.
| sComment | a string variable. Not modified if no comment exists. |
| bool CRM64Pro::XML::removeComment | ( | ) |
Remove the comment text inside the pointed node.
| Sint32 CRM64Pro::XML::saveToFile | ( | const string & | sFile | ) |
Export the XML to an external file.
| sFile | string containing [directory]+filename+[extension]. Ideally should have the .xml extension. If the file exists, it will be overwritten. Directory separators '\' and '/' are supported. |
| Sint32 CRM64Pro::XML::save | ( | const string & | sCDCFile, |
| const string & | sResourceName = "" ) |
Save the XML into a CDC file.
If the XML already exists on the CDC, it will be overwritten.
| sCDCFile | string containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported. |
| sResourceName | Optional resource name to use in the CDC. If empty (default), uses the XML object's internal name. |
| Sint32 CRM64Pro::XML::save | ( | const Sint32 | idCDC, |
| const string & | sResourceName = "" ) |