-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathConfigParser.h
More file actions
executable file
·34 lines (26 loc) · 817 Bytes
/
Copy pathConfigParser.h
File metadata and controls
executable file
·34 lines (26 loc) · 817 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
#ifndef CONFIG_PARSER
#define CONFIG_PARSER
#include <algorithm>
#include <fstream>
#include <map>
#include <sstream>
class ConfigParser
{
private:
std::string inputfileName;
std::map<std::string, std::string> values;
std::string findValue(std::string const &) const;
public:
ConfigParser() {}
ConfigParser(std::string const &filename) { load(filename); }
bool getBool(std::string const &) const;
char getChar(std::string const &) const;
double getDouble(std::string const &) const;
float getFloat(std::string const &) const;
int getInt(std::string const &) const;
short getShort(std::string const &) const;
std::size_t getSizeT(std::string const &) const;
std::string getString(std::string const &) const;
void load(std::string const &);
};
#endif