summaryrefslogtreecommitdiff
path: root/src/config/config.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-02-05 22:53:36 +0100
committerlouiz’ <louiz@louiz.org>2018-02-05 22:53:36 +0100
commit56651cb5c29cc50ddf3c62c37167fa0b9389bfde (patch)
treeca652963cafeb02b0c6c7504b1cfbc27abdafe0b /src/config/config.cpp
parentad1e0f8d52189e18df2d5a39228e255798a9de70 (diff)
parente0d1a0b44add408504e428d6ce4a8a2121ea7a00 (diff)
downloadbiboumi-56651cb5c29cc50ddf3c62c37167fa0b9389bfde.tar.gz
biboumi-56651cb5c29cc50ddf3c62c37167fa0b9389bfde.tar.bz2
biboumi-56651cb5c29cc50ddf3c62c37167fa0b9389bfde.tar.xz
biboumi-56651cb5c29cc50ddf3c62c37167fa0b9389bfde.zip
Merge branch 'master' into debian
Diffstat (limited to 'src/config/config.cpp')
-rw-r--r--src/config/config.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config/config.cpp b/src/config/config.cpp
index 0f3d639..412b170 100644
--- a/src/config/config.cpp
+++ b/src/config/config.cpp
@@ -23,6 +23,14 @@ std::string Config::get(const std::string& option, const std::string& def)
return it->second;
}
+bool Config::get_bool(const std::string& option, const bool def)
+{
+ auto res = Config::get(option, "");
+ if (res.empty())
+ return def;
+ return res == "true";
+}
+
int Config::get_int(const std::string& option, const int& def)
{
std::string res = Config::get(option, "");