Public Member Functions | Private Attributes | List of all members
nom::JSON::Value Class Reference

Interface class for JSON data types. More...

#include <Value.hpp>

Collaboration diagram for nom::JSON::Value:
[legend]

Public Member Functions

 Value (const Value &copy)
 Copy constructor.
 
Value & operator= (const ValueType &other)
 Copy assignment operator.
 
ValueType & get (void) const
 Obtain the underlying container of this object.
 
uint32 size (void) const
 
JSONValueType type (void) const
 
JSONValueType type (int index) const
 
JSONValueType type (const std::string &key, int index) const
 
JSONMemberType members (int index) const
 
int get_int (int index)
 
std::vector< int > get_ints (const std::string &key, int index)
 Get signed integer array values by key, index.
 
int get_int (const std::string &key, int index)
 
uint get_uint (int index)
 
std::vector< uint > get_uints (int index)
 Get unsigned integer array values by index.
 
uint get_uint (const std::string &key)
 
const char * c_str (int index)
 
std::string get_string (int index)
 
std::vector< std::string > get_strings (int index)
 Get C++ string array values by index.
 
const char * c_str (const std::string &key)
 
std::string get_string (const std::string &key, int index)
 
bool get_bool (int index)
 
std::vector< bool > get_bools (int index)
 Get bool array values by index.
 
bool get_bool (const std::string &key)
 
ValueType value (int index)
 
std::vector< ValueType > values (int index)
 
ValueType value (const std::string &key)
 
void insert (const std::string &key, int index)
 
void insert (const std::string &key, int value, int index)
 
void insert (const std::string &key, std::vector< int > values)
 
void insert (const std::string &key, uint value, int index)
 
void insert (const std::string &key, const std::vector< uint > &values)
 
void insert (const std::string &key, double value, int index)
 
void insert (const std::string &key, float value, int index)
 
void insert (const std::string &key, const char *value, int index)
 
void insert (const std::string &key, const std::string &value, int index)
 
void insert (const std::string &key, const std::vector< std::string > &values)
 
void insert (const std::string &key, bool value, int index)
 
void insert (const std::string &key, const std::vector< ValueType > &values)
 

Private Attributes

ValueType object_
 
std::string key_
 Identifying access string for an object node.
 

Detailed Description

Interface class for JSON data types.

[TO BE WRITTEN]

See nom::SpriteSheet source for usage examples!

Definition at line 45 of file Value.hpp.

Member Function Documentation

void nom::JSON::Value::insert ( const std::string &  key,
int  index 
)

JSON NULL

Note
Type 0 – Json::nullValue

Definition at line 192 of file Value.cpp.

Here is the caller graph for this function:

void nom::JSON::Value::insert ( const std::string &  key,
int  value,
int  index 
)

JSON signed integer

Note
Type 1 – Json::intValue

Definition at line 197 of file Value.cpp.

void nom::JSON::Value::insert ( const std::string &  key,
uint  value,
int  index 
)

JSON unsigned integer

Note
Type 2 – Json::uintValue

Definition at line 210 of file Value.cpp.

void nom::JSON::Value::insert ( const std::string &  key,
double  value,
int  index 
)

JSON double

Note
Type 3 – Json::realValue

Definition at line 223 of file Value.cpp.

void nom::JSON::Value::insert ( const std::string &  key,
float  value,
int  index 
)

JSON float

Note
Type 3 – Json::realValue

Definition at line 228 of file Value.cpp.

void nom::JSON::Value::insert ( const std::string &  key,
const char *  value,
int  index 
)

JSON string (C string)

Note
Type 4 – Json::stringValue

Definition at line 233 of file Value.cpp.

void nom::JSON::Value::insert ( const std::string &  key,
const std::string &  value,
int  index 
)

JSON string (C++ string)

Note
Type 4 – Json::stringValue

Definition at line 238 of file Value.cpp.

void nom::JSON::Value::insert ( const std::string &  key,
bool  value,
int  index 
)

JSON boolean

Note
Type 5 – Json::booleanValue

Definition at line 253 of file Value.cpp.

void nom::JSON::Value::insert ( const std::string &  key,
const std::vector< ValueType > &  values 
)

JSON [...???...]

Note
Type [6||7] – Json::arrayValue || Json::objectValue

Definition at line 258 of file Value.cpp.

Member Data Documentation

ValueType nom::JSON::Value::object_
mutableprivate

Contents of a key

Mutable is a temporary workaround!

Definition at line 149 of file Value.hpp.


The documentation for this class was generated from the following files: