forked from awwit/httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigParser.h
More file actions
43 lines (36 loc) · 874 Bytes
/
ConfigParser.h
File metadata and controls
43 lines (36 loc) · 874 Bytes
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
#pragma once
#include "../ServerSettings.h"
#include "../../system/Module.h"
#include <vector>
namespace HttpServer
{
class ConfigParser
{
private:
struct ServerApplicationDefaultSettings {
std::string temp_dir;
size_t request_max_size;
};
static bool includeConfigFile(
const std::string &fileName,
std::string &strBuf,
const size_t offset = 0
);
static bool addApplication(
const std::unordered_multimap<std::string, std::string> &app,
const ServerApplicationDefaultSettings &defaults,
std::vector<System::Module> &modules,
ServerApplicationsTree &apps_tree
);
static bool parseMimes(
const std::string &fileName,
std::unordered_map<std::string, std::string> &mimes_types
);
public:
bool loadConfig(
const std::string &conf,
ServerSettings &settings,
std::vector<System::Module> &modules
);
};
}