29#ifndef NOMLIB_SYSTEM_PTREE_VALUE_HPP
30#define NOMLIB_SYSTEM_PTREE_VALUE_HPP
35#include "nomlib/config.hpp"
36#include "nomlib/ptree/ptree_config.hpp"
37#include "nomlib/ptree/ptree_types.hpp"
45 typedef Value SelfType;
46 typedef Value* RawPtr;
47 typedef Value& Reference;
55 typedef std::vector<std::string> Members;
274 const std::string stringify()
const;
323 bool array_valid()
const;
324 bool object_valid()
const;
458 Value::ConstIterator
begin()
const;
460 Value::ConstIterator
end()
const;
488 const std::string
dump(
const Value&
object,
int depth = 0)
const;
535std::ostream& operator <<(std::ostream& os,
const Value& val);
Read-only iteration for nom::Value.
Generic interface for opaque data containers.
void clear()
Remove all array and object members.
Value::Iterator begin()
Iterator access to the beginning of the object's tree.
Value()
Default constructor; constructs an object with NullValue data type.
const Value & operator[](ArrayIndex index) const
Obtain a stored element by index number.
ValueType
Supported data types able to be held inside the object.
ValueHolder value_
The stored value in this instance.
Value(const std::string &str)
Construct an object from a C++ string value (std::string).
Value(const Object &obj)
Construct an object with either array or object node values.
const Value & operator[](int index) const
bool operator==(const Value &rhs) const
Equality comparison operator.
Value(ValueType type)
Construct a Value container node of a specified type.
Value & operator[](int index)
const Value & find(const std::string &key) const
Search the object for an existing member.
Value::SelfType & operator=(const SelfType &rhs)
Copy assignment operator.
enum Value::ValueType type() const
Obtain the enumeration type of the object.
void swap(Value &rhs)
Exchange the contents of the container; copy & swap idiom.
const std::string type_name() const
Obtain the enumeration type of the object as a std::string.
const Object array() const
Obtain the array values of the object.
nom::size_type size() const
Obtain the size of the object's contained values.
bool float_type() const
Query if the value type type stored in the object is a double- precision floating point real number.
Value(bool val)
Construct an object from a boolean value.
Value & push_back(const Value &val)
Insert array elements.
bool array_type() const
Query if the value type type stored in the object are array values.
const char * get_cstring() const
Obtain the C style string value stored within the container.
Value(const char *str)
Construct an object from a C-style string value.
Value::Iterator end()
Iterator access to the end of the object's tree.
Value::Reference ref()
Obtain a reference to the object.
bool operator<(const Value &rhs) const
Lesser than comparison operator.
bool uint_type() const
Query if the value type type stored in the object is an unsigned integer (non-negative.
Members member_names() const
Remove an array object.
const Object object() const
Obtain the object tree of the object.
Value::RawPtr get()
Obtain a pointer to the object.
bool operator>=(const Value &rhs) const
Greater than or equal to comparison operator.
Value(const Value &rhs)
Copy constructor.
bool string_type() const
Query if the value type type stored in the object is a string value.
const std::string dump_value(const Value &val) const
Internal helper method for nom::Value::dump.
int get_int() const
Obtain the signed integer value stored within the container.
const std::string print_value(const std::string &val) const
Internal helper method for nom::Value::dump_value.
bool operator>(const Value &rhs) const
Greater than or equal to comparison operator.
real64 get_double() const
Obtain the double-precision floating point "real" number value stored within the container.
Value(int val)
Construct an object using a signed integer value.
const std::string print_key(const std::string &type, uint size) const
Internal helper method for nom::Value::dump_key.
Value(real64 val)
Construct an object using a double-precision floating point "real" number value.
std::string get_string() const
Obtain the string value stored within the container.
bool operator!() const
Returns Value::null.
enum ValueType type_
The type of stored value in this instance.
const std::string dump_key(const Value &key) const
Internal helper method for nom::Value::dump.
bool double_type() const
Query if the value type type stored in the object is a double- precision floating point real number.
bool empty() const
Obtain boolean response in regards to container's empty status.
Value & operator[](ArrayIndex index)
Obtain a stored element by index number.
bool bool_type() const
Query if the value type type stored in the object is a boolean value.
Value erase(const std::string &key)
Remove the named member.
bool object_type() const
Query if the value type type stored in the object are object values.
bool get_bool() const
Obtain the boolean value stored within the container.
const std::string dump(const Value &object, int depth=0) const
Dump the object's complete value tree.
uint get_uint() const
Obtain the unsigned (non-negative) integer value stored within the container.
bool operator<=(const Value &rhs) const
Lesser than or equal to comparison operator.
Value(uint val)
Construct an object using an unsigned (non-negative) integer value.
real32 get_float() const
Obtain the double-precision floating point "real" number value stored within the container.
bool operator!=(const Value &rhs) const
Not equal comparison operator.
int compare(const Value &rhs) const
Internal helper method for comparing array & object node containers.
bool int_type() const
Query if the value type type stored in the object is a signed integer.
static const Value & null
Declared value of Null for this object.
bool null_type() const
Query if the value type type stored in the object is NULL.
Value & operator[](const char *key)
Access an object node's container.
Container for the data types able to be held.