mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-12-27 13:44:11 +08:00
24 lines
597 B
C
24 lines
597 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&);
|
||
|
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
|