forked from slomkowski/mumsi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Configuration.hpp
40 lines (27 loc) · 886 Bytes
/
Configuration.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
#pragma once
#include <boost/noncopyable.hpp>
#include <vector>
#include <string>
#include <stdexcept>
#include <unordered_map>
namespace config {
class ConfigException : public std::runtime_error {
public:
ConfigException(const std::string &message)
: std::runtime_error(message) {
}
};
struct ConfigurationImpl;
class Configuration : boost::noncopyable {
public:
Configuration(const std::string fileName);
Configuration(const std::vector<std::string> fileNames);
~Configuration();
int getInt(const std::string &property);
bool getBool(const std::string &property);
std::string getString(const std::string &property);
std::unordered_map<std::string, std::string> getChildren(const std::string &property);
private:
ConfigurationImpl *impl;
};
}