#pragma once #include #include namespace floormat { struct json_helper final { using json = nlohmann::json; using fspath = std::filesystem::path; template static T from_json(const fspath& pathname); template static void to_json(const T& self, const fspath& pathname, int indent = 1); static json from_json_(const fspath& pathname); static void to_json_(const json& j, const fspath& pathname, int indent); }; template T json_helper::from_json(const fspath& pathname) { return from_json_(pathname); } template void json_helper::to_json(const T& self, const fspath& pathname, int indent) { to_json_(json(self), pathname, indent); } } // namespace floormat