#include <genesis/utils/formats/json/reader.hpp>
Read Json
data into a JsonDocument.
This class provides functions for parsing json
data into a JsonDocument. The parsing works this way: Each JsonDocument is also a Json object, and can contain other objects, arrays, or simple value types. The parsing here is thus splitted in different functions, being recursively called for every level of nesting within objects and arrays.
Definition at line 62 of file utils/formats/json/reader.hpp.
Public Member Functions | |
JsonReader ()=default | |
JsonReader (JsonReader &&)=default | |
JsonReader (JsonReader const &)=default | |
~JsonReader ()=default | |
JsonReader & | operator= (JsonReader &&)=default |
JsonReader & | operator= (JsonReader const &)=default |
JsonDocument | parse (InputStream &input_stream) const |
JsonDocument | parse_array (InputStream &input_stream) const |
JsonDocument | parse_number (InputStream &input_stream) const |
JsonDocument | parse_object (InputStream &input_stream) const |
JsonDocument | parse_value (InputStream &input_stream) const |
JsonDocument | read (std::shared_ptr< BaseInputSource > source) const |
Read from a source containing a JSON document and parse its contents into a JsonDocument. More... | |
|
default |
|
default |
|
default |
|
default |
|
default |
|
default |
JsonDocument parse | ( | InputStream & | input_stream | ) | const |
Definition at line 69 of file utils/formats/json/reader.cpp.
JsonDocument parse_array | ( | InputStream & | input_stream | ) | const |
Definition at line 147 of file utils/formats/json/reader.cpp.
JsonDocument parse_number | ( | InputStream & | input_stream | ) | const |
Definition at line 248 of file utils/formats/json/reader.cpp.
JsonDocument parse_object | ( | InputStream & | input_stream | ) | const |
Definition at line 193 of file utils/formats/json/reader.cpp.
JsonDocument parse_value | ( | InputStream & | input_stream | ) | const |
Definition at line 85 of file utils/formats/json/reader.cpp.
JsonDocument read | ( | std::shared_ptr< BaseInputSource > | source | ) | const |
Read from a source containing a JSON document and parse its contents into a JsonDocument.
Use functions such as utils::from_file() and utils::from_string() to conveniently get an input source that can be used here.
Definition at line 55 of file utils/formats/json/reader.cpp.