-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathV8ObjectHelpers.h
More file actions
31 lines (24 loc) · 1.94 KB
/
V8ObjectHelpers.h
File metadata and controls
31 lines (24 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
//-----------------------------------------------------------------------------
// V8ObjectHelpers
//-----------------------------------------------------------------------------
struct V8ObjectHelpers final: StaticBase
{
static V8Value GetProperty(const SharedPtr<V8ObjectHolder>& spHolder, const StdString& name);
static bool TryGetProperty(const SharedPtr<V8ObjectHolder>& spHolder, const StdString& name, V8Value& value);
static void SetProperty(const SharedPtr<V8ObjectHolder>& spHolder, const StdString& name, const V8Value& value);
static bool DeleteProperty(const SharedPtr<V8ObjectHolder>& spHolder, const StdString& name);
static void GetPropertyNames(const SharedPtr<V8ObjectHolder>& spHolder, bool includeIndices, std::vector<StdString>& names);
static V8Value GetProperty(const SharedPtr<V8ObjectHolder>& spHolder, int index);
static void SetProperty(const SharedPtr<V8ObjectHolder>& spHolder, int index, const V8Value& value);
static bool DeleteProperty(const SharedPtr<V8ObjectHolder>& spHolder, int index);
static void GetPropertyIndices(const SharedPtr<V8ObjectHolder>& spHolder, std::vector<int>& indices);
static V8Value Invoke(const SharedPtr<V8ObjectHolder>& spHolder, bool asConstructor, const std::vector<V8Value>& args);
static V8Value InvokeMethod(const SharedPtr<V8ObjectHolder>& spHolder, const StdString& name, const std::vector<V8Value>& args);
typedef void ArrayBufferOrViewDataCallback(void* pvData, void* pvArg);
static void GetArrayBufferOrViewInfo(const SharedPtr<V8ObjectHolder>& spHolder, V8Value& arrayBuffer, size_t& offset, size_t& size, size_t& length);
static void InvokeWithArrayBufferOrViewData(const SharedPtr<V8ObjectHolder>& spHolder, ArrayBufferOrViewDataCallback* pCallback, void* pvArg);
static V8Value::Flags GetFlags(const SharedPtr<V8ObjectHolder>& spHolder);
};