| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. |
| 4 | ** Contact: http://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtScript module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/ |
| 41 | #include "qscriptvalueiterator.h"cxx . . $ `<file>/src/script/api/qscriptvalueiterator.h`/ |
| 42 | |
| 43 | #include "qscriptstring.h"cxx . . $ `<file>/src/script/api/qscriptstring.h`/ |
| 44 | #include "qscriptengine.h"cxx . . $ `<file>/src/script/api/qscriptengine.h`/ |
| 45 | #include "qscriptengine_p.h"cxx . . $ `<file>/src/script/api/qscriptengine_p.h`/ |
| 46 | #include "qscriptvalue_p.h"cxx . . $ `<file>/src/script/api/qscriptvalue_p.h`/ |
| 47 | |
| 48 | #include "JSObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h`/ |
| 49 | #include "PropertyNameArray.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertyNameArray.h`/ |
| 50 | #include "JSArray.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.h`/ |
| 51 | #include "JSFunction.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.h`/ |
| 52 | |
| 53 | #include <list> |
| 54 | |
| 55 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`! |
| 56 | |
| 57 | /*! |
| 58 | \since 4.3 |
| 59 | \class QScriptValueIterator |
| 60 | \inmodule QtScript |
| 61 | \brief The QScriptValueIterator class provides a Java-style iterator for QScriptValue. |
| 62 | |
| 63 | \ingroup script |
| 64 | |
| 65 | |
| 66 | The QScriptValueIterator constructor takes a QScriptValue as |
| 67 | argument. After construction, the iterator is located at the very |
| 68 | beginning of the sequence of properties. Here's how to iterate over |
| 69 | all the properties of a QScriptValue: |
| 70 | |
| 71 | \snippet code/src_script_qscriptvalueiterator.cpp 0 |
| 72 | |
| 73 | The next() advances the iterator. The name(), value() and flags() |
| 74 | functions return the name, value and flags of the last item that was |
| 75 | jumped over. |
| 76 | |
| 77 | If you want to remove properties as you iterate over the |
| 78 | QScriptValue, use remove(). If you want to modify the value of a |
| 79 | property, use setValue(). |
| 80 | |
| 81 | Note that QScriptValueIterator only iterates over the QScriptValue's |
| 82 | own properties; i.e. it does not follow the prototype chain. You can |
| 83 | use a loop like this to follow the prototype chain: |
| 84 | |
| 85 | \snippet code/src_script_qscriptvalueiterator.cpp 1 |
| 86 | |
| 87 | Note that QScriptValueIterator will not automatically skip over |
| 88 | properties that have the QScriptValue::SkipInEnumeration flag set; |
| 89 | that flag only affects iteration in script code. If you want, you |
| 90 | can skip over such properties with code like the following: |
| 91 | |
| 92 | \snippet code/src_script_qscriptvalueiterator.cpp 2 |
| 93 | |
| 94 | \sa QScriptValue::property() |
| 95 | */ |
| 96 | |
| 97 | class QScriptValueIteratorPrivatecxx . . $ QScriptValueIteratorPrivate# |
| 98 | { |
| 99 | public: |
| 100 | QScriptValueIteratorPrivatecxx . . $ QScriptValueIteratorPrivate#QScriptValueIteratorPrivate(49f6e7a06ebc5aa8).() |
| 101 | : initializedcxx . . $ QScriptValueIteratorPrivate#initialized.(false) |
| 102 | {} |
| 103 | |
| 104 | ~cxx . . $ QScriptValueIteratorPrivate#`~QScriptValueIteratorPrivate`(49f6e7a06ebc5aa8).QScriptValueIteratorPrivatecxx . . $ QScriptValueIteratorPrivate#() |
| 105 | { |
| 106 | if (!initializedcxx . . $ QScriptValueIteratorPrivate#initialized.) |
| 107 | return; |
| 108 | QScriptEnginePrivatecxx . . $ QScriptEnginePrivate# *eng_p = enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).(); |
| 109 | if (!eng_p) |
| 110 | return; |
| 111 | QScriptcxx . . $ QScript/::APIShimcxx . . $ QScript/APIShim# shimcxx . . $ QScript/APIShim#APIShim(db35ed4eaf341aaa).(eng_p); |
| 112 | propertyNames.clear(); //destroying the identifiers need to be done under the APIShim guard |
| 113 | } |
| 114 | |
| 115 | QScriptValuePrivatecxx . . $ QScriptValuePrivate# *objectcxx . . $ QScriptValueIteratorPrivate#object(8f18e04bb4378a65).() const |
| 116 | { |
| 117 | return QScriptValuePrivatecxx . . $ QScriptValuePrivate#::getcxx . . $ QScriptValuePrivate#get(3358d3d0bd9c30a4).(objectValue); |
| 118 | } |
| 119 | |
| 120 | QScriptEnginePrivatecxx . . $ QScriptEnginePrivate# *enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).() const |
| 121 | { |
| 122 | return QScriptEnginePrivatecxx . . $ QScriptEnginePrivate#::getcxx . . $ QScriptEnginePrivate#get(5daed66f1078208d).(objectValue.engine()); |
| 123 | } |
| 124 | |
| 125 | void ensureInitializedcxx . . $ QScriptValueIteratorPrivate#ensureInitialized(49f6e7a06ebc5aa8).() |
| 126 | { |
| 127 | if (initializedcxx . . $ QScriptValueIteratorPrivate#initialized.) |
| 128 | return; |
| 129 | QScriptEnginePrivatecxx . . $ QScriptEnginePrivate# *eng_p = enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).(); |
| 130 | QScriptcxx . . $ QScript/::APIShimcxx . . $ QScript/APIShim# shimcxx . . $ QScript/APIShim#APIShim(db35ed4eaf341aaa).(eng_p); |
| 131 | JSCcxx . . $ `<built-in>:463:9`!::ExecStatecxx . . $ QTJSC/ExecState# *exec = eng_p->globalExeccxx . . $ QScriptEnginePrivate#globalExec(5952b97f5bc87321).(); |
| 132 | JSCcxx . . $ `<built-in>:463:9`!::PropertyNameArraycxx . . $ QTJSC/PropertyNameArray# propertyNamesArraycxx . . $ QTJSC/PropertyNameArray#PropertyNameArray(d2cb180e190a9680).(exec); |
| 133 | JSCcxx . . $ `<built-in>:463:9`!::asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(objectcxx . . $ QScriptValueIteratorPrivate#object(8f18e04bb4378a65).()->jscValuecxx . . $ QScriptValuePrivate#jscValue.)->getOwnPropertyNamescxx . . $ QTJSC/JSObject#getOwnPropertyNames(2f9e3f18de200b4e).(exec, propertyNamesArray, JSCcxx . . $ `<built-in>:463:9`!::IncludeDontEnumPropertiescxx . . $ QTJSC/IncludeDontEnumProperties.); |
| 134 | |
| 135 | JSCcxx . . $ `<built-in>:463:9`!::PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#::const_iteratorcxx . . $ QTJSC/PropertyNameArray#const_iterator# propertyNamesIt = propertyNamesArray.begincxx . . $ QTJSC/PropertyNameArray#begin(455f465bc33b4cdf).(); |
| 136 | for(; propertyNamesIt != propertyNamesArray.endcxx . . $ QTJSC/PropertyNameArray#end(455f465bc33b4cdf).(); ++propertyNamesIt) { |
| 137 | propertyNames.push_back(*propertyNamesIt); |
| 138 | } |
| 139 | it = propertyNames.begin(); |
| 140 | initializedcxx . . $ QScriptValueIteratorPrivate#initialized. = true; |
| 141 | } |
| 142 | |
| 143 | QScriptValuecxx . . $ QScriptValue# objectValuecxx . . $ QScriptValueIteratorPrivate#objectValue.; |
| 144 | std::list<JSCcxx . . $ `<built-in>:463:9`!::Identifier> propertyNamescxx . . $ QScriptValueIteratorPrivate#propertyNames.; |
| 145 | std::list<JSCcxx . . $ `<built-in>:463:9`!::Identifier>::iterator itcxx . . $ QScriptValueIteratorPrivate#it.; |
| 146 | std::list<JSCcxx . . $ `<built-in>:463:9`!::Identifier>::iterator currentcxx . . $ QScriptValueIteratorPrivate#current.; |
| 147 | bool initializedcxx . . $ QScriptValueIteratorPrivate#initialized.; |
| 148 | }; |
| 149 | |
| 150 | /*! |
| 151 | Constructs an iterator for traversing \a object. The iterator is |
| 152 | set to be at the front of the sequence of properties (before the |
| 153 | first property). |
| 154 | */ |
| 155 | QScriptValueIteratorcxx . . $ QScriptValueIterator#::QScriptValueIteratorcxx . . $ QScriptValueIterator#QScriptValueIterator(6b35c8bde2804237).(const QScriptValuecxx . . $ QScriptValue# &object) |
| 156 | : d_ptr(0) |
| 157 | { |
| 158 | if (object.isObjectcxx . . $ QScriptValue#isObject(50ce9a9e25b4a850).()) { |
| 159 | d_ptr.reset(new QScriptValueIteratorPrivate()); |
| 160 | d_ptr->objectValue = object; |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | /*! |
| 165 | Destroys the iterator. |
| 166 | */ |
| 167 | QScriptValueIteratorcxx . . $ QScriptValueIterator#::~cxx . . $ QScriptValueIterator#`~QScriptValueIterator`(49f6e7a06ebc5aa8).QScriptValueIteratorcxx . . $ QScriptValueIterator#() |
| 168 | { |
| 169 | } |
| 170 | |
| 171 | /*! |
| 172 | Returns true if there is at least one item ahead of the iterator |
| 173 | (i.e. the iterator is \e not at the back of the property sequence); |
| 174 | otherwise returns false. |
| 175 | |
| 176 | \sa next(), hasPrevious() |
| 177 | */ |
| 178 | bool QScriptValueIteratorcxx . . $ QScriptValueIterator#::hasNextcxx . . $ QScriptValueIterator#hasNext(50ce9a9e25b4a850).() const |
| 179 | { |
| 180 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptValueIterator); |
| 181 | if (!d || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 182 | return false; |
| 183 | |
| 184 | const_cast<QScriptValueIteratorPrivatecxx . . $ QScriptValueIteratorPrivate#*>(d)->ensureInitializedcxx . . $ QScriptValueIteratorPrivate#ensureInitialized(49f6e7a06ebc5aa8).(); |
| 185 | return d->it !=cxx . . $ `operator!=`(99d45ab6e563cfed). d->propertyNames.end(); |
| 186 | } |
| 187 | |
| 188 | /*! |
| 189 | Advances the iterator by one position. |
| 190 | |
| 191 | Calling this function on an iterator located at the back of the |
| 192 | container leads to undefined results. |
| 193 | |
| 194 | \sa hasNext(), previous(), name() |
| 195 | */ |
| 196 | void QScriptValueIteratorcxx . . $ QScriptValueIterator#::nextcxx . . $ QScriptValueIterator#next(49f6e7a06ebc5aa8).() |
| 197 | { |
| 198 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptValueIterator); |
| 199 | if (!d) |
| 200 | return; |
| 201 | d->ensureInitializedcxx . . $ QScriptValueIteratorPrivate#ensureInitialized(49f6e7a06ebc5aa8).(); |
| 202 | |
| 203 | d->current = d->it; |
| 204 | ++(d->it); |
| 205 | } |
| 206 | |
| 207 | /*! |
| 208 | Returns true if there is at least one item behind the iterator |
| 209 | (i.e. the iterator is \e not at the front of the property sequence); |
| 210 | otherwise returns false. |
| 211 | |
| 212 | \sa previous(), hasNext() |
| 213 | */ |
| 214 | bool QScriptValueIteratorcxx . . $ QScriptValueIterator#::hasPreviouscxx . . $ QScriptValueIterator#hasPrevious(50ce9a9e25b4a850).() const |
| 215 | { |
| 216 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptValueIterator); |
| 217 | if (!d || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 218 | return false; |
| 219 | |
| 220 | const_cast<QScriptValueIteratorPrivatecxx . . $ QScriptValueIteratorPrivate#*>(d)->ensureInitializedcxx . . $ QScriptValueIteratorPrivate#ensureInitialized(49f6e7a06ebc5aa8).(); |
| 221 | return d->it !=cxx . . $ `operator!=`(99d45ab6e563cfed). d->propertyNames.begin(); |
| 222 | } |
| 223 | |
| 224 | /*! |
| 225 | Moves the iterator back by one position. |
| 226 | |
| 227 | Calling this function on an iterator located at the front of the |
| 228 | container leads to undefined results. |
| 229 | |
| 230 | \sa hasPrevious(), next(), name() |
| 231 | */ |
| 232 | void QScriptValueIteratorcxx . . $ QScriptValueIterator#::previouscxx . . $ QScriptValueIterator#previous(49f6e7a06ebc5aa8).() |
| 233 | { |
| 234 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptValueIterator); |
| 235 | if (!d) |
| 236 | return; |
| 237 | d->ensureInitializedcxx . . $ QScriptValueIteratorPrivate#ensureInitialized(49f6e7a06ebc5aa8).(); |
| 238 | --(d->it); |
| 239 | d->current = d->it; |
| 240 | } |
| 241 | |
| 242 | /*! |
| 243 | Moves the iterator to the front of the QScriptValue (before the |
| 244 | first property). |
| 245 | |
| 246 | \sa toBack(), next() |
| 247 | */ |
| 248 | void QScriptValueIteratorcxx . . $ QScriptValueIterator#::toFrontcxx . . $ QScriptValueIterator#toFront(49f6e7a06ebc5aa8).() |
| 249 | { |
| 250 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptValueIterator); |
| 251 | if (!d) |
| 252 | return; |
| 253 | d->ensureInitializedcxx . . $ QScriptValueIteratorPrivate#ensureInitialized(49f6e7a06ebc5aa8).(); |
| 254 | d->it = d->propertyNames.begin(); |
| 255 | } |
| 256 | |
| 257 | /*! |
| 258 | Moves the iterator to the back of the QScriptValue (after the |
| 259 | last property). |
| 260 | |
| 261 | \sa toFront(), previous() |
| 262 | */ |
| 263 | void QScriptValueIteratorcxx . . $ QScriptValueIterator#::toBackcxx . . $ QScriptValueIterator#toBack(49f6e7a06ebc5aa8).() |
| 264 | { |
| 265 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptValueIterator); |
| 266 | if (!d) |
| 267 | return; |
| 268 | d->ensureInitializedcxx . . $ QScriptValueIteratorPrivate#ensureInitialized(49f6e7a06ebc5aa8).(); |
| 269 | d->it = d->propertyNames.end(); |
| 270 | } |
| 271 | |
| 272 | /*! |
| 273 | Returns the name of the last property that was jumped over using |
| 274 | next() or previous(). |
| 275 | |
| 276 | \sa value(), flags() |
| 277 | */ |
| 278 | QStringcxx . . $ QString# QScriptValueIteratorcxx . . $ QScriptValueIterator#::namecxx . . $ QScriptValueIterator#name(6ef7b6c27b00b43d).() const |
| 279 | { |
| 280 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptValueIterator); |
| 281 | if (!d || !d->initializedcxx . . $ QScriptValueIteratorPrivate#initialized. || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 282 | return QStringcxx . . $ QString#QString(e1217c004a86c950).(); |
| 283 | return d->current->ustring(); |
| 284 | } |
| 285 | |
| 286 | /*! |
| 287 | \since 4.4 |
| 288 | |
| 289 | Returns the name of the last property that was jumped over using |
| 290 | next() or previous(). |
| 291 | */ |
| 292 | QScriptStringcxx . . $ QScriptString# QScriptValueIteratorcxx . . $ QScriptValueIterator#::scriptNamecxx . . $ QScriptValueIterator#scriptName(b198dec1995512be).() const |
| 293 | { |
| 294 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptValueIterator); |
| 295 | if (!d || !d->initializedcxx . . $ QScriptValueIteratorPrivate#initialized. || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 296 | return QScriptStringcxx . . $ QScriptString#QScriptString(ae9d1fa6573bd2b8).(); |
| 297 | return d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()->toStringHandlecxx . . $ QScriptEnginePrivate#toStringHandle(c258c4dff01b2fe5).(*d->current); |
| 298 | } |
| 299 | |
| 300 | /*! |
| 301 | Returns the value of the last property that was jumped over using |
| 302 | next() or previous(). |
| 303 | |
| 304 | \sa setValue(), name() |
| 305 | */ |
| 306 | QScriptValuecxx . . $ QScriptValue# QScriptValueIteratorcxx . . $ QScriptValueIterator#::valuecxx . . $ QScriptValueIterator#value(73013aefd0020d47).() const |
| 307 | { |
| 308 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptValueIterator); |
| 309 | if (!d || !d->initializedcxx . . $ QScriptValueIteratorPrivate#initialized. || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 310 | return QScriptValuecxx . . $ QScriptValue#QScriptValue(6b35c8bde2804237).(); |
| 311 | QScriptcxx . . $ QScript/::APIShimcxx . . $ QScript/APIShim# shimcxx . . $ QScript/APIShim#APIShim(db35ed4eaf341aaa).(d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()); |
| 312 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# jsValue = d->objectcxx . . $ QScriptValueIteratorPrivate#object(8f18e04bb4378a65).()->propertycxx . . $ QScriptValuePrivate#property(63fa5edfd4ae7011).(*d->current); |
| 313 | return dcxx . . $ QScriptValue#QScriptValue(6b35c8bde2804237).->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()->scriptValueFromJSCValuecxx . . $ QScriptEnginePrivate#scriptValueFromJSCValue(51376262380c5407).(jsValue); |
| 314 | } |
| 315 | |
| 316 | /*! |
| 317 | Sets the \a value of the last property that was jumped over using |
| 318 | next() or previous(). |
| 319 | |
| 320 | \sa value(), name() |
| 321 | */ |
| 322 | void QScriptValueIteratorcxx . . $ QScriptValueIterator#::setValuecxx . . $ QScriptValueIterator#setValue(6b35c8bde2804237).(const QScriptValuecxx . . $ QScriptValue# &value) |
| 323 | { |
| 324 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptValueIterator); |
| 325 | if (!d || !d->initializedcxx . . $ QScriptValueIteratorPrivate#initialized. || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 326 | return; |
| 327 | QScriptcxx . . $ QScript/::APIShimcxx . . $ QScript/APIShim# shimcxx . . $ QScript/APIShim#APIShim(db35ed4eaf341aaa).(d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()); |
| 328 | JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue# jsValue = d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()->scriptValueToJSCValuecxx . . $ QScriptEnginePrivate#scriptValueToJSCValue(1334d8176404fb05).(value); |
| 329 | d->objectcxx . . $ QScriptValueIteratorPrivate#object(8f18e04bb4378a65).()->setPropertycxx . . $ QScriptValuePrivate#setProperty(cc7f7a21926c6cc).(*d->current, jsValue); |
| 330 | } |
| 331 | |
| 332 | /*! |
| 333 | Returns the flags of the last property that was jumped over using |
| 334 | next() or previous(). |
| 335 | |
| 336 | \sa value() |
| 337 | */ |
| 338 | QScriptValuecxx . . $ QScriptValue#::PropertyFlagscxx . . $ QScriptValue#PropertyFlags# QScriptValueIteratorcxx . . $ QScriptValueIterator#::flagscxx . . $ QScriptValueIterator#flags(97d37d1154f9e612).() const |
| 339 | { |
| 340 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptValueIterator); |
| 341 | if (!d || !d->initializedcxx . . $ QScriptValueIteratorPrivate#initialized. || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 342 | return {}; |
| 343 | QScriptcxx . . $ QScript/::APIShimcxx . . $ QScript/APIShim# shimcxx . . $ QScript/APIShim#APIShim(db35ed4eaf341aaa).(d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()); |
| 344 | return d->objectcxx . . $ QScriptValueIteratorPrivate#object(8f18e04bb4378a65).()->propertyFlags(*d->current); |
| 345 | } |
| 346 | |
| 347 | /*! |
| 348 | Removes the last property that was jumped over using next() |
| 349 | or previous(). |
| 350 | |
| 351 | \sa setValue() |
| 352 | */ |
| 353 | void QScriptValueIteratorcxx . . $ QScriptValueIterator#::removecxx . . $ QScriptValueIterator#remove(49f6e7a06ebc5aa8).() |
| 354 | { |
| 355 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptValueIterator); |
| 356 | if (!d || !d->initializedcxx . . $ QScriptValueIteratorPrivate#initialized. || !d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()) |
| 357 | return; |
| 358 | QScriptcxx . . $ QScript/::APIShimcxx . . $ QScript/APIShim# shimcxx . . $ QScript/APIShim#APIShim(db35ed4eaf341aaa).(d->enginecxx . . $ QScriptValueIteratorPrivate#engine(aeecc48b50f79188).()); |
| 359 | d->objectcxx . . $ QScriptValueIteratorPrivate#object(8f18e04bb4378a65).()->setPropertycxx . . $ QScriptValuePrivate#setProperty(cc7f7a21926c6cc).(*d->current, JSCcxx . . $ `<built-in>:463:9`!::JSValuecxx . . $ QTJSC/JSValue#()); |
| 360 | d->propertyNames.erase(d->current); |
| 361 | } |
| 362 | |
| 363 | /*! |
| 364 | Makes the iterator operate on \a object. The iterator is set to be |
| 365 | at the front of the sequence of properties (before the first |
| 366 | property). |
| 367 | */ |
| 368 | QScriptValueIteratorcxx . . $ QScriptValueIterator#& QScriptValueIteratorcxx . . $ QScriptValueIterator#::operatorcxx . . $ QScriptValueIterator#`operator=`(81ca9cfd35ac5273).=(QScriptValuecxx . . $ QScriptValue# &object) |
| 369 | { |
| 370 | d_ptr.reset(); |
| 371 | if (object.isObjectcxx . . $ QScriptValue#isObject(50ce9a9e25b4a850).()) { |
| 372 | d_ptr.reset(new QScriptValueIteratorPrivate()); |
| 373 | d_ptr->objectValue = object; |
| 374 | } |
| 375 | return *this; |
| 376 | } |
| 377 | |
| 378 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |