#include <json11.h>
|
const array & | array_items () const |
|
bool | bool_value () const |
|
std::string | dump () const |
|
void | dump (std::string &out) const |
|
bool | has_shape (const shape &types, std::string &err) const |
|
int | int_value () const |
|
bool | is_array () const |
|
bool | is_bool () const |
|
bool | is_null () const |
|
bool | is_number () const |
|
bool | is_object () const |
|
bool | is_string () const |
|
| Json () noexcept |
|
| Json (array &&values) |
|
| Json (bool value) |
|
| Json (const array &values) |
|
| Json (const char *value) |
|
template<class M , typename std::enable_if< std::is_constructible< std::string, decltype(std::declval< M >().begin() ->first)>::value &&std::is_constructible< Json, decltype(std::declval< M >().begin() ->second)>::value , int , ::type = 0> |
| Json (const M &m) |
|
| Json (const object &values) |
|
| Json (const std::string &value) |
|
template<class T , class = decltype(&T::to_json)> |
| Json (const T &t) |
|
template<class V , typename std::enable_if< std::is_constructible< Json, decltype(*std::declval< V >().begin())>::value , int , ::type = 0> |
| Json (const V &v) |
|
| Json (double value) |
|
| Json (long long value) |
|
| Json (object &&values) |
|
| Json (std::nullptr_t) noexcept |
|
| Json (std::string &&value) |
|
| Json (void *)=delete |
|
long long | long_value () const |
|
double | number_value () const |
|
const object & | object_items () 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 |
|
bool | operator>= (const Json &rhs) const |
|
const Json & | operator[] (const std::string &key) const |
|
const Json & | operator[] (size_t i) const |
|
const std::string & | string_value () const |
|
Type | type () const |
|
Definition at line 87 of file json11.h.
◆ array
◆ object
◆ shape
◆ Type
Enumerator |
---|
NUL | |
NUMBER | |
BOOL | |
STRING | |
ARRAY | |
OBJECT | |
Definition at line 90 of file json11.h.
◆ Json() [1/16]
◆ Json() [2/16]
json11::Json::Json |
( |
std::nullptr_t |
| ) |
|
|
inlinenoexcept |
◆ Json() [3/16]
json11::Json::Json |
( |
double |
value | ) |
|
|
inline |
Definition at line 521 of file json11.h.
521 :
m_ptr(std::make_shared<JsonDouble>(value)) {}
◆ Json() [4/16]
json11::Json::Json |
( |
long long |
value | ) |
|
|
inline |
Definition at line 522 of file json11.h.
522 :
m_ptr(std::make_shared<JsonInt>(value)) {}
◆ Json() [5/16]
json11::Json::Json |
( |
bool |
value | ) |
|
|
inline |
◆ Json() [6/16]
json11::Json::Json |
( |
const std::string & |
value | ) |
|
|
inline |
Definition at line 524 of file json11.h.
524 :
m_ptr(std::make_shared<JsonString>(value)) {}
◆ Json() [7/16]
json11::Json::Json |
( |
std::string && |
value | ) |
|
|
inline |
Definition at line 525 of file json11.h.
525 :
m_ptr(std::make_shared<JsonString>(std::move(value))) {}
◆ Json() [8/16]
json11::Json::Json |
( |
const char * |
value | ) |
|
|
inline |
Definition at line 526 of file json11.h.
526 :
m_ptr(std::make_shared<JsonString>(value)) {}
◆ Json() [9/16]
json11::Json::Json |
( |
const array & |
values | ) |
|
|
inline |
Definition at line 527 of file json11.h.
527 :
m_ptr(std::make_shared<JsonArray>(values)) {}
◆ Json() [10/16]
Definition at line 528 of file json11.h.
528 :
m_ptr(std::make_shared<JsonArray>(std::move(values))) {}
◆ Json() [11/16]
json11::Json::Json |
( |
const object & |
values | ) |
|
|
inline |
Definition at line 529 of file json11.h.
529 :
m_ptr(std::make_shared<JsonObject>(values)) {}
◆ Json() [12/16]
Definition at line 530 of file json11.h.
530 :
m_ptr(std::make_shared<JsonObject>(std::move(values))) {}
◆ Json() [13/16]
template<class T , class = decltype(&T::to_json)>
json11::Json::Json |
( |
const T & |
t | ) |
|
|
inline |
◆ Json() [14/16]
template<class M , typename std::enable_if< std::is_constructible< std::string, decltype(std::declval< M >().begin() ->first)>::value &&std::is_constructible< Json, decltype(std::declval< M >().begin() ->second)>::value , int , ::type = 0>
json11::Json::Json |
( |
const M & |
m | ) |
|
|
inline |
◆ Json() [15/16]
template<class V , typename std::enable_if< std::is_constructible< Json, decltype(*std::declval< V >().begin())>::value , int , ::type = 0>
json11::Json::Json |
( |
const V & |
v | ) |
|
|
inline |
◆ Json() [16/16]
json11::Json::Json |
( |
void * |
| ) |
|
|
delete |
◆ array_items()
const std::vector< Json > & json11::Json::array_items |
( |
| ) |
const |
|
inline |
◆ bool_value()
bool json11::Json::bool_value |
( |
| ) |
const |
|
inline |
◆ dump() [1/2]
std::string json11::Json::dump |
( |
| ) |
const |
|
inline |
◆ dump() [2/2]
void json11::Json::dump |
( |
std::string & |
out | ) |
const |
|
inline |
◆ has_shape()
bool json11::Json::has_shape |
( |
const shape & |
types, |
|
|
std::string & |
err |
|
) |
| const |
|
inline |
Definition at line 224 of file json11.h.
226 err =
"expected JSON object, got " +
dump();
230 for (
auto& item :
types) {
231 if ((*
this)[item.first].type() != item.second) {
232 err =
"bad type for " + item.first +
" in " +
dump();
References dump(), err, is_object(), and types.
◆ int_value()
int json11::Json::int_value |
( |
| ) |
const |
|
inline |
◆ is_array()
bool json11::Json::is_array |
( |
| ) |
const |
|
inline |
◆ is_bool()
bool json11::Json::is_bool |
( |
| ) |
const |
|
inline |
◆ is_null()
bool json11::Json::is_null |
( |
| ) |
const |
|
inline |
◆ is_number()
bool json11::Json::is_number |
( |
| ) |
const |
|
inline |
◆ is_object()
bool json11::Json::is_object |
( |
| ) |
const |
|
inline |
◆ is_string()
bool json11::Json::is_string |
( |
| ) |
const |
|
inline |
◆ long_value()
long long json11::Json::long_value |
( |
| ) |
const |
|
inline |
◆ number_value()
double json11::Json::number_value |
( |
| ) |
const |
|
inline |
◆ object_items()
const std::map< std::string, Json > & json11::Json::object_items |
( |
| ) |
const |
|
inline |
◆ operator!=()
bool json11::Json::operator!= |
( |
const Json & |
rhs | ) |
const |
|
inline |
◆ operator<()
bool json11::Json::operator< |
( |
const Json & |
rhs | ) |
const |
|
inline |
Definition at line 621 of file json11.h.
622 if (
m_ptr == other.m_ptr) {
625 if (
m_ptr->type() != other.m_ptr->type()) {
626 return m_ptr->type() < other.m_ptr->type();
629 return m_ptr->less(other.m_ptr.get());
References m_ptr.
◆ operator<=()
bool json11::Json::operator<= |
( |
const Json & |
rhs | ) |
const |
|
inline |
◆ operator==()
bool json11::Json::operator== |
( |
const Json & |
rhs | ) |
const |
|
inline |
Definition at line 610 of file json11.h.
611 if (
m_ptr == other.m_ptr) {
614 if (
m_ptr->type() != other.m_ptr->type()) {
618 return m_ptr->equals(other.m_ptr.get());
References m_ptr.
◆ operator>()
bool json11::Json::operator> |
( |
const Json & |
rhs | ) |
const |
|
inline |
◆ operator>=()
bool json11::Json::operator>= |
( |
const Json & |
rhs | ) |
const |
|
inline |
◆ operator[]() [1/2]
const Json & json11::Json::operator[] |
( |
const std::string & |
key | ) |
const |
|
inline |
◆ operator[]() [2/2]
const Json & json11::Json::operator[] |
( |
size_t |
i | ) |
const |
|
inline |
◆ parse() [1/2]
static Json json11::Json::parse |
( |
const char * |
in, |
|
|
std::string & |
err, |
|
|
JsonParse |
strategy = JsonParse::STANDARD |
|
) |
| |
|
inlinestatic |
◆ parse() [2/2]
Json json11::Json::parse |
( |
const std::string & |
in, |
|
|
std::string & |
err, |
|
|
JsonParse |
strategy = JsonParse::STANDARD |
|
) |
| |
|
inlinestatic |
◆ parse_multi() [1/2]
static std::vector<Json> json11::Json::parse_multi |
( |
const std::string & |
in, |
|
|
std::string & |
err, |
|
|
JsonParse |
strategy = JsonParse::STANDARD |
|
) |
| |
|
inlinestatic |
◆ parse_multi() [2/2]
static std::vector<Json> json11::Json::parse_multi |
( |
const std::string & |
in, |
|
|
std::string::size_type & |
parser_stop_pos, |
|
|
std::string & |
err, |
|
|
JsonParse |
strategy = JsonParse::STANDARD |
|
) |
| |
|
static |
◆ string_value()
const std::string & json11::Json::string_value |
( |
| ) |
const |
|
inline |
◆ type()
◆ m_ptr
std::shared_ptr<JsonValue> json11::Json::m_ptr |
|
private |
Definition at line 241 of file json11.h.
Referenced by array_items(), bool_value(), dump(), int_value(), long_value(), number_value(), object_items(), operator<(), operator==(), operator[](), string_value(), and type().
The documentation for this class was generated from the following file:
static std::vector< Json > parse_multi(const std::string &in, std::string::size_type &parser_stop_pos, std::string &err, JsonParse strategy=JsonParse::STANDARD)