Added ability to supply JSON from standard input
This commit is contained in:
@@ -90,6 +90,12 @@ SDL_Rect surface_align(const SDL_Surface* base, const SDL_Surface* applied,
|
||||
// log - output errors to this ostream, silent if NULL
|
||||
bool read_config_json(nlohmann::json& cfg, const std::string& filename, std::ostream* log = &std::cout);
|
||||
|
||||
// Reads the stream and tries to parse JSON from it with comments
|
||||
// cfg - output json struct
|
||||
// in - input stream to read
|
||||
// log - output errors to this ostream, silent if NULL
|
||||
bool read_config_json(nlohmann::json& cfg, std::istream& in, std::ostream* log = &std::cout);
|
||||
|
||||
// JSON Extractors - They do not override already set values if key is not present
|
||||
|
||||
void json_extract(const nlohmann::json& j, const std::string& key, std::string& out);
|
||||
|
||||
Reference in New Issue
Block a user