forked from neutralinojs/neutralinojs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.h
52 lines (37 loc) · 918 Bytes
/
settings.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef NEU_SETTINGS_H
#define NEU_SETTINGS_H
#if defined(__linux__)
#define OS_NAME "Linux"
#elif defined(_WIN32)
#define OS_NAME "Windows"
#elif defined(__APPLE__)
#define OS_NAME "Darwin"
#elif defined(__FreeBSD__)
#define OS_NAME "FreeBSD"
#endif
#define APP_CONFIG_FILE "/neutralino.config.json"
#include <string>
#include "lib/json/json.hpp"
using namespace std;
using json = nlohmann::json;
namespace settings {
struct CliArg {
string key;
string value;
};
struct ConfigOverride {
string key;
string value;
string convertTo;
};
json getConfig();
string getGlobalVars();
void setGlobalArgs(const json &args);
string joinAppPath(const string &filename);
string getAppPath();
string getMode();
void setPort(int port);
void applyConfigOverride(const settings::CliArg &arg);
json getOptionForCurrentMode(const string &key);
} // namesapce settings
#endif // #define NEU_SETTINGS_H