Loading...
Searching...
No Matches
json.h
Go to the documentation of this file.
Definition json.h:72
void load(const filesystem::path &path)
void save(const filesystem::path &path, int indent=2) const
static JsonDocument wrap(const string &tag, Json value)
const Json * first_child(const string &name) const
Definition json.h:85
void end_array()
void close_element()
void begin_array_object()
void end_array_object()
void add_field(const string &name, const string &value)
string c_str(int indent=2) const
void open_element(const string &name)
void begin_array(const string &name)
Definition json.h:23
Json & operator[](const string &key)
bool has(const string &key) const
static Json make_array()
const Json * find(const string &key) const
string dump(int indent=2) const
Json & set(const string &key, Json value)
string as_string() const
long as_long() const
double as_double() const
bool as_bool() const
const Json & at(const string &key) const
static Json parse(const string &text)
static Json make_object()
void push_back(Json value)
Json()=default
Definition adaptive_moment_estimation.h:14
const Json * get_json_root(const JsonDocument &document, const string &tag)
void add_json_field(JsonWriter &writer, const string &name, const string &value)
long read_json_index(const Json *root, const string &field)
JsonDocument load_json_file(const filesystem::path &file_name)
const Json * require_json_field(const Json *root, const string &field)
string read_json_string_fallback(const Json *root, initializer_list< string > names)
void for_json_items(const Json *parent, const char *tag, long count, Func func)
Definition json.h:120
string read_json_string(const Json *root, const string &field)
void write_json(JsonWriter &writer, initializer_list< pair< const char *, string > > props)
bool read_json_bool(const Json *root, const string &field)
float read_json_type(const Json *root, const string &field)