a lot of fixes

This commit is contained in:
2024-10-05 13:52:44 +03:00
parent 640337d420
commit d2afa8c9dd
32 changed files with 909 additions and 104 deletions

28
settings/settings.h Normal file
View 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