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
35 lines (29 loc) · 918 Bytes
/
ConfigParser.h
File metadata and controls
35 lines (29 loc) · 918 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
#pragma once
#include "ServerApplicationDefaultSettings.h"
#include "ServerApplicationsTree.h"
#include "Module.h"
#include <unordered_map>
#include <vector>
namespace HttpServer
{
class ConfigParser
{
private:
static bool includeConfigFile(const std::string &fileName, std::string &strBuf, const size_t offset = 0);
static bool addApplication(
const std::unordered_map<std::string, std::string> &app,
const ServerApplicationDefaultSettings &defaults,
std::vector<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,
std::unordered_map<std::string, std::string> &settings,
std::unordered_map<std::string, std::string> &mimes_types,
std::vector<Module> &modules,
ServerApplicationsTree &apps_tree
);
};
};