#include <skTreeNode.h>
Inheritance diagram for skTreeNode:
Public Member Functions | |
skTreeNode () | |
Default Constructor - blank label, data and an empty children list. | |
skTreeNode (const skString &label) | |
Constructor - creates a treenode with the given label. | |
skTreeNode (const skString &label, const skString &data) | |
Constructor - creates a treenode with the given label and data. | |
IMPORT_C | skTreeNode (const skString &label, bool data) |
Constructor - creates a treenode with the given label and data (converted to a string form). | |
IMPORT_C | skTreeNode (const skString &label, int data) |
Constructor - creates a treenode with the given label and data (converted to a string form). | |
IMPORT_C | skTreeNode (const skString &label, float data) |
Constructor - creates a treenode with the given label and data (converted to a string form). | |
virtual | ~skTreeNode () |
Destructor. | |
IMPORT_C skTreeNode & | operator= (const skTreeNode &) |
Assignment operator - does a deep copy. | |
IMPORT_C bool | operator== (const skTreeNode &other) const |
Does a deep comparison against another node, without checking the label of this node. | |
IMPORT_C bool | deepCompare (const skTreeNode &other, bool check_tagname) const |
Does a deep compare another node, with an optional check on the label. | |
skString | label () const |
Returns this node's label. | |
void | label (const skString &s) |
Changes this node's label. | |
void | label (const Char *s) |
Changes this node's label. | |
skString | data () const |
Returns this node's data. | |
void | data (const skString &s) |
Changes this node's data. | |
void | data (const Char *s) |
Changes this node's data. | |
IMPORT_C bool | boolData () const |
Returns this node's data as a boolean value. | |
IMPORT_C void | boolData (bool) |
Changes this node's data - converting the value to a string. | |
IMPORT_C int | intData () const |
Returns this node's data as an integer value. | |
IMPORT_C void | intData (int) |
Changes this node's data - converting the value to a string. | |
IMPORT_C float | floatData () const |
Returns this node's data as a float value. | |
IMPORT_C void | floatData (float) |
Changes this node's data - converting the value to a string. | |
IMPORT_C void | prependChild (skTreeNode *) |
adds the given node to the start of the child list for this node | |
IMPORT_C void | addChild (skTreeNode *) |
adds the given node to the end of the child list for this node | |
IMPORT_C void | setChild (skTreeNode *) |
Assigns the given node to the first node with the matching label in the child list of this node. | |
IMPORT_C void | removeChild (skTreeNode *) |
removes the given node from the list of children at this node | |
IMPORT_C void | deleteChild (skTreeNode *) |
deletes the given node from the list of children at this node | |
IMPORT_C bool | containsChild (skTreeNode *) |
Returns true if the child list of this node contains the given node. | |
IMPORT_C skTreeNode * | findChild (const skString &label) const |
This method searches for a node whose label matches the one given. | |
IMPORT_C skTreeNode * | findChild (const TDesC &label) const |
This method searches for a node whose label matches the one given. | |
IMPORT_C skTreeNode * | findChild (const skString &label, const skString &data) const |
This method searches for a node whose label and data matches the ones given. | |
IMPORT_C skString | findChildData (const skString &label) const |
Finds the data associated with the first child whose label matches that given. | |
IMPORT_C skString | findChildData (const skString &label, const skString &defaultVal) const |
Finds the data associated with the first child whose label matches that given. | |
IMPORT_C skString | findChildData (const TDesC &label) const |
Finds the data associated with the first child whose label matches that given. | |
IMPORT_C bool | findChildboolData (const skString &label, bool defaultVal=false) const |
Finds the data associated with the first child whose label matches that given as a boolean. | |
IMPORT_C int | findChildIntData (const skString &label, int defaultVal=0) const |
Finds the data associated with the first child whose label matches that given as an integer. | |
IMPORT_C int | findChildIntData (const TDesC &label, int defaultVal=0) const |
Finds the data associated with the first child whose label matches that given as an integer. | |
IMPORT_C float | findChildFloatData (const skString &label, float defaultVal=0.0f) const |
Finds the data associated with the first child whose label matches that given as a float. | |
IMPORT_C skString | nthChildData (USize index) const |
Returns the data for nth child in the list of children at this node. | |
IMPORT_C int | nthChildIntData (USize index) const |
Returns the data for nth child in the list of children at this node as an integer. | |
IMPORT_C void | write (skOutputDestination &out, USize tabstops, bool include_tabs=true) const |
Writes this node to an output destination with the given indentation. | |
IMPORT_C bool | write (const skString &file) const |
Writes this node out to a file. | |
IMPORT_C skTreeNode * | nthChild (USize i) const |
Returns a child from the list at this node. | |
IMPORT_C USize | numChildren () const |
Returns the number of children at this node. | |
IMPORT_C void | copyItems (skTreeNode &node) |
makes a deep copy of the items from the other node, but does not change the label or data of this node | |
IMPORT_C void | moveItemsFrom (skTreeNode &node) |
Moves the items from the child list of the given node into this node. | |
IMPORT_C void | clear () |
deletes all children from the list | |
Static Public Member Functions | |
IMPORT_C skTreeNode * | read (const skString &file, skExecutableContext &ctxt) |
Reads a treenode from the given file. |
The node has a label, a piece of data and a list of subitems
The label and data are both stored as strings. TreeNodes can be used to conveniently store hierchically ordered trees of textual data.
|
adds the given node to the end of the child list for this node
|
|
Changes this node's data - converting the value to a string.
|
|
This method searches for a node whose label and data matches the ones given.
|
|
This method searches for a node whose label matches the one given.
|
|
This method searches for a node whose label matches the one given.
|
|
Finds the data associated with the first child whose label matches that given as a boolean.
|
|
Finds the data associated with the first child whose label matches that given.
|
|
Finds the data associated with the first child whose label matches that given.
|
|
Finds the data associated with the first child whose label matches that given.
|
|
Finds the data associated with the first child whose label matches that given as a float.
|
|
Finds the data associated with the first child whose label matches that given as an integer.
|
|
Finds the data associated with the first child whose label matches that given as an integer.
|
|
Changes this node's data - converting the value to a string.
|
|
Changes this node's data - converting the value to a string.
|
|
Returns a child from the list at this node.
|
|
Assignment operator - does a deep copy.
|
|
adds the given node to the start of the child list for this node
|
|
Reads a treenode from the given file.
|
|
Assigns the given node to the first node with the matching label in the child list of this node. If no match is found, the node is added to the end of the list
|
|
Writes this node out to a file.
|
|
Writes this node to an output destination with the given indentation.
|