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