LunaHook-mirror/LunaHost/GUI/confighelper.h
恍兮惚兮 0a3904df4f vista style & Qtloader & other
Update CMakeLists.txt

Update README.md
2024-02-09 19:40:50 +08:00

25 lines
631 B
C++

#ifndef LUNA_CONFIG_HELPER
#define LUNA_CONFIG_HELPER
#include<nlohmann/json.hpp>
class confighelper{
nlohmann::json configs;
std::wstring configpath;
public:
confighelper();
~confighelper();
nlohmann::json pluginsget();
void pluginsadd(const std::string&,bool);
void pluginsremove(const std::string&);
void pluginrankswap(int,int);
template<class T>
T get(const std::string&key,T default1){
if(configs.find(key)==configs.end())return default1;
return configs[key];
}
template<class T>
void set(const std::string&key,T v){
configs[key]=v;
}
};
#endif