| 5 | namespace ul::util { |
| 6 | |
| 7 | Result LoadJSONFromFile(JSON &out_json, const std::string &path) { |
| 8 | if(fs::ExistsFile(path)) { |
| 9 | std::string json_str; |
| 10 | if(fs::ReadFileString(path, json_str)) { |
| 11 | out_json = JSON::parse(json_str); |
| 12 | return ResultSuccess; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | return ResultInvalidJson; |
| 17 | } |
| 18 | |
| 19 | bool SaveJSON(const std::string &path, const JSON &json) { |
| 20 | const auto json_str = json.dump(4); |
no test coverage detected