mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
json-related refactor
This commit is contained in:
parent
45862269e7
commit
7fdacffe53
7 changed files with 30 additions and 35 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "files.hpp"
|
||||
|
||||
#include "../coders/commons.hpp"
|
||||
#include "../coders/json.hpp"
|
||||
#include "../coders/gzip.hpp"
|
||||
#include "../util/stringutil.hpp"
|
||||
|
|
@ -107,8 +108,7 @@ bool files::write_binary_json(fs::path filename, const dynamic::Map* obj, bool c
|
|||
std::shared_ptr<dynamic::Map> files::read_json(fs::path filename) {
|
||||
std::string text = files::read_string(filename);
|
||||
try {
|
||||
auto obj = json::parse(filename.string(), text);
|
||||
return obj;
|
||||
return json::parse(filename.string(), text);;
|
||||
} catch (const parsing_error& error) {
|
||||
std::cerr << error.errorLog() << std::endl;
|
||||
throw std::runtime_error("could not to parse "+filename.string());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue