#include <skElementObject.h>
Inheritance diagram for skElementObject:
Public Member Functions | |
skElementObject () | |
Default Constructor. | |
skElementObject (const skString &location, skElement *elem, bool created) | |
Constructor which takes an Element. | |
virtual | ~skElementObject () |
Destructor. | |
int | executableType () const |
Returns ELEMENT_TYPE indicating the element is an ElementObject. | |
int | intValue () const |
float | floatValue () const |
bool | boolValue () const |
Char | charValue () const |
skString | strValue () const |
virtual bool | setValue (const skString &name, const skString &attribute, const skRValue &return_value) |
sets the value of an item in the element. | |
virtual bool | setValueAt (const skRValue &array_index, const skString &attribute, const skRValue &value) |
Sets a value within the nth element of the element. | |
virtual bool | getValue (const skString &name, const skString &attribute, skRValue &value) |
Retrieves a field from the . | |
virtual bool | getValueAt (const skRValue &array_index, const skString &attribute, skRValue &value) |
Retrieves the nth value from within the element. | |
virtual bool | method (const skString &name, skRValueArray &args, skRValue &ret, skExecutableContext &ctxt) |
this method attempts to execute a method stored in the . | |
bool | equals (const skiExecutable *o) const |
tests for equality with another object, using a deep comparison if the other object is an ElementObject, otherwise comparing string values | |
void | copyItemsInto (skElement *other) |
Clears the other element and does a deep copy of the children of this node into that one. | |
virtual void | setAddIfNotPresent (bool enable) |
sets the flag controlling whether new elements are created as they are accessed | |
virtual bool | getAddIfNotPresent () |
this returns the value of the flag controlling whether new elements are created as they are accessed | |
skElement * | getElement () |
This method returns the Element being held by the object. | |
const skElement * | getElement () const |
This method returns the Element being held by the object. | |
void | setAttribute (skString name, const skString &value) |
Sets an attribute on this node. | |
skString | getAttribute (const skString &name) const |
This method returns the value of an attribute attached to this element. | |
skString | getLocation () const |
This function returns the location associated with this object (typically a file name). | |
void | setLocation (const skString &location) |
This function sets the location associated with this object (typically a file name). | |
skExecutableIterator * | createIterator (const skString &qualifier) |
This function returns an skExecutableIterator object which is used in the for each statement. | |
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. | |
virtual void | getAttributes (skRValueTable &table) |
This method returns the attributes for this object. | |
virtual void | setElement (const skString &location, skElement *element, bool created=false) |
This method updates the associated element and clears the parse tree cache. | |
virtual skElementObject * | createElementObject (const skString &location, skElement *element, bool created) |
This method creates a new Element object to wrap an element. | |
Static Public Member Functions | |
skString | getData (skElement *element) |
retrieves the text data from an element | |
void | setData (skElement *element, const skString &data) |
sets the text data for a node by looking for the first CDATA and TEXT child node | |
skElement * | findChild (skElement *parent, const skString &tagname) |
returns a child element | |
skElement * | findChild (skElement *parent, int index) |
returns the nth child element | |
skElement * | findChild (skElement *parent, const skString &tagname, const skString &attribute, const skString &value) |
returns a child element with the given attribute set to the given value | |
int | countChildren (skElement *parent) |
this method returns the number of element children of the given element |
The methods getValue, setValue and method all search for matching element tags within the document. Only the first matching tag is used. The class uses the Simkin XML DOM classes.
The class supports the following fields:
|
Constructor which takes an Element.
|
|
Reimplemented from skExecutable. |
|
Reimplemented from skExecutable. |
|
Clears the other element and does a deep copy of the children of this node into that one.
|
|
This method creates a new Element object to wrap an element. Override this for special behaviour in derived classes. In this method, the newly created object inherits this object's m_AddIfNotPresent flag
|
|
This function returns an skExecutableIterator object which is used in the for each statement. It will iterate over *all* children of this element
Reimplemented from skExecutable. |
|
This function returns an skExecutableIterator object which is used in the for each statement. It will iterate over elements with the given tag.
Reimplemented from skExecutable. |
|
tests for equality with another object, using a deep comparison if the other object is an ElementObject, otherwise comparing string values
Reimplemented from skExecutable. |
|
Returns ELEMENT_TYPE indicating the element is an ElementObject.
Reimplemented from skExecutable. |
|
returns a child element with the given attribute set to the given value
|
|
returns the nth child element
|
|
returns a child element
|
|
Reimplemented from skExecutable. |
|
this returns the value of the flag controlling whether new elements are created as they are accessed
|
|
This method returns the value of an attribute attached to this element.
|
|
This method returns the attributes for this object.
Reimplemented from skExecutable. |
|
retrieves the text data from an element
|
|
This method returns the Element being held by the object.
|
|
This method returns the Element being held by the object.
|
|
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 field from the . The first sub-element matching the tag is found. The value returned is an ElementObject, unless the attrib value is specified. It also supports the following built-in field: "nodename" - returns the tag name of this element 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 element. If the array index falls within the range of the number of children of this element, a new ElementObject encapsulating the child is returned. If the m_AddIfNotPresent flag is true, a new item with the tag name "array_item" will be added if one is not already present
Reimplemented from skExecutable. |
|
Reimplemented from skExecutable. |
|
this method attempts to execute a method stored in the . It searches for an element whose tag matches the method name and if found passes the text for the tag through to the interpeter. The method also supports the following methods to Simkin scripts:
Reimplemented from skExecutable. |
|
sets the flag controlling whether new elements are created as they are accessed
|
|
sets the text data for a node by looking for the first CDATA and TEXT child node
|
|
This method updates the associated element and clears the parse tree cache.
|
|
sets the value of an item in the element. The first sub-element matching the tag is found. If the value passed is an element, it is first copied. 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 element of the element. If the m_AddIfNotPresent flag is true, a new item with the tag name "array_item" will be added if one is not already present.
Reimplemented from skExecutable. |
|
Reimplemented from skExecutable. |