From 4864ff85292d97cca5d610057ddf9c631da9d684 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Mon, 5 Jul 2021 18:57:36 +0200 Subject: [PATCH] Added specialization for get --- src/config_file.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config_file.hpp b/src/config_file.hpp index 80f127f..5e2d9b3 100644 --- a/src/config_file.hpp +++ b/src/config_file.hpp @@ -22,6 +22,11 @@ namespace sc { return sc::from_string(it->second); } + bool get(const std::string& key, bool default_value) { + std::string val {get(key, default_value ? "yes" : "no")}; + return val == "yes"; + } + private: bool _has_dir {false}; std::string _prog_name;