clanCore JSON

Classes

class  clan::JsonException
 Exception class thrown for JSON exceptions. More...
 
class  clan::JsonValue
 

Enumerations

enum  clan::JsonType {
  clan::JsonType::undefined, clan::JsonType::null, clan::JsonType::object, clan::JsonType::array,
  clan::JsonType::number, clan::JsonType::boolean, clan::JsonType::string
}
 

Functions

 clan::JsonException::JsonException (const std::string &message)
 
static JsonValue clan::JsonValue::array ()
 
JsonValue & clan::JsonValue::at (size_t index)
 
const JsonValue & clan::JsonValue::at (size_t index) const
 
static JsonValue clan::JsonValue::boolean (bool value)
 
void clan::JsonValue::clear ()
 
void clan::JsonValue::erase (size_t offset, size_t length)
 
bool clan::JsonValue::is_array () const
 
bool clan::JsonValue::is_boolean () const
 
bool clan::JsonValue::is_null () const
 
bool clan::JsonValue::is_number () const
 
bool clan::JsonValue::is_object () const
 
bool clan::JsonValue::is_undefined () const
 
std::vector< JsonValue > & clan::JsonValue::items ()
 
const std::vector< JsonValue > & clan::JsonValue::items () const
 
static JsonValue clan::JsonValue::null ()
 
static JsonValue clan::JsonValue::number (double value)
 
static JsonValue clan::JsonValue::number (float value)
 
static JsonValue clan::JsonValue::number (int value)
 
static JsonValue clan::JsonValue::number (unsigned int value)
 
static JsonValue clan::JsonValue::number (short value)
 
static JsonValue clan::JsonValue::number (unsigned short value)
 
static JsonValue clan::JsonValue::number (char value)
 
static JsonValue clan::JsonValue::number (unsigned char value)
 
static JsonValue clan::JsonValue::object ()
 
JsonValue & clan::JsonValue::operator[] (const std::string &name)
 
JsonValue & clan::JsonValue::operator[] (const char *name)
 
const JsonValue & clan::JsonValue::operator[] (const std::string &name) const
 
const JsonValue & clan::JsonValue::operator[] (const char *name) const
 
JsonValue & clan::JsonValue::operator[] (size_t index)
 
const JsonValue & clan::JsonValue::operator[] (size_t index) const
 
static JsonValue clan::JsonValue::parse (const std::string &json)
 
const JsonValue & clan::JsonValue::prop (const std::string &name) const
 
const JsonValue & clan::JsonValue::prop (const char *name) const
 
JsonValue & clan::JsonValue::prop (const std::string &name)
 
JsonValue & clan::JsonValue::prop (const char *name)
 
std::map< std::string,
JsonValue > & 
clan::JsonValue::properties ()
 
const std::map< std::string,
JsonValue > & 
clan::JsonValue::properties () const
 
void clan::JsonValue::remove (const std::string &name)
 
void clan::JsonValue::remove (const char *name)
 
void clan::JsonValue::set_array ()
 
void clan::JsonValue::set_boolean (bool v)
 
void clan::JsonValue::set_null ()
 
void clan::JsonValue::set_number (double v)
 
void clan::JsonValue::set_number (float v)
 
void clan::JsonValue::set_number (int v)
 
void clan::JsonValue::set_number (unsigned int v)
 
void clan::JsonValue::set_number (short v)
 
void clan::JsonValue::set_number (unsigned short v)
 
void clan::JsonValue::set_number (char v)
 
void clan::JsonValue::set_number (unsigned char v)
 
void clan::JsonValue::set_object ()
 
void clan::JsonValue::set_string (const std::string &v)
 
void clan::JsonValue::set_string (const char *v)
 
void clan::JsonValue::set_undefined ()
 
size_t clan::JsonValue::size () const
 
static JsonValue clan::JsonValue::string (const std::string &value)
 
bool clan::JsonValue::to_boolean () const
 
char clan::JsonValue::to_char () const
 
double clan::JsonValue::to_double () const
 
float clan::JsonValue::to_float () const
 
int clan::JsonValue::to_int () const
 
std::string clan::JsonValue::to_json () const
 
double clan::JsonValue::to_number () const
 
short clan::JsonValue::to_short () const
 
const std::string & clan::JsonValue::to_string () const
 
unsigned char clan::JsonValue::to_uchar () const
 
unsigned int clan::JsonValue::to_uint () const
 
unsigned short clan::JsonValue::to_ushort () const
 
JsonType clan::JsonValue::type () const
 
static JsonValue clan::JsonValue::undefined ()
 

Detailed Description

Enumeration Type Documentation

enum clan::JsonType
strong
Enumerator
undefined 
null 
object 
array 
number 
boolean 
string 

Function Documentation

clan::JsonException::JsonException ( const std::string message)
inline
static JsonValue clan::JsonValue::array ( )
inlinestatic

References clan::array, and clan::v.

Referenced by clan::JsonValue::set_array().

