Overte C++ Documentation
ArrayBufferClass.h
1 //
2 // ArrayBufferClass.h
3 //
4 //
5 // Created by Clement on 7/3/14.
6 // Copyright 2014 High Fidelity, Inc.
7 // Copyright 2023 Overte e.V.
8 //
9 // Distributed under the Apache License, Version 2.0.
10 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
11 // SPDX-License-Identifier: Apache-2.0
12 //
13 
16 
17 #ifndef hifi_ArrayBufferClass_h
18 #define hifi_ArrayBufferClass_h
19 
20 #include <QtCore/QObject>
21 #include "libplatform/libplatform.h"
22 #include "v8.h"
23 #include <QtCore/QDateTime>
24 
25 // V8TODO Do not remove yet, this will be useful in later PRs
26 //#include "V8Types.h"
27 /*
28 class ScriptEngineV8;
29 
31 class ArrayBufferClass : public QObject, public ScriptClass {
32  Q_OBJECT
33 public:
34  ArrayBufferClass(ScriptEngineV8* scriptEngine);
35  V8ScriptValue newInstance(qint32 size);
36  V8ScriptValue newInstance(const QByteArray& ba);
37 
38  QueryFlags queryProperty(const V8ScriptValue& object,
39  const V8ScriptString& name,
40  QueryFlags flags, uint* id) override;
41  V8ScriptValue property(const V8ScriptValue& object,
42  const V8ScriptString& name, uint id) override;
43  V8ScriptValue::PropertyFlags propertyFlags(const V8ScriptValue& object,
44  const V8ScriptString& name, uint id) override;
45 
46  QString name() const override;
47  V8ScriptValue prototype() const override;
48 
49 
50 private:
51  static V8ScriptValue construct(V8ScriptContext* context, QScriptEngine* engine);
52 
53  static V8ScriptValue toScriptValue(QScriptEngine* eng, const QByteArray& ba);
54  static void fromScriptValue(const V8ScriptValue& obj, QByteArray& ba);
55 
56  V8ScriptValue _proto;
57  V8ScriptValue _ctor;
58 
59  // JS Object attributes
60  V8ScriptString _name;
61  V8ScriptString _byteLength;
62 
63 };
64 
65 */
66 #endif // hifi_ArrayBufferClass_h
67