a lot of fixes
This commit is contained in:
28
settings/settings.h
Normal file
28
settings/settings.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef SETTINGS_H
|
||||
#define SETTINGS_H
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
|
||||
class Settings {
|
||||
|
||||
std::string settings_file_path;
|
||||
nlohmann::json settings;
|
||||
|
||||
public:
|
||||
Settings(std::string path);
|
||||
//Immediately saves to a file
|
||||
void write_setting(std::string setting, std::string value);
|
||||
//Waits for a flush
|
||||
void alter_setting(std::string setting, std::string value);
|
||||
std::string get_setting(std::string setting);
|
||||
|
||||
void set_settings_file_path(std::string path);
|
||||
std::string get_settings_file_path();
|
||||
|
||||
nlohmann::json& get_all_settings();
|
||||
|
||||
void flush();
|
||||
};
|
||||
|
||||
#endif // SETTINGS_H
|
||||
Reference in New Issue
Block a user