8#include <QtCore/private/qnumeric_p.h>
25 double index =
v.toInteger();
43 return scope.engine->throwTypeError();
46 if (
scope.hasException())
48 if (
buffer->hasDetachedArrayData())
49 return scope.engine->throwTypeError();
53 return scope.engine->throwRangeError(
QStringLiteral(
"DataView: constructor arguments out of range"));
56 if (
scope.hasException())
58 if (
offset > bufferLength || byteLength > bufferLength -
offset)
59 return scope.engine->throwRangeError(
QStringLiteral(
"DataView: constructor arguments out of range"));
63 a->d()->byteLength = byteLength;
65 return a.asReturnedValue();
70 return f->engine()->throwTypeError();
79 defineDefaultProperty(
engine->id_constructor(), (
o = ctor));
80 defineAccessorProperty(
QStringLiteral(
"buffer"), method_get_buffer,
nullptr);
81 defineAccessorProperty(
QStringLiteral(
"byteLength"), method_get_byteLength,
nullptr);
82 defineAccessorProperty(
QStringLiteral(
"byteOffset"), method_get_byteOffset,
nullptr);
84 defineDefaultProperty(
QStringLiteral(
"getInt8"), method_getChar<signed char>, 1);
85 defineDefaultProperty(
QStringLiteral(
"getUint8"), method_getChar<unsigned char>, 1);
86 defineDefaultProperty(
QStringLiteral(
"getInt16"), method_get<short>, 1);
87 defineDefaultProperty(
QStringLiteral(
"getUint16"), method_get<unsigned short>, 1);
88 defineDefaultProperty(
QStringLiteral(
"getInt32"), method_get<int>, 1);
89 defineDefaultProperty(
QStringLiteral(
"getUint32"), method_get<unsigned int>, 1);
90 defineDefaultProperty(
QStringLiteral(
"getFloat32"), method_getFloat<float>, 1);
91 defineDefaultProperty(
QStringLiteral(
"getFloat64"), method_getFloat<double>, 1);
93 defineDefaultProperty(
QStringLiteral(
"setInt8"), method_setChar<signed char>, 2);
94 defineDefaultProperty(
QStringLiteral(
"setUint8"), method_setChar<unsigned char>, 2);
95 defineDefaultProperty(
QStringLiteral(
"setInt16"), method_set<short>, 2);
96 defineDefaultProperty(
QStringLiteral(
"setUint16"), method_set<unsigned short>, 2);
97 defineDefaultProperty(
QStringLiteral(
"setInt32"), method_set<int>, 2);
98 defineDefaultProperty(
QStringLiteral(
"setUint32"), method_set<unsigned int>, 2);
99 defineDefaultProperty(
QStringLiteral(
"setFloat32"), method_setFloat<float>, 2);
100 defineDefaultProperty(
QStringLiteral(
"setFloat64"), method_setFloat<double>, 2);
106 defineDefaultProperty(
QStringLiteral(
"getUInt8"), method_getChar<unsigned char>, 1);
107 defineDefaultProperty(
QStringLiteral(
"getUInt16"), method_get<unsigned short>, 1);
108 defineDefaultProperty(
QStringLiteral(
"getUInt32"), method_get<unsigned int>, 1);
109 defineDefaultProperty(
QStringLiteral(
"setUInt8"), method_setChar<unsigned char>, 1);
110 defineDefaultProperty(
QStringLiteral(
"setUInt16"), method_set<unsigned short>, 1);
111 defineDefaultProperty(
QStringLiteral(
"setUInt32"), method_set<unsigned int>, 1);
120 return v->d()->buffer->asReturnedValue();
129 if (
v->d()->buffer->hasDetachedArrayData())
130 return b->engine()->throwTypeError();
132 return Encode(
v->d()->byteLength);
141 if (
v->d()->buffer->hasDetachedArrayData())
142 return b->engine()->throwTypeError();
144 return Encode(
v->d()->byteOffset);
153 return e->throwTypeError();
157 if (
v->d()->buffer->hasDetachedArrayData())
158 return e->throwTypeError();
159 if (idx +
sizeof(T) >
v->d()->byteLength)
161 idx +=
v->d()->byteOffset;
163 T
t = T(
v->d()->buffer->constArrayData()[idx]);
174 return e->throwTypeError();
178 if (
v->d()->buffer->hasDetachedArrayData())
179 return e->throwTypeError();
180 if (idx +
sizeof(T) >
v->d()->byteLength)
182 idx +=
v->d()->byteOffset;
187 ? qFromLittleEndian<T>((
const uchar *)
v->d()->buffer->constArrayData() + idx)
188 : qFromBigEndian<T>((
const uchar *)
v->d()->buffer->constArrayData() + idx);
199 return e->throwTypeError();
203 if (
v->d()->buffer->hasDetachedArrayData())
204 return e->throwTypeError();
205 if (idx +
sizeof(T) >
v->d()->byteLength)
207 idx +=
v->d()->byteOffset;
211 if (
sizeof(T) == 4) {
218 ? qFromLittleEndian<uint>((
const uchar *)
v->d()->buffer->constArrayData() + idx)
219 : qFromBigEndian<uint>((
const uchar *)
v->d()->buffer->constArrayData() + idx);
228 ? qFromLittleEndian<quint64>((
const uchar *)
v->d()->buffer->constArrayData() + idx)
229 : qFromBigEndian<quint64>((
const uchar *)
v->d()->buffer->constArrayData() + idx);
240 return e->throwTypeError();
247 if (
v->d()->buffer->hasDetachedArrayData())
248 return e->throwTypeError();
250 if (idx +
sizeof(T) >
v->d()->byteLength)
252 idx +=
v->d()->byteOffset;
254 v->d()->buffer->arrayData()[idx] = (char)
val;
265 return e->throwTypeError();
273 if (
v->d()->buffer->hasDetachedArrayData())
274 return e->throwTypeError();
276 if (idx +
sizeof(T) >
v->d()->byteLength)
278 idx +=
v->d()->byteOffset;
282 qToLittleEndian<T>(
val, (
uchar *)
v->d()->buffer->arrayData() + idx);
284 qToBigEndian<T>(
val, (
uchar *)
v->d()->buffer->arrayData() + idx);
295 return e->throwTypeError();
303 if (
v->d()->buffer->hasDetachedArrayData())
304 return e->throwTypeError();
306 if (idx +
sizeof(T) >
v->d()->byteLength)
308 idx +=
v->d()->byteOffset;
310 if (
sizeof(T) == 4) {
\qmltype Particle \inqmlmodule QtQuick.Particles
constexpr T qToBigEndian(T source)
constexpr T qToLittleEndian(T source)
constexpr static Q_DECL_CONST_FUNCTION double qt_qnan() noexcept
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr offset
#define QStringLiteral(str)
unsigned long long quint64
static uint toIndex(ExecutionEngine *e, const Value &v)
#define RETURN_UNDEFINED()
#define DEFINE_OBJECT_VTABLE(classname)
static ReturnedValue method_get_buffer(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_setFloat(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_getChar(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_getFloat(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_byteLength(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_setChar(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(ExecutionEngine *engine, Object *ctor)
static ReturnedValue method_get(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_set(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_byteOffset(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static constexpr ReturnedValue undefined()
Symbol * symbol_toStringTag() const
ReturnedValue throwTypeError()
Heap::ExecutionContext * scope() const
void init(QV4::ExecutionContext *scope)
ExecutionEngine * engine() const
void defineReadonlyConfigurableProperty(const QString &name, const Value &value)
void defineReadonlyProperty(const QString &name, const Value &value)
static constexpr VTable::CallAsConstructor virtualCallAsConstructor
static constexpr VTable::Call virtualCall
static constexpr Value fromInt32(int i)
static constexpr Value undefinedValue()