|
| Json (const std::string &str) |
|
| Json (const char *str) |
|
| Json (JsonNum num) |
|
| Json (double num) |
|
| Json (std::size_t num) |
|
| Json (int num) |
|
| Json (JsonObject obj) |
|
| Json (JsonArray arr) |
|
| Json (bool b) |
|
| Json (const std::initializer_list< Json > &data) |
|
| Json (const Json &other) |
|
| Json (Json &&other) |
|
JsonValueType | get_type () const |
|
bool | is_string () const |
|
bool | is_number () const |
|
bool | is_object () const |
|
bool | is_array () const |
|
bool | is_bool () const |
|
bool | is_null () const |
|
std::string | as_string () const |
|
JsonNum | as_number () const |
|
uint64_t | as_uint () const |
|
int64_t | as_int () const |
|
double | as_float () const |
|
double | as_double () const |
|
JsonObject | as_object () const |
|
JsonArray | as_array () const |
|
bool | as_bool () const |
|
std::size_t | size () const |
|
bool | is_empty () const |
|
bool | has_key (const std::string &key) const |
|
bool | resize (std::size_t size) |
|
bool | push_back (const Json &val) |
|
Json & | front () |
| Returns first element if this is an array.
|
|
Json & | back () |
| Returns last element if this is an array.
|
|
Json & | merge (const Json &other) |
|
std::string | dump (std::size_t indent=0, std::size_t offset=0) const |
|
| operator std::string () const |
|
| operator JsonNum () const |
|
| operator uint64_t () const |
|
| operator int64_t () const |
|
| operator int () const |
|
| operator float () const |
|
| operator double () const |
|
| operator JsonObject () const |
|
| operator JsonArray () const |
|
| operator bool () const |
|
Json & | operator= (const Json &other) |
|
Json & | operator= (Json &&other) |
|
bool | operator== (const Json &other) const |
|
bool | operator!= (const Json &other) const |
|
bool | operator== (const std::string &other) const |
|
bool | operator!= (const std::string &other) const |
|
bool | operator== (const char *other) const |
|
bool | operator!= (const char *other) const |
|
bool | operator== (const JsonNum &other) const |
|
bool | operator!= (const JsonNum &other) const |
|
bool | operator== (const int &other) const |
|
bool | operator!= (const int &other) const |
|
bool | operator== (const JsonObject &other) const |
|
bool | operator!= (const JsonObject &other) const |
|
bool | operator== (const JsonArray &other) const |
|
bool | operator!= (const JsonArray &other) const |
|
bool | operator== (const bool &other) const |
|
bool | operator!= (const bool &other) const |
|
Json & | operator[] (const std::string &key) |
| When m_type == NONE, first converts this into an Object. More...
|
|
Json & | operator[] (const std::string &key) const |
|
Json & | operator[] (const char *key) |
|
Json & | operator[] (const char *key) const |
|
Json & | operator[] (std::size_t idx) |
| When m_type == NONE, first converts this into an Array.
|
|
Json & | operator[] (std::size_t idx) const |
|
Json & | operator[] (int idx) |
|
Json & | operator[] (int idx) const |
|
iterator< 0 > | begin () |
|
iterator< 1 > | cbegin () const |
|
iterator< 0 > | end () |
|
iterator< 1 > | cend () const |
|
|
static bool | lex_string (std::string &str, JsonToken &ret) |
| Attempts to retreive a string token from the beginning of str.
|
|
static bool | lex_number (std::string &str, JsonToken &ret) |
| Attempts to retreive a number token from the beginning of str.
|
|
static bool | lex_bool (std::string &str, JsonToken &ret) |
| Attempts to retreive a boolean token from the beginning of str.
|
|
static bool | lex_null (std::string &str, JsonToken &ret) |
| Attempts to retreive a null token from the beginning of str.
|
|
static std::queue< JsonToken > | tokenize (std::string curr) |
| Converts curr into a stream of tokens. More...
|
|
static Json | parse_tokens (std::queue< JsonToken > &tokens) |
| Converts stream of tokens into a Json value.
|
|
- Todo:
- Make as_* functions safer and more versatile
An arbitrary Json value (see tests/utils/json_tests.cpp for example usage)
Definition at line 93 of file Json.h.