| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2017 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the examples of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:BSD$ |
| 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 | ** BSD License Usage |
| 18 | ** Alternatively, you may use this file under the terms of the BSD license |
| 19 | ** as follows: |
| 20 | ** |
| 21 | ** "Redistribution and use in source and binary forms, with or without |
| 22 | ** modification, are permitted provided that the following conditions are |
| 23 | ** met: |
| 24 | ** * Redistributions of source code must retain the above copyright |
| 25 | ** notice, this list of conditions and the following disclaimer. |
| 26 | ** * Redistributions in binary form must reproduce the above copyright |
| 27 | ** notice, this list of conditions and the following disclaimer in |
| 28 | ** the documentation and/or other materials provided with the |
| 29 | ** distribution. |
| 30 | ** * Neither the name of The Qt Company Ltd nor the names of its |
| 31 | ** contributors may be used to endorse or promote products derived |
| 32 | ** from this software without specific prior written permission. |
| 33 | ** |
| 34 | ** |
| 35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." |
| 46 | ** |
| 47 | ** $QT_END_LICENSE$ |
| 48 | ** |
| 49 | ****************************************************************************/ |
| 50 | |
| 51 | #include <QtScript/QScriptClassPropertyIterator>cxx . . $ `<file>/include/QtScript/QScriptClassPropertyIterator`/ |
| 52 | #include <QtScript/QScriptContext>cxx . . $ `<file>/include/QtScript/QScriptContext`/ |
| 53 | #include <QtScript/QScriptEngine>cxx . . $ `<file>/include/QtScript/QScriptEngine`/ |
| 54 | #include "bytearrayclass.h"cxx . . $ `<file>/examples/script/customclass/bytearrayclass.h`/ |
| 55 | #include "bytearrayprototype.h"cxx . . $ `<file>/examples/script/customclass/bytearrayprototype.h`/ |
| 56 | |
| 57 | #include <stdlib.h> |
| 58 | |
| 59 | Q_DECLARE_METATYPEcxx . . $ `<external>/17491093664533580526/qmetatype.h:2056:9`!(QByteArray*) |
| 60 | Q_DECLARE_METATYPEcxx . . $ `<external>/17491093664533580526/qmetatype.h:2056:9`!(ByteArrayClass*) |
| 61 | |
| 62 | class ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator# : public QScriptClassPropertyIteratorcxx . . $ QScriptClassPropertyIterator# |
| 63 | { |
| 64 | public: |
| 65 | ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#ByteArrayClassPropertyIterator(6b35c8bde2804237).(const QScriptValuecxx . . $ QScriptValue# &object); |
| 66 | ~cxx . . $ ByteArrayClassPropertyIterator#`~ByteArrayClassPropertyIterator`(ced63f7c635d850d).ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#(); |
| 67 | |
| 68 | bool hasNextcxx . . $ ByteArrayClassPropertyIterator#hasNext(50ce9a9e25b4a850).() const; |
| 69 | void nextcxx . . $ ByteArrayClassPropertyIterator#next(49f6e7a06ebc5aa8).(); |
| 70 | |
| 71 | bool hasPreviouscxx . . $ ByteArrayClassPropertyIterator#hasPrevious(50ce9a9e25b4a850).() const; |
| 72 | void previouscxx . . $ ByteArrayClassPropertyIterator#previous(49f6e7a06ebc5aa8).(); |
| 73 | |
| 74 | void toFrontcxx . . $ ByteArrayClassPropertyIterator#toFront(49f6e7a06ebc5aa8).(); |
| 75 | void toBackcxx . . $ ByteArrayClassPropertyIterator#toBack(49f6e7a06ebc5aa8).(); |
| 76 | |
| 77 | QScriptStringcxx . . $ QScriptString# namecxx . . $ ByteArrayClassPropertyIterator#name(b198dec1995512be).() const; |
| 78 | uintcxx . . $ uint# idcxx . . $ ByteArrayClassPropertyIterator#id(ddd8539a2fcdd4ce).() const; |
| 79 | |
| 80 | private: |
| 81 | int m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index.; |
| 82 | int m_lastcxx . . $ ByteArrayClassPropertyIterator#m_last.; |
| 83 | }; |
| 84 | |
| 85 | //! [0] |
| 86 | ByteArrayClasscxx . . $ ByteArrayClass#::ByteArrayClasscxx . . $ ByteArrayClass#ByteArrayClass(d3e0164fcca5dac6).(QScriptEnginecxx . . $ QScriptEngine# *engine) |
| 87 | : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(engine), QScriptClasscxx . . $ QScriptClass#QScriptClass(d3e0164fcca5dac6).(engine) |
| 88 | { |
| 89 | qScriptRegisterMetaTypecxx . . $ qScriptRegisterMetaType(b910593bb212e9de).<QByteArraycxx . . $ QByteArray#>(engine, toScriptValuecxx . . $ ByteArrayClass#toScriptValue(f79c941c918bef5c)., fromScriptValuecxx . . $ ByteArrayClass#fromScriptValue(cd5ab049a5b1c6a3).); |
| 90 | |
| 91 | lengthcxx . . $ ByteArrayClass#length. =cxx . . $ QScriptString#`operator=`(a5bd910b733c9fb). engine->toStringHandlecxx . . $ QScriptEngine#toStringHandle(bebf7d375bbce3db).(QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("length")); |
| 92 | |
| 93 | protocxx . . $ ByteArrayClass#proto. =cxx . . $ QScriptValue#`operator=`(1a503f9e5bba28ab). engine->newQObjectcxx . . $ QScriptEngine#newQObject(46186e2624cf5a94).(new ByteArrayPrototypecxx . . $ ByteArrayPrototype#(this), |
| 94 | QScriptEnginecxx . . $ QScriptEngine#::QtOwnershipcxx . . $ QScriptEngine#QtOwnership., |
| 95 | QScriptEnginecxx . . $ QScriptEngine#::SkipMethodsInEnumerationcxx . . $ QScriptEngine#SkipMethodsInEnumeration. |
| 96 | |cxx . . $ `operator|`(7048696fb22f69d1). QScriptEnginecxx . . $ QScriptEngine#::ExcludeSuperClassMethodscxx . . $ QScriptEngine#ExcludeSuperClassMethods. |
| 97 | |cxx . . $ QFlags#`operator|`(2cc1994e0be6f18e). QScriptEnginecxx . . $ QScriptEngine#::ExcludeSuperClassPropertiescxx . . $ QScriptEngine#ExcludeSuperClassProperties.); |
| 98 | QScriptValuecxx . . $ QScriptValue# global = engine->globalObjectcxx . . $ QScriptEngine#globalObject(73013aefd0020d47).(); |
| 99 | protocxx . . $ ByteArrayClass#proto..setPrototypecxx . . $ QScriptValue#setPrototype(6b35c8bde2804237).(global.propertycxx . . $ QScriptValue#property(cc0ed881c2909ea3).("Object"cxx . . $ QString#QString(85c52e162fed56f9).).propertycxx . . $ QScriptValue#property(cc0ed881c2909ea3).("prototype"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 100 | |
| 101 | ctorcxx . . $ ByteArrayClass#ctor. =cxx . . $ QScriptValue#`operator=`(1a503f9e5bba28ab). engine->newFunctioncxx . . $ QScriptEngine#newFunction(f8ffb222cfdbabe).(constructcxx . . $ ByteArrayClass#construct(ee586b79a54a8223)., protocxx . . $ ByteArrayClass#proto.); |
| 102 | ctorcxx . . $ ByteArrayClass#ctor..setDatacxx . . $ QScriptValue#setData(6b35c8bde2804237).(engine->toScriptValuecxx . . $ QScriptEngine#toScriptValue(3f6667d060280b89).(this)); |
| 103 | } |
| 104 | //! [0] |
| 105 | |
| 106 | ByteArrayClasscxx . . $ ByteArrayClass#::~cxx . . $ ByteArrayClass#`~ByteArrayClass`(ced63f7c635d850d).ByteArrayClasscxx . . $ ByteArrayClass#() |
| 107 | { |
| 108 | } |
| 109 | |
| 110 | //! [3] |
| 111 | QScriptClasscxx . . $ QScriptClass#::QueryFlagscxx . . $ QScriptClass#QueryFlags# ByteArrayClasscxx . . $ ByteArrayClass#::queryPropertycxx . . $ ByteArrayClass#queryProperty(f7a17b0081519724).(const QScriptValuecxx . . $ QScriptValue# &object, |
| 112 | const QScriptStringcxx . . $ QScriptString# &name, |
| 113 | QueryFlagscxx . . $ QScriptClass#QueryFlags# flags, uintcxx . . $ uint# *id) |
| 114 | { |
| 115 | QByteArraycxx . . $ QByteArray# *ba = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QByteArraycxx . . $ QByteArray#*>(object.datacxx . . $ QScriptValue#data(73013aefd0020d47).()); |
| 116 | if (!ba) |
| 117 | return {cxx . . $ QFlags#QFlags(ced63f7c635d850d).}; |
| 118 | if (name ==cxx . . $ QScriptString#`operator==`(496134752549386d). lengthcxx . . $ ByteArrayClass#length.) { |
| 119 | return flags; |
| 120 | } else { |
| 121 | bool isArrayIndex; |
| 122 | qint32cxx . . $ qint32# pos = name.toArrayIndexcxx . . $ QScriptString#toArrayIndex(870b63f89c7fb98).(&isArrayIndex); |
| 123 | if (!isArrayIndex) |
| 124 | return {cxx . . $ QFlags#QFlags(ced63f7c635d850d).}; |
| 125 | *id = pos; |
| 126 | if ((flags &cxx . . $ QFlags#`operator&`(2cc1994e0be6f18e). HandlesReadAccesscxx . . $ QScriptClass#HandlesReadAccess.) && (pos >= ba->sizecxx . . $ QByteArray#size(455f465bc33b4cdf).())) |
| 127 | flags &=cxx . . $ QFlags#`operator&=`(27c6cfe8e6a9b45c). ~HandlesReadAccesscxx . . $ QScriptClass#HandlesReadAccess.; |
| 128 | return flags; |
| 129 | } |
| 130 | } |
| 131 | //! [3] |
| 132 | |
| 133 | //! [4] |
| 134 | QScriptValuecxx . . $ QScriptValue# ByteArrayClasscxx . . $ ByteArrayClass#::propertycxx . . $ ByteArrayClass#property(4b7a95d7afa37072).(const QScriptValuecxx . . $ QScriptValue# &object, |
| 135 | const QScriptStringcxx . . $ QScriptString# &name, uintcxx . . $ uint# id) |
| 136 | { |
| 137 | QByteArraycxx . . $ QByteArray# *ba = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QByteArraycxx . . $ QByteArray#*>(object.datacxx . . $ QScriptValue#data(73013aefd0020d47).()); |
| 138 | if (!ba) |
| 139 | return QScriptValuecxx . . $ QScriptValue#QScriptValue(49f6e7a06ebc5aa8).(); |
| 140 | if (name ==cxx . . $ QScriptString#`operator==`(496134752549386d). lengthcxx . . $ ByteArrayClass#length.) { |
| 141 | return bacxx . . $ QScriptValue#QScriptValue(d4f767463ce0a6b3).->lengthcxx . . $ QByteArray#length(455f465bc33b4cdf).(); |
| 142 | } else { |
| 143 | qint32cxx . . $ qint32# pos = id; |
| 144 | if ((pos < 0) || (pos >= ba->sizecxx . . $ QByteArray#size(455f465bc33b4cdf).())) |
| 145 | return QScriptValuecxx . . $ QScriptValue#QScriptValue(49f6e7a06ebc5aa8).(); |
| 146 | return uintcxx . . $ QScriptValue#QScriptValue(cb2f890c2fdad230).(ba->atcxx . . $ QByteArray#at(ed855a77b1899856).(pos)) & 255; |
| 147 | } |
| 148 | return QScriptValuecxx . . $ QScriptValue#QScriptValue(49f6e7a06ebc5aa8).(); |
| 149 | } |
| 150 | //! [4] |
| 151 | |
| 152 | //! [5] |
| 153 | void ByteArrayClasscxx . . $ ByteArrayClass#::setPropertycxx . . $ ByteArrayClass#setProperty(b81691bcb74bc31a).(QScriptValuecxx . . $ QScriptValue# &object, |
| 154 | const QScriptStringcxx . . $ QScriptString# &name, |
| 155 | uintcxx . . $ uint# id, const QScriptValuecxx . . $ QScriptValue# &value) |
| 156 | { |
| 157 | QByteArraycxx . . $ QByteArray# *ba = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QByteArraycxx . . $ QByteArray#*>(object.datacxx . . $ QScriptValue#data(73013aefd0020d47).()); |
| 158 | if (!ba) |
| 159 | return; |
| 160 | if (name ==cxx . . $ QScriptString#`operator==`(496134752549386d). lengthcxx . . $ ByteArrayClass#length.) { |
| 161 | resizecxx . . $ ByteArrayClass#resize(13ab2e8048b2fc4f).(*ba, value.toInt32cxx . . $ QScriptValue#toInt32(455f465bc33b4cdf).()); |
| 162 | } else { |
| 163 | qint32cxx . . $ qint32# pos = id; |
| 164 | if (pos < 0) |
| 165 | return; |
| 166 | if (ba->sizecxx . . $ QByteArray#size(455f465bc33b4cdf).() <= pos) |
| 167 | resizecxx . . $ ByteArrayClass#resize(13ab2e8048b2fc4f).(*ba, pos + 1); |
| 168 | (*ba)[cxx . . $ QByteArray#`operator[]`(6eaff86c84670f1a).pos] =cxx . . $ QByteRef#`operator=`(fee4eda3ac0bfad3). char(value.toInt32cxx . . $ QScriptValue#toInt32(455f465bc33b4cdf).()); |
| 169 | } |
| 170 | } |
| 171 | //! [5] |
| 172 | |
| 173 | //! [6] |
| 174 | QScriptValuecxx . . $ QScriptValue#::PropertyFlagscxx . . $ QScriptValue#PropertyFlags# ByteArrayClasscxx . . $ ByteArrayClass#::propertyFlagscxx . . $ ByteArrayClass#propertyFlags(4c0c675d762825f6).( |
| 175 | const QScriptValuecxx . . $ QScriptValue# &/*object*/, const QScriptStringcxx . . $ QScriptString# &name, uintcxx . . $ uint# /*id*/) |
| 176 | { |
| 177 | if (name ==cxx . . $ QScriptString#`operator==`(496134752549386d). lengthcxx . . $ ByteArrayClass#length.) { |
| 178 | return QScriptValuecxx . . $ QScriptValue#::Undeletablecxx . . $ QScriptValue#Undeletable. |
| 179 | |cxx . . $ `operator|`(c5495b59afa2190b). QScriptValuecxx . . $ QScriptValue#::SkipInEnumerationcxx . . $ QScriptValue#SkipInEnumeration.; |
| 180 | } |
| 181 | return QScriptValuecxx . . $ QFlags#QFlags(93d577a3e9528307).::Undeletablecxx . . $ QScriptValue#Undeletable.; |
| 182 | } |
| 183 | //! [6] |
| 184 | |
| 185 | //! [7] |
| 186 | QScriptClassPropertyIteratorcxx . . $ QScriptClassPropertyIterator# *ByteArrayClasscxx . . $ ByteArrayClass#::newIteratorcxx . . $ ByteArrayClass#newIterator(2738c69cbc46868b).(const QScriptValuecxx . . $ QScriptValue# &object) |
| 187 | { |
| 188 | return new ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#(object); |
| 189 | } |
| 190 | //! [7] |
| 191 | |
| 192 | QStringcxx . . $ QString# ByteArrayClasscxx . . $ ByteArrayClass#::namecxx . . $ ByteArrayClass#name(6ef7b6c27b00b43d).() const |
| 193 | { |
| 194 | return QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("ByteArray"); |
| 195 | } |
| 196 | |
| 197 | QScriptValuecxx . . $ QScriptValue# ByteArrayClasscxx . . $ ByteArrayClass#::prototypecxx . . $ ByteArrayClass#prototype(73013aefd0020d47).() const |
| 198 | { |
| 199 | return protocxx . . $ QScriptValue#QScriptValue(6b35c8bde2804237).; |
| 200 | } |
| 201 | |
| 202 | QScriptValuecxx . . $ QScriptValue# ByteArrayClasscxx . . $ ByteArrayClass#::constructorcxx . . $ ByteArrayClass#constructor(68040aa6d67732df).() |
| 203 | { |
| 204 | return ctorcxx . . $ QScriptValue#QScriptValue(6b35c8bde2804237).; |
| 205 | } |
| 206 | |
| 207 | //! [10] |
| 208 | QScriptValuecxx . . $ QScriptValue# ByteArrayClasscxx . . $ ByteArrayClass#::newInstancecxx . . $ ByteArrayClass#newInstance(cf1ccc45c0d7c2af).(int size) |
| 209 | { |
| 210 | enginecxx . . $ QScriptClass#engine(18bf45d2c163ce9b).()->reportAdditionalMemoryCostcxx . . $ QScriptEngine#reportAdditionalMemoryCost(d4f767463ce0a6b3).(size); |
| 211 | return newInstancecxx . . $ ByteArrayClass#newInstance(c6a0567e5f45e67a).(QByteArraycxx . . $ QByteArray#QByteArray(5016a63d0a5aceb0).(size, /*ch=*/0)); |
| 212 | } |
| 213 | //! [10] |
| 214 | |
| 215 | //! [1] |
| 216 | QScriptValuecxx . . $ QScriptValue# ByteArrayClasscxx . . $ ByteArrayClass#::newInstancecxx . . $ ByteArrayClass#newInstance(c6a0567e5f45e67a).(const QByteArraycxx . . $ QByteArray# &ba) |
| 217 | { |
| 218 | QScriptValuecxx . . $ QScriptValue# data = enginecxx . . $ QScriptClass#engine(18bf45d2c163ce9b).()->newVariantcxx . . $ QScriptEngine#newVariant(69ec459140c7d6a2).(QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(28ec88ac519b76da).(ba)); |
| 219 | return enginecxx . . $ QScriptClass#engine(18bf45d2c163ce9b).()->newObjectcxx . . $ QScriptEngine#newObject(2484c5f8f7d59e).(this, data); |
| 220 | } |
| 221 | //! [1] |
| 222 | |
| 223 | //! [2] |
| 224 | QScriptValuecxx . . $ QScriptValue# ByteArrayClasscxx . . $ ByteArrayClass#::constructcxx . . $ ByteArrayClass#construct(ee586b79a54a8223).(QScriptContextcxx . . $ QScriptContext# *ctx, QScriptEnginecxx . . $ QScriptEngine# *) |
| 225 | { |
| 226 | ByteArrayClasscxx . . $ ByteArrayClass# *cls = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<ByteArrayClasscxx . . $ ByteArrayClass#*>(ctx->calleecxx . . $ QScriptContext#callee(73013aefd0020d47).().datacxx . . $ QScriptValue#data(73013aefd0020d47).()); |
| 227 | if (!cls) |
| 228 | return QScriptValuecxx . . $ QScriptValue#QScriptValue(49f6e7a06ebc5aa8).(); |
| 229 | QScriptValuecxx . . $ QScriptValue# arg = ctx->argumentcxx . . $ QScriptContext#argument(437c608299e89444).(0); |
| 230 | if (arg.instanceOfcxx . . $ QScriptValue#instanceOf(f1859bb82f79d140).(ctx->calleecxx . . $ QScriptContext#callee(73013aefd0020d47).())) |
| 231 | return cls->newInstancecxx . . $ ByteArrayClass#newInstance(c6a0567e5f45e67a).(qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QByteArraycxx . . $ QByteArray#>(arg)); |
| 232 | int size = arg.toInt32cxx . . $ QScriptValue#toInt32(455f465bc33b4cdf).(); |
| 233 | return cls->newInstancecxx . . $ ByteArrayClass#newInstance(cf1ccc45c0d7c2af).(size); |
| 234 | } |
| 235 | //! [2] |
| 236 | |
| 237 | QScriptValuecxx . . $ QScriptValue# ByteArrayClasscxx . . $ ByteArrayClass#::toScriptValuecxx . . $ ByteArrayClass#toScriptValue(f79c941c918bef5c).(QScriptEnginecxx . . $ QScriptEngine# *eng, const QByteArraycxx . . $ QByteArray# &ba) |
| 238 | { |
| 239 | QScriptValuecxx . . $ QScriptValue# ctor = eng->globalObjectcxx . . $ QScriptEngine#globalObject(73013aefd0020d47).().propertycxx . . $ QScriptValue#property(cc0ed881c2909ea3).("ByteArray"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 240 | ByteArrayClasscxx . . $ ByteArrayClass# *cls = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<ByteArrayClasscxx . . $ ByteArrayClass#*>(ctor.datacxx . . $ QScriptValue#data(73013aefd0020d47).()); |
| 241 | if (!cls) |
| 242 | return eng->newVariantcxx . . $ QScriptEngine#newVariant(69ec459140c7d6a2).(QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(28ec88ac519b76da).(ba)); |
| 243 | return cls->newInstancecxx . . $ ByteArrayClass#newInstance(c6a0567e5f45e67a).(ba); |
| 244 | } |
| 245 | |
| 246 | void ByteArrayClasscxx . . $ ByteArrayClass#::fromScriptValuecxx . . $ ByteArrayClass#fromScriptValue(cd5ab049a5b1c6a3).(const QScriptValuecxx . . $ QScriptValue# &obj, QByteArraycxx . . $ QByteArray# &ba) |
| 247 | { |
| 248 | ba =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). qvariant_castcxx . . $ qvariant_cast(c08a979ef106920f).<QByteArraycxx . . $ QByteArray#>(obj.datacxx . . $ QScriptValue#data(73013aefd0020d47).().toVariantcxx . . $ QScriptValue#toVariant(23280f95d1ccaa1f).()); |
| 249 | } |
| 250 | |
| 251 | //! [9] |
| 252 | void ByteArrayClasscxx . . $ ByteArrayClass#::resizecxx . . $ ByteArrayClass#resize(13ab2e8048b2fc4f).(QByteArraycxx . . $ QByteArray# &ba, int newSize) |
| 253 | { |
| 254 | int oldSize = ba.sizecxx . . $ QByteArray#size(455f465bc33b4cdf).(); |
| 255 | ba.resizecxx . . $ QByteArray#resize(d4f767463ce0a6b3).(newSize); |
| 256 | if (newSize > oldSize) |
| 257 | enginecxx . . $ QScriptClass#engine(18bf45d2c163ce9b).()->reportAdditionalMemoryCostcxx . . $ QScriptEngine#reportAdditionalMemoryCost(d4f767463ce0a6b3).(newSize - oldSize); |
| 258 | } |
| 259 | //! [9] |
| 260 | |
| 261 | |
| 262 | |
| 263 | ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#ByteArrayClassPropertyIterator(6b35c8bde2804237).(const QScriptValuecxx . . $ QScriptValue# &object) |
| 264 | : QScriptClassPropertyIteratorcxx . . $ QScriptClassPropertyIterator#(object) |
| 265 | { |
| 266 | toFrontcxx . . $ ByteArrayClassPropertyIterator#toFront(49f6e7a06ebc5aa8).(); |
| 267 | } |
| 268 | |
| 269 | ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::~cxx . . $ ByteArrayClassPropertyIterator#`~ByteArrayClassPropertyIterator`(ced63f7c635d850d).ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#() |
| 270 | { |
| 271 | } |
| 272 | |
| 273 | //! [8] |
| 274 | bool ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::hasNextcxx . . $ ByteArrayClassPropertyIterator#hasNext(50ce9a9e25b4a850).() const |
| 275 | { |
| 276 | QByteArraycxx . . $ QByteArray# *ba = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QByteArraycxx . . $ QByteArray#*>(objectcxx . . $ QScriptClassPropertyIterator#object(73013aefd0020d47).().datacxx . . $ QScriptValue#data(73013aefd0020d47).()); |
| 277 | return m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index. < ba->sizecxx . . $ QByteArray#size(455f465bc33b4cdf).(); |
| 278 | } |
| 279 | |
| 280 | void ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::nextcxx . . $ ByteArrayClassPropertyIterator#next(49f6e7a06ebc5aa8).() |
| 281 | { |
| 282 | m_lastcxx . . $ ByteArrayClassPropertyIterator#m_last. = m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index.; |
| 283 | ++m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index.; |
| 284 | } |
| 285 | |
| 286 | bool ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::hasPreviouscxx . . $ ByteArrayClassPropertyIterator#hasPrevious(50ce9a9e25b4a850).() const |
| 287 | { |
| 288 | return (m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index. > 0); |
| 289 | } |
| 290 | |
| 291 | void ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::previouscxx . . $ ByteArrayClassPropertyIterator#previous(49f6e7a06ebc5aa8).() |
| 292 | { |
| 293 | --m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index.; |
| 294 | m_lastcxx . . $ ByteArrayClassPropertyIterator#m_last. = m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index.; |
| 295 | } |
| 296 | |
| 297 | void ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::toFrontcxx . . $ ByteArrayClassPropertyIterator#toFront(49f6e7a06ebc5aa8).() |
| 298 | { |
| 299 | m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index. = 0; |
| 300 | m_lastcxx . . $ ByteArrayClassPropertyIterator#m_last. = -1; |
| 301 | } |
| 302 | |
| 303 | void ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::toBackcxx . . $ ByteArrayClassPropertyIterator#toBack(49f6e7a06ebc5aa8).() |
| 304 | { |
| 305 | QByteArraycxx . . $ QByteArray# *ba = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QByteArraycxx . . $ QByteArray#*>(objectcxx . . $ QScriptClassPropertyIterator#object(73013aefd0020d47).().datacxx . . $ QScriptValue#data(73013aefd0020d47).()); |
| 306 | m_indexcxx . . $ ByteArrayClassPropertyIterator#m_index. = ba->sizecxx . . $ QByteArray#size(455f465bc33b4cdf).(); |
| 307 | m_lastcxx . . $ ByteArrayClassPropertyIterator#m_last. = -1; |
| 308 | } |
| 309 | |
| 310 | QScriptStringcxx . . $ QScriptString# ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::namecxx . . $ ByteArrayClassPropertyIterator#name(b198dec1995512be).() const |
| 311 | { |
| 312 | return objectcxx . . $ QScriptClassPropertyIterator#object(73013aefd0020d47).().enginecxx . . $ QScriptValue#engine(18bf45d2c163ce9b).()->toStringHandlecxx . . $ QScriptEngine#toStringHandle(bebf7d375bbce3db).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(m_lastcxx . . $ ByteArrayClassPropertyIterator#m_last.)); |
| 313 | } |
| 314 | |
| 315 | uintcxx . . $ uint# ByteArrayClassPropertyIteratorcxx . . $ ByteArrayClassPropertyIterator#::idcxx . . $ ByteArrayClassPropertyIterator#id(ddd8539a2fcdd4ce).() const |
| 316 | { |
| 317 | return m_lastcxx . . $ ByteArrayClassPropertyIterator#m_last.; |
| 318 | } |
| 319 | //! [8] |