|
Evo C++ Library v0.5.1
|
#include <evo/var.h>

Explicit variant of Var used for initializing as an object with an initializer list of key/value pairs (C++11).
Classes | |
| struct | InitPair |
| Initializer key/value pair. More... | |
Public Types | |
| typedef List< Var > | ListType |
| Item list type. More... | |
| typedef MapList< String, Var > | ObjectType |
| Object map type. More... | |
| typedef SizeT | Size |
| Size type used. More... | |
| enum | Type { tOBJECT, tLIST, tSTRING, tFLOAT, tUNSIGNED, tINTEGER, tBOOL, tNULL } |
| Variable type. More... | |
Public Member Functions | |
| VarObject () | |
| Default constructor creates an empty object. More... | |
| VarObject (std::initializer_list< InitPair > init) | |
| Sequence constructor for object initializer. More... | |
| VarObject (VarObject &&src) | |
| Move constructor. More... | |
| VarObject (const VarObject &)=delete | |
| bool & | boolref () |
| Get bool reference, recreate as bool if needed. More... | |
| const Var * | child (const StringBase &key) const |
| Find child in object using key (const). More... | |
| const Var * | child (Size index) const |
| Find child in list using index (const). More... | |
| Var * | childM (const StringBase &key) |
| Find child in object using key (mutable). More... | |
| Var * | childM (Size index) |
| Find child in list using index (mutable). More... | |
| const Var & | childref (const StringBase &key) const |
| Get child in object using key, default to null instance (const). More... | |
| const Var & | childref (Size index) const |
| Get child in list using index, default to null instance (const). More... | |
| Var & | clear () |
| Clear current value. More... | |
| template<class T > | |
| T & | dump (T &out, const NewlineValue &newline=NL, uint indent=0) const |
| Dump all children and values to stream or string. More... | |
| bool | empty () const |
| Get whether empty. More... | |
| bool | get_bool () const |
| Get boolean value (const). More... | |
| double | get_float () const |
| Get value as a floating-point number (const). More... | |
| int64 | get_int () const |
| Get signed integer number value (const). More... | |
| const ListType & | get_list () const |
| Get read-only list reference (const). More... | |
| const ObjectType & | get_object () const |
| Get read-only object reference (const). More... | |
| const String & | get_str () const |
| Get read-only string value reference (const). More... | |
| uint64 | get_uint () const |
| Get unsigned integer number value (const). More... | |
| bool | get_val (String &val) const |
| Get value as a string (const). More... | |
| bool | is_bool () const |
| Get whether a boolean type (tBOOL). More... | |
| bool | is_container () const |
| Get whether a container type (object or list). More... | |
| bool | is_float () const |
| Get whether a floating-point number type (tFLOAT). More... | |
| bool | is_integer () const |
| Get whether an integer number type (tUNSIGNED or tINTEGER). More... | |
| bool | is_list () const |
| Get whether a list type (tLIST). More... | |
| bool | is_number () const |
| Get whether a number type (tFLOAT, tUNSIGNED, tINTEGER). More... | |
| bool | is_object () const |
| Get whether an object type (tOBJECT). More... | |
| bool | is_signed () const |
| Get whether a signed integer number type (tINTEGER). More... | |
| bool | is_string () const |
| Get whether a string type (tSTRING). More... | |
| bool | is_unsigned () const |
| Get whether an unsigned integer number type (tUNSIGNED). More... | |
| ListType & | list () |
| Get list reference, recreate as list if needed. More... | |
| bool | null () const |
| Get whether null. More... | |
| double & | numf () |
| Get floating-point number reference, recreate as floating-point if needed. More... | |
| int64 & | numi () |
| Get signed integer number reference, recreate as signed integer if not an integer. More... | |
| uint64 & | numu () |
| Get unsigned integer number reference, recreate as unsigned integer if not an integer. More... | |
| ObjectType & | object () |
| Get object reference, recreate as object if needed. More... | |
| Var & | operator= (VarObject &&src) |
| Move assignment operator. More... | |
| VarObject & | operator= (const VarObject &)=delete |
| Var & | operator[] (const StringBase &key) |
| Object field access operator. More... | |
| Var & | operator[] (Size index) |
| List item access operator. More... | |
| Var & | set () |
| Set as null type/value. More... | |
| bool | shared () const |
| Get whether this has shared data. More... | |
| bool | shared_scan () const |
| Get whether this or any nested key or value has any shared data. More... | |
| Size | size () const |
| Get size as number of children. More... | |
| String & | string () |
| Get string reference, recreate as string if needed. More... | |
| Type | type () const |
| Get current type. More... | |
| Var & | unshare () |
| Unshare current value. More... | |
| Var & | unshare_all () |
| Unshare current value and all nested objects, lists, and strings. More... | |
|
inherited |
Object map type.
|
inherited |
|
inline |
Default constructor creates an empty object.
Sequence constructor for object initializer.
| init | Initializer list of key/value pairs, each key/value pair is a nested intializer list with 2 items (key and value, where key is a string) |
|
inlineinherited |
Get bool reference, recreate as bool if needed.
|
inlineinherited |
Find child in object using key (const).
Find child in list using index (const).
|
inlineinherited |
Find child in object using key (mutable).
Find child in list using index (mutable).
|
inlineinherited |
Get child in object using key, default to null instance (const).
Get child in list using index, default to null instance (const).
|
inlineinherited |
Clear current value.
|
inlineinherited |
Dump all children and values to stream or string.
| T | Output string or stream type – inferred from out argument, usually String, Stream, or StreamOut |
| out | Stream or string to dump (write) to |
| newline | Newline type to use, NL for default |
| indent | Starting space indent count, usually 0 |
out param
|
inlineinherited |
Get whether empty.
|
inlineinherited |
Get boolean value (const).
|
inlineinherited |
Get value as a floating-point number (const).
|
inlineinherited |
Get signed integer number value (const).
|
inlineinherited |
Get read-only list reference (const).
|
inlineinherited |
Get read-only object reference (const).
|
inlineinherited |
Get read-only string value reference (const).
|
inlineinherited |
Get unsigned integer number value (const).
|
inlineinherited |
Get value as a string (const).
operator=() – see Sharing| val | Stores result string value on success, set to null if current value is null (including null object/list) [out] |
|
inlineinherited |
Get whether a boolean type (tBOOL).
|
inlineinherited |
Get whether a container type (object or list).
|
inlineinherited |
Get whether a floating-point number type (tFLOAT).
|
inlineinherited |
Get whether an integer number type (tUNSIGNED or tINTEGER).
|
inlineinherited |
Get whether a list type (tLIST).
|
inlineinherited |
Get whether a number type (tFLOAT, tUNSIGNED, tINTEGER).
|
inlineinherited |
Get whether an object type (tOBJECT).
|
inlineinherited |
Get whether a signed integer number type (tINTEGER).
|
inlineinherited |
Get whether a string type (tSTRING).
|
inlineinherited |
Get whether an unsigned integer number type (tUNSIGNED).
|
inlineinherited |
Get list reference, recreate as list if needed.
|
inlineinherited |
Get whether null.
|
inlineinherited |
Get floating-point number reference, recreate as floating-point if needed.
|
inlineinherited |
Get signed integer number reference, recreate as signed integer if not an integer.
|
inlineinherited |
Get unsigned integer number reference, recreate as unsigned integer if not an integer.
|
inlineinherited |
Get object reference, recreate as object if needed.
Move assignment operator.
| src | Source to move from |
|
inlineinherited |
Object field access operator.
key, creating a new value if it doesn't exist| key | Field key to use |
List item access operator.
index, creating a new value if it doesn't exist| index | Item index to use |
|
inlineinherited |
Set as null type/value.
|
inlineinherited |
Get whether this has shared data.
|
inlineinherited |
Get whether this or any nested key or value has any shared data.
|
inlineinherited |
Get size as number of children.
|
inlineinherited |
Get string reference, recreate as string if needed.
|
inlineinherited |
Get current type.
|
inlineinherited |
Unshare current value.
|
inlineinherited |
Unshare current value and all nested objects, lists, and strings.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
1.8.13