-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.h
executable file
·58 lines (41 loc) · 945 Bytes
/
Config.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
//
// Created by Administrator on 2019/10/8 0008.
//
#ifndef WEBSOCKET_CONFIG_H
#define WEBSOCKET_CONFIG_H
#include "public.h"
class Config {
private:
int port = 80;
int process_num = 1;
bool run_as_daemon = false;
bool debug_open = true;
string log_file_path;
string config_filename;
unordered_map<string, string> configs;
public:
Config() {}
explicit Config(string file) : config_filename(file) {}
void Parse(string file = "");
void Print();
inline int GetPort() {
return port;
}
inline int GetProcessNum() {
return process_num;
}
inline bool CheckRunAsDaemon() {
return run_as_daemon;
}
inline bool CheckDebugOpen() {
return debug_open;
}
inline string GetLogPath() {
return log_file_path;
}
/**
* config file changed
* **/
void ReadConfigFileAgain();
};
#endif //WEBSOCKET_CONFIG_H