Qt 4.8
Public Functions | Public Variables | List of all members
QScriptValueIteratorPrivate Class Reference

Public Functions

QScriptEnginePrivateengine () const
 
void ensureInitialized ()
 
QScriptValuePrivateobject () const
 
 QScriptValueIteratorPrivate ()
 
 ~QScriptValueIteratorPrivate ()
 

Public Variables

QLinkedList< JSC::Identifier >::iterator current
 
bool initialized
 
QLinkedList< JSC::Identifier >::iterator it
 
QScriptValue objectValue
 
QLinkedList< JSC::Identifier > propertyNames
 

Detailed Description

Definition at line 84 of file qscriptvalueiterator.cpp.

Constructors and Destructors

◆ QScriptValueIteratorPrivate()

QScriptValueIteratorPrivate::QScriptValueIteratorPrivate ( )
inline

Definition at line 87 of file qscriptvalueiterator.cpp.

◆ ~QScriptValueIteratorPrivate()

QScriptValueIteratorPrivate::~QScriptValueIteratorPrivate ( )
inline

Definition at line 91 of file qscriptvalueiterator.cpp.

92  {
93  if (!initialized)
94  return;
95  QScriptEnginePrivate *eng_p = engine();
96  if (!eng_p)
97  return;
98  QScript::APIShim shim(eng_p);
99  propertyNames.clear(); //destroying the identifiers need to be done under the APIShim guard
100  }
void clear()
Removes all the items in the list.
Definition: qlinkedlist.h:311
QScriptEnginePrivate * engine() const
QLinkedList< JSC::Identifier > propertyNames

Functions

◆ engine()

QScriptEnginePrivate* QScriptValueIteratorPrivate::engine ( ) const
inline

Definition at line 107 of file qscriptvalueiterator.cpp.

Referenced by ensureInitialized(), and ~QScriptValueIteratorPrivate().

108  {
110  }
static QScriptEnginePrivate * get(QScriptEngine *q)
QScriptEngine * engine() const
Returns the QScriptEngine that created this QScriptValue, or 0 if this QScriptValue is invalid or the...

◆ ensureInitialized()

void QScriptValueIteratorPrivate::ensureInitialized ( )
inline

Definition at line 112 of file qscriptvalueiterator.cpp.

113  {
114  if (initialized)
115  return;
116  QScriptEnginePrivate *eng_p = engine();
117  QScript::APIShim shim(eng_p);
118  JSC::ExecState *exec = eng_p->globalExec();
119  JSC::PropertyNameArray propertyNamesArray(exec);
120  JSC::asObject(object()->jscValue)->getOwnPropertyNames(exec, propertyNamesArray, JSC::IncludeDontEnumProperties);
121 
122  JSC::PropertyNameArray::const_iterator propertyNamesIt = propertyNamesArray.begin();
123  for(; propertyNamesIt != propertyNamesArray.end(); ++propertyNamesIt) {
124  propertyNames.append(*propertyNamesIt);
125  }
126  it = propertyNames.begin();
127  initialized = true;
128  }
JSC::ExecState * globalExec() const
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlinkedlist.h:182
void append(const T &)
Inserts value at the end of the list.
Definition: qlinkedlist.h:350
QLinkedList< JSC::Identifier >::iterator it
QScriptEnginePrivate * engine() const
QLinkedList< JSC::Identifier > propertyNames

◆ object()

QScriptValuePrivate* QScriptValueIteratorPrivate::object ( ) const
inline

Definition at line 102 of file qscriptvalueiterator.cpp.

103  {
105  }
static QScriptValuePrivate * get(const QScriptValue &q)

Properties

◆ current

QLinkedList<JSC::Identifier>::iterator QScriptValueIteratorPrivate::current

Definition at line 133 of file qscriptvalueiterator.cpp.

◆ initialized

bool QScriptValueIteratorPrivate::initialized

Definition at line 134 of file qscriptvalueiterator.cpp.

Referenced by ensureInitialized(), and ~QScriptValueIteratorPrivate().

◆ it

QLinkedList<JSC::Identifier>::iterator QScriptValueIteratorPrivate::it

Definition at line 132 of file qscriptvalueiterator.cpp.

Referenced by ensureInitialized().

◆ objectValue

QScriptValue QScriptValueIteratorPrivate::objectValue

◆ propertyNames

QLinkedList<JSC::Identifier> QScriptValueIteratorPrivate::propertyNames

Definition at line 131 of file qscriptvalueiterator.cpp.

Referenced by ensureInitialized(), and ~QScriptValueIteratorPrivate().


The documentation for this class was generated from the following file: