|
| JS_API | JsValue () |
| | Constructs a null value.
|
| |
| JS_API | JsValue (const JsObject &value) |
| | Constructs a value holding the given object.
|
| |
| JS_API | JsValue (JsObject &&value) |
| | Constructs a value holding the given object rvalue reference.
|
| |
| JS_API | JsValue (const JsArray &value) |
| | Constructs a value holding the given array.
|
| |
| JS_API | JsValue (JsArray &&value) |
| | Constructs a value holding the given array rvalue reference.
|
| |
| JS_API | JsValue (const char *value) |
| | Constructs a value holding the given char array as a std::string.
|
| |
| JS_API | JsValue (const std::string &value) |
| | Constructs a value holding the given std::string.
|
| |
| JS_API | JsValue (std::string &&value) |
| | Constructs a value holding the given std::string rvalue reference.
|
| |
| JS_API | JsValue (bool value) |
| | Constructs a value holding a bool.
|
| |
| JS_API | JsValue (int value) |
| | Constructs a value holding a signed integer.
|
| |
| JS_API | JsValue (int64_t value) |
| | Constructs a value holding a 64-bit signed integer.
|
| |
| JS_API | JsValue (uint64_t value) |
| | Constructs a value holding a 64-bit unsigned integer.
|
| |
| JS_API | JsValue (double value) |
| | Constructs a value holding a double.
|
| |
| JS_API const JsObject & | GetJsObject () const |
| | Returns the object held by this value.
|
| |
| JS_API const JsArray & | GetJsArray () const |
| | Returns the array held by this value.
|
| |
| JS_API const std::string & | GetString () const |
| | Returns the string held by this value.
|
| |
| JS_API bool | GetBool () const |
| | Returns the bool held by this value.
|
| |
| JS_API int | GetInt () const |
| | Returns the integer held by this value.
|
| |
| JS_API int64_t | GetInt64 () const |
| | Returns the 64-bit integer held by this value.
|
| |
| JS_API uint64_t | GetUInt64 () const |
| | Returns the 64-bit unsigned integer held by this value.
|
| |
| JS_API double | GetReal () const |
| | Returns the double held by this value.
|
| |
| template<typename T , typename ReturnType = typename std::conditional< std::is_same<T, JsObject>::value || std::is_same<T, JsArray>::value || std::is_same<T, std::string>::value, const T&, T>::type> |
| ReturnType | Get () const |
| | Returns the value corresponding to the C++ type specified in the template parameter if it is holding such a value.
|
| |
| template<typename T > |
| std::vector< T > | GetArrayOf () const |
| | Returns a vector holding the elements of this value's array that correspond to the C++ type specified as the template parameter.
|
| |
| JS_API Type | GetType () const |
| | Returns the type of this value.
|
| |
| JS_API std::string | GetTypeName () const |
| | Returns a display name for the type of this value.
|
| |
| JS_API bool | IsObject () const |
| | Returns true if this value is holding an object type.
|
| |
| JS_API bool | IsArray () const |
| | Returns true if this value is holding an array type.
|
| |
| JS_API bool | IsString () const |
| | Returns true if this value is holding a string type.
|
| |
| JS_API bool | IsBool () const |
| | Returns true if this value is holding a boolean type.
|
| |
| JS_API bool | IsInt () const |
| | Returns true if this value is holding an integer type.
|
| |
| JS_API bool | IsReal () const |
| | Returns true if this value is holding a real type.
|
| |
| JS_API bool | IsUInt64 () const |
| | Returns true if this value is holding a 64-bit unsigned integer.
|
| |
| template<typename T > |
| bool | Is () const |
| | Returns true if this value is holding a type that corresponds to the C++ type specified as the template parameter.
|
| |
| template<typename T > |
| bool | IsArrayOf () const |
| | Returns true if this value is holding an array whose elements all correspond to the C++ type specified as the template parameter.
|
| |
| JS_API bool | IsNull () const |
| | Returns true if this value is null, false otherwise.
|
| |
| JS_API | operator bool () const |
| | Evaluates to true if this value is not null.
|
| |
| JS_API bool | operator== (const JsValue &other) const |
| | Returns true of both values hold the same type and the underlying held values are equal.
|
| |
| JS_API bool | operator!= (const JsValue &other) const |
| | Returns true if values are of different type, or the underlying held values are not equal.
|
| |
A discriminated union type for JSON values.
A JsValue may contain one of the following types:
- JsObject, a dictionary type
- JsArray, a vector type
- std::string
- bool
- int64_t
- uint64_t
- double
- null
Definition at line 46 of file value.h.
template<typename T , typename ReturnType = typename std::conditional< std::is_same<T, JsObject>::value || std::is_same<T, JsArray>::value || std::is_same<T, std::string>::value, const T&, T>::type>
Returns the value corresponding to the C++ type specified in the template parameter if it is holding such a value.
Calling this function with C++ type T is equivalent to calling the specific Get function above that returns a value or reference to a type T.
If a value corresponding to the C++ type is not being held, this method raises a coding error. See Get functions above for default value returned in this case.
Definition at line 152 of file value.h.