#include <skTreeNodeObject.h>
Inheritance diagram for skTreeNodeObject:
Public Member Functions | |
skTreeNodeObject () | |
Default Constructor. | |
skTreeNodeObject (const skString &location, skTreeNode *node, bool created) | |
Constructor providing a treenode. | |
virtual | ~skTreeNodeObject () |
Destructor - will delete the associated node if the created flag is set. | |
virtual int | executableType () const |
returns the value TREENODE_TYPE to identify this as a TreeNodeObject | |
virtual int | intValue () const |
Returns the data field of the node as an integer. | |
virtual float | floatValue () const |
Returns the data field of the node as a float. | |
virtual bool | boolValue () const |
Returns the data field of the node as a boolean. | |
virtual Char | charValue () const |
Returns the first character of the data field of the node. | |
virtual skString | strValue () const |
Returns the data field of the node as a string. | |
virtual bool | setValue (const skString &name, const skString &attribute, const skRValue &value) |
Sets a value within the node. | |
virtual bool | setValueAt (const skRValue &array_index, const skString &attribute, const skRValue &value) |
Sets a value within the nth node of the tree node. | |
virtual bool | getValue (const skString &name, const skString &attribute, skRValue &v) |
Retrieves a value from within the node. | |
virtual bool | getValueAt (const skRValue &array_index, const skString &attribute, skRValue &value) |
Retrieves the nth value from within the node. | |
virtual bool | method (const skString &name, skRValueArray &args, skRValue &ret, skExecutableContext &ctxt) |
This function attempts to call a method defined within the TreeNode. | |
skTreeNode * | getNode () |
This function returns the treenode wrapped by this object. | |
void | setNode (const skString &location, skTreeNode *node, bool created) |
This function changes the node associated with this object. | |
virtual bool | equals (const skiExecutable *o) const |
This function tests if this object is equal to the other object. | |
skString | getLocation () const |
This function returns the location associated with this object (typically a file name). | |
virtual skExecutableIterator * | createIterator (const skString &qualifier) |
This function returns an skExecutableIterator object which is used in the for each statement. | |
virtual skExecutableIterator * | createIterator () |
This function returns an skExecutableIterator object which is used in the for each statement. | |
virtual skString | getSource (const skString &location) |
Returns the source code for the given method. | |
virtual void | getInstanceVariables (skRValueTable &table) |
This method returns the instance variables for this object. | |
void | setAddIfNotPresent (bool enable) |
sets the flag controlling whether new nodes are created as they are accessed | |
bool | getAddIfNotPresent () |
this returns the value of the flag controlling whether new nodes are created as they are accessed | |
Protected Member Functions | |
virtual skTreeNodeObject * | createTreeNodeObject (const skString &location, skTreeNode *node, bool created) |
This method creates a new TreeNode object to wrap a node. | |
Protected Attributes | |
skString | m_Location |
the location the node came from | |
Friends | |
class | skTreeNodeObjectEnumerator |
The methods getValue, setValue and method all search for matching child labels within the TreeNode document. Only the first matching label is used.
The class supports the following fields:
|
Constructor providing a treenode.
|
|
This function returns an skExecutableIterator object which is used in the for each statement. It will iterate over *all* children of this node
Reimplemented from skExecutable. |
|
This function returns an skExecutableIterator object which is used in the for each statement. It will iterate over nodes with the given node label.
Reimplemented from skExecutable. |
|
This method creates a new TreeNode object to wrap a node. Override this for special behaviour in derived classes. In this method, the newly created object inherits this object's m_AddIfNotPresent flag
|
|
This function tests if this object is equal to the other object. It does this by checking the string values are equal Reimplemented from skExecutable. |
|
this returns the value of the flag controlling whether new nodes are created as they are accessed
|
|
This method returns the instance variables for this object.
Reimplemented from skExecutable. |
|
Returns the source code for the given method.
Reimplemented from skExecutable. |
|
Retrieves a value from within the node. The field name is matched to a child of the treenode with the same label. If a match is found, a new TreeNodeObject encapsulating the child is returned. If the m_AddIfNotPresent flag is true, a new item will be added if one is not already present
Reimplemented from skExecutable. |
|
Retrieves the nth value from within the node. If the array index falls within the range of the number of children of this node, a new TreeNodeObject encapsulating the child is returned. If the m_AddIfNotPresent flag is true, a new item will be added if one is not already present.
Reimplemented from skExecutable. |
|
This function attempts to call a method defined within the TreeNode. It searches for a child whose label matches the method name, and tries to execute its data as a Simkin script
Reimplemented from skExecutable. |
|
sets the flag controlling whether new nodes are created as they are accessed
|
|
Sets a value within the node. The field name is matched to a child of the treenode with the same label. If a match is found, the child's data is changed. If the m_AddIfNotPresent flag is true, a new item will be added if one is not already present
Reimplemented from skExecutable. |
|
Sets a value within the nth node of the tree node. If the m_AddIfNotPresent flag is true, a new item will be added if one is not already present.
Reimplemented from skExecutable. |