35 #include "PropertyNameArray.h" 37 #include "JSFunction.h" 119 JSC::PropertyNameArray propertyNamesArray(exec);
120 JSC::asObject(
object()->jscValue)->getOwnPropertyNames(exec, propertyNamesArray, JSC::IncludeDontEnumProperties);
122 JSC::PropertyNameArray::const_iterator propertyNamesIt = propertyNamesArray.begin();
123 for(; propertyNamesIt != propertyNamesArray.end(); ++propertyNamesIt) {
145 if (
object.isObject()) {
168 if (!
d || !
d->engine())
172 return d->it !=
d->propertyNames.end();
188 d->ensureInitialized();
204 if (!
d || !
d->engine())
208 return d->it !=
d->propertyNames.begin();
224 d->ensureInitialized();
240 d->ensureInitialized();
241 d->it =
d->propertyNames.begin();
255 d->ensureInitialized();
256 d->it =
d->propertyNames.end();
268 if (!
d || !
d->initialized || !
d->engine())
270 return d->current->ustring();
285 if (!
d || !
d->initialized || !
d->engine())
287 return d->engine()->toStringHandle(*
d->current);
299 if (!
d || !
d->initialized || !
d->engine())
302 JSC::JSValue jsValue =
d->object()->property(*
d->current);
303 return d->engine()->scriptValueFromJSCValue(jsValue);
315 if (!
d || !
d->initialized || !
d->engine())
318 JSC::JSValue jsValue =
d->engine()->scriptValueToJSCValue(value);
319 d->object()->setProperty(*
d->current, jsValue);
331 if (!
d || !
d->initialized || !
d->engine())
334 return d->object()->propertyFlags(*
d->current);
346 if (!
d || !
d->initialized || !
d->engine())
349 d->object()->setProperty(*
d->current, JSC::JSValue());
350 d->propertyNames.erase(
d->current);
361 if (
object.isObject()) {
void clear()
Removes all the items in the list.
JSC::ExecState * globalExec() const
#define QT_END_NAMESPACE
This macro expands to.
static QScriptEnginePrivate * get(QScriptEngine *q)
bool hasPrevious() const
Returns true if there is at least one item behind the iterator (i.e.
void previous()
Moves the iterator back by one position.
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
static QScriptValuePrivate * get(const QScriptValue &q)
QString name() const
Returns the name of the last property that was jumped over using next() or previous().
void toBack()
Moves the iterator to the back of the QScriptValue (after the last property).
void setValue(const QScriptValue &value)
Sets the value of the last property that was jumped over using next() or previous().
void append(const T &)
Inserts value at the end of the list.
QLinkedList< JSC::Identifier >::iterator current
The QString class provides a Unicode character string.
The QScriptString class acts as a handle to "interned" strings in a QScriptEngine.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QScriptEngine * engine() const
Returns the QScriptEngine that created this QScriptValue, or 0 if this QScriptValue is invalid or the...
~QScriptValueIteratorPrivate()
QScriptValueIterator & operator=(QScriptValue &value)
Makes the iterator operate on object.
static void ensureInitialized()
QLinkedList< JSC::Identifier >::iterator it
QScriptEnginePrivate * engine() const
QScriptValueIterator(const QScriptValue &value)
Constructs an iterator for traversing object.
QScopedPointer< QScriptValueIteratorPrivate > d_ptr
void toFront()
Moves the iterator to the front of the QScriptValue (before the first property).
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
QScriptValue::PropertyFlags flags() const
Returns the flags of the last property that was jumped over using next() or previous().
QScriptValueIteratorPrivate()
The QScriptValueIterator class provides a Java-style iterator for QScriptValue.
QScriptValue value() const
Returns the value of the last property that was jumped over using next() or previous().
QLinkedList< JSC::Identifier > propertyNames
~QScriptValueIterator()
Destroys the iterator.
QScriptString scriptName() const
Returns the name of the last property that was jumped over using next() or previous().
The QScriptValue class acts as a container for the Qt Script data types.
void next()
Advances the iterator by one position.
bool hasNext() const
Returns true if there is at least one item ahead of the iterator (i.e.
void remove()
Removes the last property that was jumped over using next() or previous().
QScriptValuePrivate * object() const