Honeycomb
0.1
Component-Model Framework
|
Json value variant. Provide a Config to customize the variant's bounded types. More...
#include <Json.h>
Public Types | |
typedef Config_ | Config |
typedef Config::Array | Array |
Json value array. More... | |
typedef Config::Object | Object |
Json object, map of json name/value pairs. May be ObjectUnordered (default) or ObjectOrdered depending on config. More... | |
typedef Config::ObjectUnordered | ObjectUnordered |
Object with unordered name/value pairs. More... | |
typedef Config::ObjectOrdered | ObjectOrdered |
Object with ordered name/value pairs. More... | |
typedef Config::Variant | Variant |
Base class, the underlying variant. More... | |
Public Member Functions | |
Value_ () | |
Construct with null value. More... | |
template<class T > | |
Value_ (T &&val) | |
Attempts to copy/move construct any json value type, otherwise first json value type constructible with val is set as the value. More... | |
Value_ (const Value_ &rhs) | |
Value_ (Value_ &rhs) | |
Value_ (Value_ &&rhs) | |
template<class T > | |
Value_ & | operator= (T &&val) |
Attempts to copy/move-assign any json value type, otherwise first json value type assignable to val is set as the value. More... | |
Value_ & | operator= (const Value_ &rhs) |
Value_ & | operator= (Value_ &rhs) |
Value_ & | operator= (Value_ &&rhs) |
Value_ & | operator[] (szt i) |
Get value at index in array. More... | |
const Value_ & | operator[] (szt i) const |
Value_ & | operator[] (const String &name) |
Get value with name in object. Adds null value if it doesn't exist. More... | |
Value_ & | operator[] (const Char *name) |
Value_ & | operator[] (const char *name) |
Value_ & | operator[] (const Id &id) |
Get value with id in object. Throws ValueError if it doesn't exist. More... | |
const Value_ & | operator[] (const Id &id) const |
Value_ & | operator[] (const IdLiteral &id) |
const Value_ & | operator[] (const IdLiteral &id) const |
ValueType | type () const |
Get active json value type. More... | |
Array::iterator | begin () |
Get iterator to first value in array. More... | |
Array::const_iterator | begin () const |
Get iterator to first value in array. More... | |
Array::iterator | end () |
Get iterator to position after the last value in array. More... | |
Array::const_iterator | end () const |
Get iterator to position after the last value in array. More... | |
Value_ & | front () |
Get first value in array. More... | |
const Value_ & | front () const |
Value_ & | back () |
Get last value in array. More... | |
const Value_ & | back () const |
template<class T > | |
void | push_back (T &&val) |
Create Value from val and add value to back of array. More... | |
void | pop_back () |
Remove last value from array. More... | |
bool | contains (const Id &id) |
Check if object contains value with id. More... | |
template<class T > | |
void | insert (szt i, T &&val) |
Create Value from val and insert value into array at index. More... | |
template<class T > | |
pair< typename Object::iterator, bool > | insert (const String &name, T &&val) |
Create Value from val and insert name/value pair into object. More... | |
void | erase (szt i) |
Erase value at index in array. More... | |
bool | erase (const Id &id) |
Erase value with id in object. Returns true if found and erased. More... | |
bool | erase (const IdLiteral &id) |
void | clear () |
Clear all values in array/object. More... | |
bool | empty () const |
Check if array/object contains any values. More... | |
szt | size () const |
Get number of values in array/object. More... | |
Json value variant. Provide a Config to customize the variant's bounded types.
typedef Config::Array honey::json::Value_< Config_ >::Array |
Json value array.
typedef Config_ honey::json::Value_< Config_ >::Config |
typedef Config::Object honey::json::Value_< Config_ >::Object |
Json object, map of json name/value pairs. May be ObjectUnordered (default) or ObjectOrdered depending on config.
typedef Config::ObjectOrdered honey::json::Value_< Config_ >::ObjectOrdered |
Object with ordered name/value pairs.
typedef Config::ObjectUnordered honey::json::Value_< Config_ >::ObjectUnordered |
Object with unordered name/value pairs.
typedef Config::Variant honey::json::Value_< Config_ >::Variant |
Base class, the underlying variant.
|
inline |
Construct with null value.
|
inline |
Attempts to copy/move construct any json value type, otherwise first json value type constructible with val
is set as the value.
|
inline |
|
inline |
|
inline |
|
inline |
Get last value in array.
|
inline |
|
inline |
Get iterator to first value in array.
|
inline |
Get iterator to first value in array.
|
inline |
Clear all values in array/object.
|
inline |
Check if object contains value with id.
|
inline |
Check if array/object contains any values.
|
inline |
Get iterator to position after the last value in array.
|
inline |
Get iterator to position after the last value in array.
|
inline |
Erase value at index in array.
|
inline |
Erase value with id in object. Returns true if found and erased.
|
inline |
|
inline |
Get first value in array.
|
inline |
|
inline |
Create Value from val
and insert value into array at index.
|
inline |
Create Value from val
and insert name/value pair into object.
pair-iter | iterator to new name/value pair in object on success, otherwise iterator to existing pair in object |
success | true if name is unique and value was inserted |
|
inline |
Attempts to copy/move-assign any json value type, otherwise first json value type assignable to val
is set as the value.
|
inline |
|
inline |
|
inline |
|
inline |
Get value at index in array.
|
inline |
|
inline |
Get value with name in object. Adds null value if it doesn't exist.
|
inline |
|
inline |
|
inline |
Get value with id in object. Throws ValueError if it doesn't exist.
|
inline |
|
inline |
|
inline |
|
inline |
Remove last value from array.
|
inline |
Create Value from val
and add value to back of array.
|
inline |
Get number of values in array/object.
|
inline |
Get active json value type.