forked from sstokic-tgm/Gladiatorcheatz-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.hpp
42 lines (32 loc) · 947 Bytes
/
Config.hpp
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
#pragma once
#include <string>
#include <map>
#include <list>
namespace ConfigMngr
{
class Config
{
public:
Config() = default;
~Config() = default;
bool loadInitial(std::string const &file);
std::string getString(std::string const &name);
bool getBool(std::string const &name);
int getInt(std::string const &name);
float getFloat(std::string const &name);
inline std::map<std::string, std::string> &getSymbols()
{
return m_mapSymbols;
}
private:
void add(std::string name, std::string value);
void split(std::string in, std::string &left, std::string &right, char c);
void trim(std::string &s);
void symbolExpand(std::string &s);
void symbolExpand(std::map<std::string, std::string> &symbols, std::string &s);
void envSymbolExpand(std::string &s);
std::map<std::string, std::string> m_mapSymbols;
std::map<std::string, std::string> m_mapEnvSymbols;
std::list<Config*> m_listGroupStack;
};
}