clanCore JSON - ClanLib SDK
Description: clanCore JSON

Classes | Enumerations | Functions
clanCore JSON

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

## Enumerations
enum class | 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 (char value)
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 (short value)
static JsonValue | clan::JsonValue::number (unsigned char value)
static JsonValue | clan::JsonValue::number (unsigned int value)
static JsonValue | clan::JsonValue::number (unsigned short value)
static JsonValue | clan::JsonValue::object ()
JsonValue & | clan::JsonValue::operator[] (const char *name)
const JsonValue & | clan::JsonValue::operator[] (const char *name) const
JsonValue & | clan::JsonValue::operator[] (const std::string &name)
const JsonValue & | clan::JsonValue::operator[] (const std::string &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)
JsonValue & | clan::JsonValue::prop (const char *name)
const JsonValue & | clan::JsonValue::prop (const char *name) const
JsonValue & | clan::JsonValue::prop (const std::string &name)
const JsonValue & | clan::JsonValue::prop (const std::string &name) const
std::map< std::string, JsonValue > & | clan::JsonValue::properties ()
const std::map< std::string, JsonValue > & | clan::JsonValue::properties () const
void | clan::JsonValue::remove (const char *name)
void | clan::JsonValue::remove (const std::string &name)
void | clan::JsonValue::set_array ()
void | clan::JsonValue::set_boolean (bool v)
void | clan::JsonValue::set_null ()
void | clan::JsonValue::set_number (char v)
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 (short v)
void | clan::JsonValue::set_number (unsigned char v)
void | clan::JsonValue::set_number (unsigned int v)
void | clan::JsonValue::set_number (unsigned short v)
void | clan::JsonValue::set_object ()
void | clan::JsonValue::set_string (const char *v)
void | clan::JsonValue::set_string (const std::string &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

## ◆ JsonType

enum class clan::JsonType
| strong

Enumerator
undefined |
null |
object |
array |
number |
boolean |
string |

## Function Documentation

## ◆ JsonException()

clan::JsonException::JsonException | ( | const std::string & | message | ) |
| inline

## ◆ array()

static JsonValue clan::JsonValue::array | ( |  | ) |
| inlinestatic

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

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

## ◆ at() [1/2]

JsonValue & clan::JsonValue::at | ( | size_t | index | ) |
| inline

Referenced by clan::JsonValue::operator[](), and clan::JsonValue::operator[]().

## ◆ at() [2/2]

const JsonValue & clan::JsonValue::at | ( | size_t | index | ) | const
| inline

## ◆ boolean()

static JsonValue clan::JsonValue::boolean | ( | bool | value | ) |
| inlinestatic

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

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

## ◆ clear()

void clan::JsonValue::clear | ( |  | ) |
| inline

## ◆ erase()

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

References clan::length.

## ◆ is_array()

bool clan::JsonValue::is_array | ( |  | ) | const
| inline

References clan::array, and clan::JsonValue::type().

## ◆ is_boolean()

bool clan::JsonValue::is_boolean | ( |  | ) | const
| inline

References clan::boolean, and clan::JsonValue::type().

## ◆ is_null()

bool clan::JsonValue::is_null | ( |  | ) | const
| inline

References clan::null, and clan::JsonValue::type().

## ◆ is_number()

bool clan::JsonValue::is_number | ( |  | ) | const
| inline

References clan::number, and clan::JsonValue::type().

## ◆ is_object()

bool clan::JsonValue::is_object | ( |  | ) | const
| inline

References clan::object, and clan::JsonValue::type().

## ◆ is_undefined()

bool clan::JsonValue::is_undefined | ( |  | ) | const
| inline

References clan::JsonValue::type(), and clan::undefined.

## ◆ items() [1/2]

std::vector< JsonValue > & clan::JsonValue::items | ( |  | ) |
| inline

## ◆ items() [2/2]

const std::vector< JsonValue > & clan::JsonValue::items | ( |  | ) | const
| inline

## ◆ null()

static JsonValue clan::JsonValue::null | ( |  | ) |
| inlinestatic

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

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

## ◆ number() [1/8]

static JsonValue clan::JsonValue::number | ( | char | value | ) |
| inlinestatic

References clan::JsonValue::number().

## ◆ number() [2/8]

static JsonValue clan::JsonValue::number | ( | double | value | ) |
| inlinestatic

References clan::number, and clan::v.

Referenced by clan::JsonValue::number(), clan::JsonValue::number(), clan::JsonValue::number(), clan::JsonValue::number(), clan::JsonValue::number(), clan::JsonValue::number(), clan::JsonValue::number(), clan::JsonValue::set_number(), clan::JsonValue::set_number(), clan::JsonValue::set_number(), clan::JsonValue::set_number(), clan::JsonValue::set_number(), clan::JsonValue::set_number(), clan::JsonValue::set_number(), and clan::JsonValue::set_number().

## ◆ number() [3/8]

static JsonValue clan::JsonValue::number | ( | float | value | ) |
| inlinestatic

References clan::JsonValue::number().

## ◆ number() [4/8]

static JsonValue clan::JsonValue::number | ( | int | value | ) |
| inlinestatic

References clan::JsonValue::number().

## ◆ number() [5/8]

static JsonValue clan::JsonValue::number | ( | short | value | ) |
| inlinestatic

References clan::JsonValue::number().

## ◆ number() [6/8]

static JsonValue clan::JsonValue::number | ( | unsigned char | value | ) |
| inlinestatic

References clan::JsonValue::number().

## ◆ number() [7/8]

static JsonValue clan::JsonValue::number | ( | unsigned int | value | ) |
| inlinestatic

References clan::JsonValue::number().

## ◆ number() [8/8]

static JsonValue clan::JsonValue::number | ( | unsigned short | value | ) |
| inlinestatic

References clan::JsonValue::number().

## ◆ object()

static JsonValue clan::JsonValue::object | ( |  | ) |
| inlinestatic

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

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

## ◆ operator[]() [1/6]

JsonValue & clan::JsonValue::operator[] | ( | const char * | name | ) |
| inline

References clan::JsonValue::prop().

## ◆ operator[]() [2/6]

const JsonValue & clan::JsonValue::operator[] | ( | const char * | name | ) | const
| inline

References clan::JsonValue::prop().

## ◆ operator[]() [3/6]

JsonValue & clan::JsonValue::operator[] | ( | const std::string & | name | ) |
| inline

References clan::JsonValue::prop().

## ◆ operator[]() [4/6]

const JsonValue & clan::JsonValue::operator[] | ( | const std::string & | name | ) | const
| inline

References clan::JsonValue::prop().

## ◆ operator[]() [5/6]

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

References clan::JsonValue::at().

## ◆ operator[]() [6/6]

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

References clan::JsonValue::at().

## ◆ parse()

static JsonValue clan::JsonValue::parse | ( | const std::string & | json | ) |
| static

## ◆ prop() [1/4]

JsonValue & clan::JsonValue::prop | ( | const char * | name | ) |
| inline

## ◆ prop() [2/4]

const JsonValue & clan::JsonValue::prop | ( | const char * | name | ) | const
| inline

## ◆ prop() [3/4]

JsonValue & clan::JsonValue::prop | ( | const std::string & | name | ) |
| inline

## ◆ prop() [4/4]

const JsonValue & clan::JsonValue::prop | ( | const std::string & | name | ) | const
| inline

Referenced by clan::JsonValue::operator[](), clan::JsonValue::operator[](), clan::JsonValue::operator[](), and clan::JsonValue::operator[]().

## ◆ properties() [1/2]

std::map< std::string, JsonValue > & clan::JsonValue::properties | ( |  | ) |
| inline

## ◆ properties() [2/2]

const std::map< std::string, JsonValue > & clan::JsonValue::properties | ( |  | ) | const
| inline

## ◆ remove() [1/2]

void clan::JsonValue::remove | ( | const char * | name | ) |
| inline

## ◆ remove() [2/2]

void clan::JsonValue::remove | ( | const std::string & | name | ) |
| inline

## ◆ set_array()

void clan::JsonValue::set_array | ( |  | ) |
| inline

References clan::JsonValue::array().

## ◆ set_boolean()

void clan::JsonValue::set_boolean | ( | bool | v | ) |
| inline

References clan::JsonValue::boolean(), and clan::v.

## ◆ set_null()

void clan::JsonValue::set_null | ( |  | ) |
| inline

References clan::JsonValue::null().

## ◆ set_number() [1/8]

void clan::JsonValue::set_number | ( | char | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_number() [2/8]

void clan::JsonValue::set_number | ( | double | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_number() [3/8]

void clan::JsonValue::set_number | ( | float | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_number() [4/8]

void clan::JsonValue::set_number | ( | int | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_number() [5/8]

void clan::JsonValue::set_number | ( | short | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_number() [6/8]

void clan::JsonValue::set_number | ( | unsigned char | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_number() [7/8]

void clan::JsonValue::set_number | ( | unsigned int | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_number() [8/8]

void clan::JsonValue::set_number | ( | unsigned short | v | ) |
| inline

References clan::JsonValue::number(), and clan::v.

## ◆ set_object()

void clan::JsonValue::set_object | ( |  | ) |
| inline

References clan::JsonValue::object().

## ◆ set_string() [1/2]

void clan::JsonValue::set_string | ( | const char * | v | ) |
| inline

References clan::JsonValue::string(), and clan::v.

## ◆ set_string() [2/2]

void clan::JsonValue::set_string | ( | const std::string & | v | ) |
| inline

References clan::JsonValue::string(), and clan::v.

## ◆ set_undefined()

void clan::JsonValue::set_undefined | ( |  | ) |
| inline

References clan::JsonValue::undefined().

## ◆ size()

size_t clan::JsonValue::size | ( |  | ) | const
| inline

## ◆ string()

static JsonValue clan::JsonValue::string | ( | const std::string & | value | ) |
| inlinestatic

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

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

## ◆ to_boolean()

bool clan::JsonValue::to_boolean | ( |  | ) | const
| inline

## ◆ to_char()

char clan::JsonValue::to_char | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ to_double()

double clan::JsonValue::to_double | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ to_float()

float clan::JsonValue::to_float | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ to_int()

int clan::JsonValue::to_int | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ to_json()

std::string clan::JsonValue::to_json | ( |  | ) | const

## ◆ to_number()

double clan::JsonValue::to_number | ( |  | ) | const
| inline

Referenced by clan::JsonValue::to_char(), clan::JsonValue::to_double(), clan::JsonValue::to_float(), clan::JsonValue::to_int(), clan::JsonValue::to_short(), clan::JsonValue::to_uchar(), clan::JsonValue::to_uint(), and clan::JsonValue::to_ushort().

## ◆ to_short()

short clan::JsonValue::to_short | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ to_string()

const std::string & clan::JsonValue::to_string | ( |  | ) | const
| inline

## ◆ to_uchar()

unsigned char clan::JsonValue::to_uchar | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ to_uint()

unsigned int clan::JsonValue::to_uint | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ to_ushort()

unsigned short clan::JsonValue::to_ushort | ( |  | ) | const
| inline

References clan::JsonValue::to_number().

## ◆ type()

JsonType clan::JsonValue::type | ( |  | ) | const
| inline

Referenced by clan::JsonValue::is_array(), clan::JsonValue::is_boolean(), clan::JsonValue::is_null(), clan::JsonValue::is_number(), clan::JsonValue::is_object(), and clan::JsonValue::is_undefined().

## ◆ undefined()

static JsonValue clan::JsonValue::undefined | ( |  | ) |
| inlinestatic

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

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