2 // Created by mfritzsc on 8/1/17.
5 #ifndef TMCAGLWM_CONFIG_HPP
6 #define TMCAGLWM_CONFIG_HPP
9 #include <experimental/optional>
13 using std::experimental::optional;
14 using std::experimental::nullopt;
17 typedef std::map<std::string, std::string> map;
23 optional<std::string> get_string(char const *s) {
24 auto i = this->cfg.find(s);
25 return i != this->cfg.end() ? optional<std::string>(i->second) : nullopt;
28 optional<int> get_int(char const *s) {
29 auto i = this->cfg.find(s);
30 return i != this->cfg.end() ? optional<int>(std::stoi(i->second)) : nullopt;
37 #endif //TMCAGLWM_CONFIG_HPP