forked from CalcProgrammer1/OpenRGB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettingsManager.h
35 lines (27 loc) · 924 Bytes
/
SettingsManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*-----------------------------------------*\
| SettingsManager.h |
| |
| OpenRGB Settings Manager maintains a list|
| of application settings in JSON format. |
| Other components may register settings |
| with this class and store/load values. |
| |
| Adam Honse (CalcProgrammer1) 11/4/2020 |
\*-----------------------------------------*/
#pragma once
#include "json.hpp"
using json = nlohmann::json;
class SettingsManager
{
public:
SettingsManager();
~SettingsManager();
json GetSettings(std::string settings_key);
void SetSettings(std::string settings_key, json new_settings);
void LoadSettings(std::string filename);
void SaveSettings();
private:
json settings_data;
json settings_prototype;
std::string settings_filename;
};