[CONF] Made a single configuration file
This commit is contained in:
@@ -66,6 +66,19 @@ Config::getString(std::string setting, std::string def)
|
||||
}
|
||||
}
|
||||
|
||||
boost::filesystem::path
|
||||
Config::getPath(std::string setting, boost::filesystem::path path)
|
||||
{
|
||||
try {
|
||||
const char* res = _config->lookup(setting);
|
||||
return boost::filesystem::path(std::string(res));
|
||||
}
|
||||
catch (std::exception &e)
|
||||
{
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long
|
||||
Config::getULong(std::string setting, unsigned long def)
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@ class Config
|
||||
|
||||
// Default values are returned in case of setting not found
|
||||
std::string getString(std::string setting, std::string def = "");
|
||||
boost::filesystem::path getPath(std::string setting, boost::filesystem::path def = boost::filesystem::path());
|
||||
unsigned long getULong(std::string setting, unsigned long def = 0);
|
||||
long getLong(std::string setting, long def = 0);
|
||||
bool getBool(std::string setting, bool def = false);
|
||||
|
||||
Reference in New Issue
Block a user