![]() |
nomlib
|
Generic interface for opaque data containers. More...
#include <Value.hpp>
Classes | |
| union | ValueHolder |
| Container for the data types able to be held. More... | |
Public Types | |
| enum | ValueType { Null = 0 , SignedInteger , UnsignedInteger , RealNumber , String , Boolean , ArrayValues , ObjectValues } |
| Supported data types able to be held inside the object. More... | |
| typedef Value | SelfType |
| typedef Value * | RawPtr |
| typedef Value & | Reference |
| typedef ValueConstIterator | ConstIterator |
| typedef ValueIterator | Iterator |
| typedef std::vector< std::string > | Members |
Public Member Functions | |
| Value () | |
| Default constructor; constructs an object with NullValue data type. | |
| Value (int val) | |
| Construct an object using a signed integer value. | |
| Value (uint val) | |
| Construct an object using an unsigned (non-negative) integer value. | |
| Value (real64 val) | |
| Construct an object using a double-precision floating point "real" number value. | |
| Value (const char *str) | |
| Construct an object from a C-style string value. | |
| Value (const std::string &str) | |
| Construct an object from a C++ string value (std::string). | |
| Value (bool val) | |
| Construct an object from a boolean value. | |
| Value (const Object &obj) | |
| Construct an object with either array or object node values. | |
| Value (ValueType type) | |
| Construct a Value container node of a specified type. | |
| Value (const Value &rhs) | |
| Copy constructor. | |
| Value::SelfType & | operator= (const SelfType &rhs) |
| Copy assignment operator. | |
| void | swap (Value &rhs) |
| Exchange the contents of the container; copy & swap idiom. | |
| bool | operator< (const Value &rhs) const |
| Lesser than comparison operator. | |
| bool | operator<= (const Value &rhs) const |
| Lesser than or equal to comparison operator. | |
| bool | operator>= (const Value &rhs) const |
| Greater than or equal to comparison operator. | |
| bool | operator> (const Value &rhs) const |
| Greater than or equal to comparison operator. | |
| bool | operator== (const Value &rhs) const |
| Equality comparison operator. | |
| bool | operator!= (const Value &rhs) const |
| Not equal comparison operator. | |
| bool | operator! () const |
| Returns Value::null. | |
| int | compare (const Value &rhs) const |
| Internal helper method for comparing array & object node containers. | |
| Value::RawPtr | get () |
| Obtain a pointer to the object. | |
| Value::Reference | ref () |
| Obtain a reference to the object. | |
| enum Value::ValueType | type () const |
| Obtain the enumeration type of the object. | |
| const std::string | type_name () const |
| Obtain the enumeration type of the object as a std::string. | |
| bool | null_type () const |
| Query if the value type type stored in the object is NULL. | |
| bool | int_type () const |
| Query if the value type type stored in the object is a signed integer. | |
| bool | uint_type () const |
| Query if the value type type stored in the object is an unsigned integer (non-negative. | |
| bool | double_type () const |
| Query if the value type type stored in the object is a double- precision floating point real number. | |
| bool | float_type () const |
| Query if the value type type stored in the object is a double- precision floating point real number. | |
| bool | string_type () const |
| Query if the value type type stored in the object is a string value. | |
| bool | bool_type () const |
| Query if the value type type stored in the object is a boolean value. | |
| bool | array_type () const |
| Query if the value type type stored in the object are array values. | |
| bool | object_type () const |
| Query if the value type type stored in the object are object values. | |
| const std::string | stringify () const |
| int | get_int () const |
| Obtain the signed integer value stored within the container. | |
| uint | get_uint () const |
| Obtain the unsigned (non-negative) integer value stored within the container. | |
| real64 | get_double () const |
| Obtain the double-precision floating point "real" number value stored within the container. | |
| real32 | get_float () const |
| Obtain the double-precision floating point "real" number value stored within the container. | |
| const char * | get_cstring () const |
| Obtain the C style string value stored within the container. | |
| std::string | get_string () const |
| Obtain the string value stored within the container. | |
| bool | get_bool () const |
| Obtain the boolean value stored within the container. | |
| bool | array_valid () const |
| bool | object_valid () const |
| const Object | array () const |
| Obtain the array values of the object. | |
| const Object | object () const |
| Obtain the object tree of the object. | |
| nom::size_type | size () const |
| Obtain the size of the object's contained values. | |
| bool | empty () const |
| Obtain boolean response in regards to container's empty status. | |
| void | clear () |
| Remove all array and object members. | |
| Value & | operator[] (ArrayIndex index) |
| Obtain a stored element by index number. | |
| Value & | operator[] (int index) |
| const Value & | operator[] (ArrayIndex index) const |
| Obtain a stored element by index number. | |
| const Value & | operator[] (int index) const |
| Value & | operator[] (const char *key) |
| Access an object node's container. | |
| Value & | operator[] (const std::string &key) |
| const Value & | operator[] (const char *key) const |
| const Value & | operator[] (const std::string &key) const |
| Value & | push_back (const Value &val) |
| Insert array elements. | |
| const Value & | find (const std::string &key) const |
| Search the object for an existing member. | |
| Value | erase (const std::string &key) |
| Remove the named member. | |
| Members | member_names () const |
| Remove an array object. | |
| Value::ConstIterator | begin () const |
| Value::ConstIterator | end () const |
| Value::Iterator | begin () |
| Iterator access to the beginning of the object's tree. | |
| Value::Iterator | end () |
| Iterator access to the end of the object's tree. | |
| const std::string | dump (const Value &object, int depth=0) const |
| Dump the object's complete value tree. | |
Static Public Attributes | |
| static const Value & | null |
| Declared value of Null for this object. | |
Private Member Functions | |
| const std::string | dump_key (const Value &key) const |
| Internal helper method for nom::Value::dump. | |
| const std::string | dump_value (const Value &val) const |
| Internal helper method for nom::Value::dump. | |
| const std::string | print_key (const std::string &type, uint size) const |
| Internal helper method for nom::Value::dump_key. | |
| const std::string | print_value (const std::string &val) const |
| Internal helper method for nom::Value::dump_value. | |
Private Attributes | |
| enum ValueType | type_ |
| The type of stored value in this instance. | |
| ValueHolder | value_ |
| The stored value in this instance. | |
Generic interface for opaque data containers.
Inspired by Apple's PropertyList API & made possible by JSONCPP, ...
[STUB]
References (class design & inspiration):
JSON RFC json_spirit jsoncpp cijson (of the Cinder engine) Boost::PropertyTree Apple's PropertyList (.plist)
| typedef ValueConstIterator nom::Value::ConstIterator |
| typedef ValueIterator nom::Value::Iterator |
Supported data types able to be held inside the object.
| nom::Value::Value | ( | int | val | ) |
Construct an object using a signed integer value.
| nom::Value::Value | ( | uint | val | ) |
Construct an object using an unsigned (non-negative) integer value.
| nom::Value::Value | ( | real64 | val | ) |
Construct an object using a double-precision floating point "real" number value.
| nom::Value::Value | ( | const char * | str | ) |
Construct an object from a C-style string value.
| nom::Value::Value | ( | const std::string & | str | ) |
Construct an object from a C++ string value (std::string).
| nom::Value::Value | ( | bool | val | ) |
Construct an object from a boolean value.
| nom::Value::Value | ( | const Object & | obj | ) |
Construct an object with either array or object node values.
| const Object nom::Value::array | ( | ) | const |
Obtain the array values of the object.
| bool nom::Value::array_type | ( | ) | const |
Query if the value type type stored in the object are array values.
| Value::Iterator nom::Value::begin | ( | ) |
Iterator access to the beginning of the object's tree.
| void nom::Value::clear | ( | ) |
Remove all array and object members.
| int nom::Value::compare | ( | const Value & | rhs | ) | const |
Internal helper method for comparing array & object node containers.
| const std::string nom::Value::dump | ( | const Value & | object, |
| int | depth = 0 ) const |
Dump the object's complete value tree.
| bool nom::Value::empty | ( | ) | const |
Obtain boolean response in regards to container's empty status.
| Value::Iterator nom::Value::end | ( | ) |
Iterator access to the end of the object's tree.
| Value nom::Value::erase | ( | const std::string & | key | ) |
Remove the named member.
| const Value & nom::Value::find | ( | const std::string & | key | ) | const |
Search the object for an existing member.
| Value::RawPtr nom::Value::get | ( | ) |
Obtain a pointer to the object.
| bool nom::Value::get_bool | ( | ) | const |
Obtain the boolean value stored within the container.
| const char * nom::Value::get_cstring | ( | ) | const |
Obtain the C style string value stored within the container.
| real64 nom::Value::get_double | ( | ) | const |
Obtain the double-precision floating point "real" number value stored within the container.
| real32 nom::Value::get_float | ( | ) | const |
Obtain the double-precision floating point "real" number value stored within the container.
| int nom::Value::get_int | ( | ) | const |
Obtain the signed integer value stored within the container.
| std::string nom::Value::get_string | ( | ) | const |
Obtain the string value stored within the container.
| uint nom::Value::get_uint | ( | ) | const |
Obtain the unsigned (non-negative) integer value stored within the container.
| Members nom::Value::member_names | ( | ) | const |
Remove an array object.
Obtain the member names (keys) of each pair in this container.
| const Object nom::Value::object | ( | ) | const |
Obtain the object tree of the object.
| bool nom::Value::object_type | ( | ) | const |
Query if the value type type stored in the object are object values.
| bool nom::Value::operator! | ( | ) | const |
Returns Value::null.
| bool nom::Value::operator!= | ( | const Value & | rhs | ) | const |
Not equal comparison operator.
| bool nom::Value::operator< | ( | const Value & | rhs | ) | const |
Lesser than comparison operator.
| bool nom::Value::operator<= | ( | const Value & | rhs | ) | const |
Lesser than or equal to comparison operator.
| bool nom::Value::operator== | ( | const Value & | rhs | ) | const |
Equality comparison operator.
| bool nom::Value::operator> | ( | const Value & | rhs | ) | const |
Greater than or equal to comparison operator.
| bool nom::Value::operator>= | ( | const Value & | rhs | ) | const |
Greater than or equal to comparison operator.
| Value & nom::Value::operator[] | ( | ArrayIndex | index | ) |
Obtain a stored element by index number.
| val | Unsigned integer of the element's index to return. |
| const Value & nom::Value::operator[] | ( | ArrayIndex | index | ) | const |
Obtain a stored element by index number.
| val | Unsigned integer of the element's index to return. |
| Value & nom::Value::operator[] | ( | const char * | key | ) |
Access an object node's container.
| Value & nom::Value::operator[] | ( | int | index | ) |
| const Value & nom::Value::operator[] | ( | int | index | ) | const |
| Value::Reference nom::Value::ref | ( | ) |
Obtain a reference to the object.
| nom::size_type nom::Value::size | ( | ) | const |
Obtain the size of the object's contained values.
| void nom::Value::swap | ( | Value & | rhs | ) |
Exchange the contents of the container; copy & swap idiom.
| enum Value::ValueType nom::Value::type | ( | ) | const |
Obtain the enumeration type of the object.
| const std::string nom::Value::type_name | ( | ) | const |
Obtain the enumeration type of the object as a std::string.
|
static |
Declared value of Null for this object.
|
private |
|
private |