CopperSpice API
1.9.2
|
The QScriptClassPropertyIterator class provides an iterator interface for custom CsScript objects. More...
Public Methods | |
virtual | ~QScriptClassPropertyIterator () |
virtual QScriptValue::PropertyFlags | flags () const |
virtual bool | hasNext () const = 0 |
virtual bool | hasPrevious () const = 0 |
virtual uint | id () const |
virtual QScriptString | name () const = 0 |
virtual void | next () = 0 |
QScriptValue | object () const |
virtual void | previous () = 0 |
virtual void | toBack () = 0 |
virtual void | toFront () = 0 |
Protected Methods | |
QScriptClassPropertyIterator (const QScriptValue &object) | |
The QScriptClassPropertyIterator class provides an iterator interface for custom CsScript objects.
This class is only relevant if you have subclassed QScriptClass and want to provide enumeration of your custom properties (e.g. when objects of your class are used with QScriptValueIterator, or with the for-in statement in scripts).
The object() function returns the CsScript object the iterator is traversing.
The functions toFront(), hasNext() and next() provide forward iteration. The functions toBack(), hasPrevious() and previous() provide backward iteration.
The functions name(), id() and flags() return information about the last property that was jumped over using next() or previous().
|
virtual |
Destroys the iterator.
|
protected |
Constructs an iterator for traversing object.
Subclasses should ensure that the iterator is set to the front of the sequence of properties (before the first property).
|
virtual |
Returns the flags of the last property that was jumped over using next() or previous().
The default implementation calls the propertyFlags() function of object() with argument name().
|
pure virtual |
Returns true if there is at least one item ahead of the iterator (i.e. the iterator is not at the back of the property sequence), otherwise returns false.
|
pure virtual |
Returns true if there is at least one item behind the iterator (i.e. the iterator is not at the front of the property sequence), otherwise returns false.
|
virtual |
Returns the id of the last property that was jumped over using next() or previous(). The default implementation returns 0.
|
pure virtual |
Returns the name of the last property that was jumped over using next() or previous().
|
pure virtual |
Advances the iterator by one position. Calling this function on an iterator located at the back of the container leads to undefined behavior.
QScriptValue QScriptClassPropertyIterator::object | ( | ) | const |
Returns the CsScript object this iterator is traversing.
|
pure virtual |
Moves the iterator back by one position. Calling this method on an iterator located at the front of the container leads to undefined behavior.
|
pure virtual |
Moves the iterator to the back of the QScriptValue after the last property.
|
pure virtual |
Moves the iterator to the front of the QScriptValue before the first property.