Ultralight C++ API 1.4.0
|
#include <AppCore/JSHelpers.h>
JSObject wrapper that automatically manages lifetime and provides convenient access to properties.
Public Member Functions | |
JSObject () | |
Create empty Object. | |
JSObject (JSObjectRef obj) | |
Create from existing JSObjectRef from JavaScriptCore C API. | |
JSObject (const JSObject &other) | |
Copy constructor (shallow copy, will point to same instance) | |
~JSObject () | |
JSObject & | operator= (const JSObject &other) |
Assignment (shallow assignment, will point to same instance) | |
JSPropertyValue | operator[] (JSString propertyName) const |
Get a property by name. | |
bool | HasProperty (JSString propertyName) const |
Check if a property exists. | |
bool | DeleteProperty (JSString propertyName) |
Remove a property. | |
operator JSObjectRef () const | |
Get the underlying JSObjectRef (JavaScriptCore C API) | |
JSContextRef | context () const |
Get the bound context for this JSObject (it is cached at creation). | |
void | set_context (JSContextRef context) |
Set the JSContext for this JSObject. | |
Protected Member Functions | |
JSObject (JSContextRef ctx, JSValueRef val) | |
JSObject (JSContextRef ctx, JSObjectRef obj) | |
Protected Attributes | |
JSContextRef | ctx_ |
JSObjectRef | instance_ |
Friends | |
class | JSValue |
class | JSPropertyValue |
JSObject | ( | ) |
Create empty Object.
JSObject | ( | JSObjectRef | obj | ) |
Create from existing JSObjectRef from JavaScriptCore C API.
~JSObject | ( | ) |
|
protected |
|
protected |
|
inline |
Get the bound context for this JSObject (it is cached at creation).
bool DeleteProperty | ( | JSString | propertyName | ) |
Remove a property.
bool HasProperty | ( | JSString | propertyName | ) | const |
Check if a property exists.
|
inline |
Get the underlying JSObjectRef (JavaScriptCore C API)
Assignment (shallow assignment, will point to same instance)
JSPropertyValue operator[] | ( | JSString | propertyName | ) | const |
Get a property by name.
|
inline |
Set the JSContext for this JSObject.
|
friend |
|
friend |
|
protected |
|
protected |