|
| json () noexcept |
| Constructor.
|
|
| json (std::nullptr_t) noexcept |
| Constructor.
|
|
| json (double value) |
| Constructor.
|
|
| json (int value) |
| Constructor.
|
|
| json (int64_t value) |
| Constructor.
|
|
| json (uint64_t value) |
| Constructor.
|
|
| json (bool value) |
| Constructor.
|
|
| json (const date_time &value) |
| Constructor.
|
|
| json (const date &value) |
| Constructor.
|
|
| json (const std::string &value) |
| Constructor.
|
|
| json (std::string &&value) |
| Constructor.
|
|
| json (const char *value) |
| Constructor.
|
|
| json (const array &values) |
| Constructor.
|
|
| json (array &&values) |
| Constructor.
|
|
| json (const object &values) |
| Constructor.
|
|
| json (object &&values) |
| Constructor.
|
|
template<class T , class = decltype(&T::to_json)> |
| json (const T &t) |
| Implicit constructor: anything with a to_json() function.
|
|
template<class M , typename std::enable_if< std::is_constructible< std::string, typename M::key_type >::value &&std::is_constructible< json, typename M::mapped_type >::value, int >::type = 0> |
| json (const M &m) |
| Implicit constructor: map-like objects (std::map, std::unordered_map, etc)
|
|
template<class V , typename std::enable_if< std::is_constructible< json, typename V::value_type >::value, int >::type = 0> |
| json (const V &v) |
| Implicit constructor: vector-like objects (std::list, std::vector, std::set, etc)
|
|
| json (void *)=delete |
|
bool | bool_value (void) const |
| Return the enclosed value if this is a boolean, false otherwise. More...
|
|
void | dump (std::string &out) const |
| Serialize self. More...
|
|
int | int_value (void) const |
| Return the enclosed value if this is a int, false otherwise. More...
|
|
bool | is_array () const |
|
bool | is_bool () const |
|
bool | is_null () const |
|
bool | is_number () const |
|
bool | is_object () const |
|
bool | is_string () const |
|
| operator bool (void) const |
| Returns valuea as a boolean.
|
|
| operator date (void) const |
| Returns value as a std::string.
|
|
| operator date_time (void) const |
| Returns value as a std::string.
|
|
| operator double (void) const |
| Returns value as a double;.
|
|
| operator int (void) const |
| Returns valueas an int.
|
|
| operator int64_t (void) const |
| Returns value as an int64_t.
|
|
| operator std::string (void) const |
| Returns value as a std::string.
|
|
bool | operator!= (const json &rhs) const |
|
bool | operator< (const json &rhs) const |
|
bool | operator<= (const json &rhs) const |
|
bool | operator== (const json &rhs) const |
|
bool | operator> (const json &rhs) const |
|
bool | operator>= (const json &rhs) const |
|
const json & | operator[] (size_t i) const |
| Return a reference to arr[i] if this is an array, Json() otherwise. More...
|
|
const json & | operator[] (const std::string &key) const |
| Return a reference to obj[key] if this is an object, Json() otherwise. More...
|
|
const std::string & | string_value (void) const |
| Return the enclosed string if this is a string, "" otherwise. More...
|
|
variant | to_variant (void) const |
|
Type | type () const |
| Accessors.
|
|
A class representing JSON objects.
Instances of this type can parse text files containing single or multiple JSON objects. JSON stands for 'Java Script Object Notation' and is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. JSON files are easier to maintain than equivalent XML files.