JsonValue& clan::JsonValue::at ( size_t  index)
inline
const JsonValue& clan::JsonValue::at ( size_t  index) const
inline
static JsonValue clan::JsonValue::boolean ( bool  value)
inlinestatic

References clan::boolean, and clan::v.

Referenced by clan::JsonValue::set_boolean().

void clan::JsonValue::clear ( )
inline
void clan::JsonValue::erase ( size_t  offset,
size_t  length 
)
inline

References clan::length.

bool clan::JsonValue::is_array ( ) const
inline
bool clan::JsonValue::is_boolean ( ) const
inline
bool clan::JsonValue::is_null ( ) const
inline
bool clan::JsonValue::is_number ( ) const
inline
bool clan::JsonValue::is_object ( ) const
inline
bool clan::JsonValue::is_undefined ( ) const
inline
std::vector<JsonValue>& clan::JsonValue::items ( )
inline
const std::vector<JsonValue>& clan::JsonValue::items ( ) const
inline
static JsonValue clan::JsonValue::null ( )
inlinestatic

References clan::null, and clan::v.

Referenced by clan::JsonValue::set_null().

static JsonValue clan::JsonValue::number ( double  value)
inlinestatic
static JsonValue clan::JsonValue::number ( float  value)
inlinestatic
static JsonValue clan::JsonValue::number ( int  value)
inlinestatic
static JsonValue clan::JsonValue::number ( unsigned int  value)
inlinestatic
static JsonValue clan::JsonValue::number ( short  value)
inlinestatic
static JsonValue clan::JsonValue::number ( unsigned short  value)
inlinestatic
static JsonValue clan::JsonValue::number ( char  value)
inlinestatic
static JsonValue clan::JsonValue::number ( unsigned char  value)
inlinestatic
static JsonValue clan::JsonValue::object ( )
inlinestatic

References clan::object, and clan::v.

Referenced by clan::JsonValue::set_object().

JsonValue& clan::JsonValue::operator[] ( const std::string name)
inline
JsonValue& clan::JsonValue::operator[] ( const char *  name)
inline
const JsonValue& clan::JsonValue::operator[] ( const std::string name) const
inline
const JsonValue& clan::JsonValue::operator[] ( const char *  name) const
inline
JsonValue& clan::JsonValue::operator[] ( size_t  index)
inline

References clan::JsonValue::at().

const JsonValue& clan::JsonValue::operator[] ( size_t  index) const
inline

References clan::JsonValue::at().

static JsonValue clan::JsonValue::parse ( const std::string json)
static
const JsonValue& clan::JsonValue::prop ( const std::string name) const
inline
const JsonValue& clan::JsonValue::prop ( const char *  name) const
inline
JsonValue& clan::JsonValue::prop ( const std::string name)
inline
JsonValue& clan::JsonValue::prop ( const char *  name)
inline
std::map<std::string, JsonValue>& clan::JsonValue::properties ( )
inline
const std::map<std::string, JsonValue>& clan::JsonValue::properties ( ) const
inline
void clan::JsonValue::remove ( const std::string name)
inline
void clan::JsonValue::remove ( const char *  name)
inline
void clan::JsonValue::set_array ( )
inline
void clan::JsonValue::set_boolean ( bool  v)
inline
void clan::JsonValue::set_null ( )
inline
void clan::JsonValue::set_number ( double  v)
inline
void clan::JsonValue::set_number ( float  v)
inline
void clan::JsonValue::set_number ( int  v)
inline
void clan::JsonValue::set_number ( unsigned int  v)
inline
void clan::JsonValue::set_number ( short  v)
inline
void clan::JsonValue::set_number ( unsigned short  v)
inline
void clan::JsonValue::set_number ( char  v)
inline
void clan::JsonValue::set_number ( unsigned char  v)
inline
void clan::JsonValue::set_object ( )
inline
void clan::JsonValue::set_string ( const std::string v)
inline
void clan::JsonValue::set_string ( const char *  v)
inline
void clan::JsonValue::set_undefined ( )
inline
size_t clan::JsonValue::size ( ) const
inline
static JsonValue clan::JsonValue::string ( const std::string &  value)
inlinestatic

References clan::string, and clan::v.

Referenced by clan::JsonValue::set_string().

bool clan::JsonValue::to_boolean ( ) const
inline
char clan::JsonValue::to_char ( ) const
inline
double clan::JsonValue::to_double ( ) const
inline
float clan::JsonValue::to_float ( ) const
inline
int clan::JsonValue::to_int ( ) const
inline
std::string clan::JsonValue::to_json ( ) const
short clan::JsonValue::to_short ( ) const
inline
const std::string& clan::JsonValue::to_string ( ) const
inline
unsigned char clan::JsonValue::to_uchar ( ) const
inline
unsigned int clan::JsonValue::to_uint ( ) const
inline
unsigned short clan::JsonValue::to_ushort ( ) const
inline
static JsonValue clan::JsonValue::undefined ( )
inlinestatic

References clan::undefined, and clan::v.

Referenced by clan::JsonValue::set_undefined().