forked from neutralinojs/neutralinojs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.h
59 lines (41 loc) · 1.06 KB
/
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
52
53
54
55
56
57
58
#ifndef NEU_SETTINGS_H
#define NEU_SETTINGS_H
#if defined(__linux__)
#define NEU_OS_NAME "Linux"
#elif defined(_WIN32)
#define NEU_OS_NAME "Windows"
#elif defined(__APPLE__)
#define NEU_OS_NAME "Darwin"
#elif defined(__FreeBSD__)
#define NEU_OS_NAME "FreeBSD"
#else
#define NEU_OS_NAME "Unknown"
#endif
#define NEU_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;
};
enum AppMode { AppModeWindow, AppModeBrowser, AppModeCloud, AppModeChrome };
json getConfig();
string getGlobalVars();
void setGlobalArgs(const json &args);
string joinAppPath(const string &filename);
string getAppPath();
string getConfigFile();
settings::AppMode getMode();
void setPort(int port);
void applyConfigOverride(const settings::CliArg &arg);
json getOptionForCurrentMode(const string &key);
} // namesapce settings
#endif // #define NEU_SETTINGS_H