![]() |
Ultralight C++ API 1.3.0
|
#include <AppCore/JSHelpers.h>
A vector of JSValues, used for passing around arguments in JSCallback.
Public Member Functions | |
| JSArgs () | |
| Create an empty list of JavaScript arguments. | |
| JSArgs (const std::initializer_list< JSValue > &values) | |
| Create a list of JavaScript arguments using a C++ initializer list. | |
| JSArgs (const JSArgs &other) | |
| Copy-constructor. | |
| ~JSArgs () | |
| Destructor. | |
| JSArgs & | operator= (const JSArgs &other) |
| Assignment operator. | |
| JSValue | operator[] (size_t pos) |
| Access an element of the argument list by index. | |
| const JSValue | operator[] (size_t pos) const |
| Access an element of the argument list by index. | |
| bool | empty () const |
| Whether or not the argument list is empty. | |
| size_t | size () const |
| The number of elements in the argument list. | |
| void | clear () |
| Clear the argument list. | |
| void | push_back (const JSValue &val) |
| Add a new argument to the end of the list. | |
| void | pop_back () |
| Remove the last item from the end of the list. | |
| JSValue * | data () |
| Get the argument list as a C-array of JSValues. | |
| const JSValue * | data () const |
| Get the argument list as a C-array of JSValues (const overload) | |
Protected Attributes | |
| void * | instance_ |
| ultralight::JSArgs::JSArgs | ( | ) |
Create an empty list of JavaScript arguments.
| ultralight::JSArgs::JSArgs | ( | const std::initializer_list< JSValue > & | values | ) |
Create a list of JavaScript arguments using a C++ initializer list.
| ultralight::JSArgs::JSArgs | ( | const JSArgs & | other | ) |
Copy-constructor.
| ultralight::JSArgs::~JSArgs | ( | ) |
Destructor.
| void ultralight::JSArgs::clear | ( | ) |
Clear the argument list.
| JSValue * ultralight::JSArgs::data | ( | ) |
Get the argument list as a C-array of JSValues.
| const JSValue * ultralight::JSArgs::data | ( | ) | const |
Get the argument list as a C-array of JSValues (const overload)
| bool ultralight::JSArgs::empty | ( | ) | const |
Whether or not the argument list is empty.
| JSValue ultralight::JSArgs::operator[] | ( | size_t | pos | ) |
Access an element of the argument list by index.
Note: All JSValues are actually wrappers of JSValueRef instances so even though this function doesn't return a JSValue& you are still operating directly on the underlying JavaScript value instance.
| const JSValue ultralight::JSArgs::operator[] | ( | size_t | pos | ) | const |
Access an element of the argument list by index.
(const overload)
Note: All JSValues are actually wrappers of JSValueRef instances so even though this function doesn't return a JSValue& you are still operating directly on the underlying JavaScript value instance.
| void ultralight::JSArgs::pop_back | ( | ) |
Remove the last item from the end of the list.
| void ultralight::JSArgs::push_back | ( | const JSValue & | val | ) |
Add a new argument to the end of the list.
| size_t ultralight::JSArgs::size | ( | ) | const |
The number of elements in the argument list.
|
protected |