#include <skElementObject.h>
Inheritance diagram for skElementObject:
Public Member Functions | |
IMPORT_C | skElementObject () |
Default Constructor. | |
IMPORT_C | skElementObject (const skString &location, skElement *elem, bool created) |
Constructor which takes an Element. | |
virtual IMPORT_C | ~skElementObject () |
Destructor. | |
IMPORT_C int | executableType () const |
Returns ELEMENT_TYPE indicating the element is an ElementObject. | |
IMPORT_C int | intValue () const |
IMPORT_C float | floatValue () const |
IMPORT_C bool | boolValue () const |
IMPORT_C Char | charValue () const |
IMPORT_C skString | strValue () const |
virtual IMPORT_C bool | setValue (const skString &name, const skString &attribute, const skRValue &return_value) |
sets the value of an item in the element. | |
virtual IMPORT_C bool | setValueAt (const skRValue &array_index, const skString &attribute, const skRValue &value) |
Sets a value within the nth element of the element. | |
virtual IMPORT_C bool | getValue (const skString &name, const skString &attribute, skRValue &value) |
Retrieves a field from the . | |
virtual IMPORT_C bool | getValueAt (const skRValue &array_index, const skString &attribute, skRValue &value) |
Retrieves the nth value from within the element. | |
virtual IMPORT_C bool | method (const skString &name, skRValueArray &args, skRValue &ret, skExecutableContext &ctxt) |
this method attempts to execute a method stored in the . | |
IMPORT_C 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 | |
IMPORT_C void | copyItemsInto (skElement *other) |
Clears the other element and does a deep copy of the children of this node into that one. | |
virtual IMPORT_C void | setAddIfNotPresent (bool enable) |
sets the flag controlling whether new elements are created as they are accessed | |
virtual IMPORT_C bool | getAddIfNotPresent () |
this returns the value of the flag controlling whether new elements are created as they are accessed | |
IMPORT_C skElement * | getElement () |
This method returns the Element being held by the object. | |
IMPORT_C const skElement * | getElement () const |
This method returns the Element being held by the object. | |
IMPORT_C void | setAttribute (skString name, const skString &value) |
Sets an attribute on this node. | |
IMPORT_C skString | getAttribute (const skString &name) const |
This method returns the value of an attribute attached to this element. | |
IMPORT_C skString | getAttribute (const TDesC &name) const |
This method returns the value of an attribute attached to this element. | |
IMPORT_C skString | getLocation () const |
This function returns the location associated with this object (typically a file name). | |
IMPORT_C void | setLocation (const skString &location) |
This function sets the location associated with this object (typically a file name). | |
IMPORT_C skExecutableIterator * | createIterator (const skString &qualifier) |
This function returns an skExecutableIterator object which is used in the for each statement. | |
IMPORT_C skExecutableIterator * | createIterator () |
This function returns an skExecutableIterator object which is used in the for each statement. | |
virtual IMPORT_C skString | getSource (const skString &location) |
Returns the source code for the given method. | |
virtual IMPORT_C void | getInstanceVariables (skRValueTable &table) |
This method returns the instance variables for this object. | |
virtual IMPORT_C void | getAttributes (skRValueTable &table) |
This method returns the attributes for this object. | |
virtual IMPORT_C void | setElement (const skString &location, skElement *element, bool created=false) |
This method updates the associated element and clears the parse tree cache. | |
IMPORT_C void | setElement (const TDesC &location, skElement *element, bool created=false) |
This method updates the associated element and clears the parse tree cache. | |
virtual IMPORT_C skElementObject * | createElementObject (const skString &location, skElement *element, bool created) |
This method creates a new Element object to wrap an element. | |
Static Public Member Functions | |
IMPORT_C skString | getData (skElement *element) |
retrieves the text data from an element | |
IMPORT_C void | setData (skElement *element, const skString &data) |
sets the text data for a node by looking for the first CDATA and TEXT child node | |
IMPORT_C skElement * | findChild (skElement *parent, const skString &tagname) |
returns a child element | |
IMPORT_C skElement * | findChild (skElement *parent, const TDesC &tagname) |
returns a child element | |
IMPORT_C skElement * | findChild (skElement *parent, int index) |
returns the nth child element | |
IMPORT_C 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 | |
IMPORT_C skElement * | findChild (skElement *parent, const TDesC &tagname, const TDesC &attribute, const skString &value) |
returns a child element with the given attribute set to the given value | |
IMPORT_C 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 a child element with the given attribute set to the given value
|
|
returns the nth child element
|
|
returns a 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 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.
|
|
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. |