#ifndef LUNA_CONFIG_HELPER #define LUNA_CONFIG_HELPER #include class confighelper { std::wstring configpath; public: nlohmann::json configs; confighelper(); ~confighelper(); template T get(const std::string &key, T default1) { if (configs.find(key) == configs.end()) return default1; return configs[key]; } template void set(const std::string &key, T v) { configs[key] = v; } }; template T safequeryjson(const nlohmann::json &js, const std::string &key, const T &defaultv) { if (js.find(key) == js.end()) { return defaultv; } return js[key]; } #endif