8#include <entt/locator/locator.hpp>
9#include <nlohmann/json.hpp>
19 nlohmann::json
read(
const std::string& file)
21 auto& fs = entt::locator<fs::VirtualFileSystem>::value();
22 auto data = fs.read(file);
24 return nlohmann::json::parse(data);
27 nlohmann::json
read_raw(
const std::string& json)
29 return nlohmann::json::parse(json);
32 bool write(
const std::string& file,
const nlohmann::json& json)
34 auto& fs = entt::locator<fs::VirtualFileSystem>::value();
35 return fs.write(json.dump(4), file);
38 std::string
dump(
const nlohmann::json& json)
nlohmann::json read_raw(const std::string &json)
Read raw json string.
bool write(const std::string &file, const nlohmann::json &json)
Write json to vfs.
std::string dump(const nlohmann::json &json)
Dump json to string.
nlohmann::json read(const std::string &file)
Read a json file in the vfs.