11 #ifndef RECAST_CONFIG_H
12 #define RECAST_CONFIG_H
14 #include <boost/property_tree/ptree.hpp>
26 Config(
const std::string &filename);
32 boost::property_tree::ptree &
tree();
49 T
get(
const std::string &key, T defaultVar) {
51 return tree().get<T>(key);
52 }
catch (std::exception &e) {
53 tree().put(key, defaultVar);
59 static T
g(
const std::string &key, T defaultVar) {
65 boost::property_tree::ptree pt;
69 #endif //RECAST_CONFIG_H
void load()
Definition: Config.cpp:62
Config(const std::string &filename)
void save()
Definition: Config.cpp:50
boost::property_tree::ptree & tree()
Definition: Config.cpp:46
Config class.
Definition: Config.hpp:24
static Config * instance()
Definition: Config.cpp:27
T get(const std::string &key, T defaultVar)
Definition: Config.hpp:49
~Config()
Definition: Config.cpp:66
static T g(const std::string &key, T defaultVar)
Definition: Config.hpp:59