mgmt refactoring: ManagerBase
Change-Id: I0710297f352723874d05092d091128b02b3747a2
Refs: #2107
diff --git a/core/config-file.cpp b/core/config-file.cpp
index 9724168..d989455 100644
--- a/core/config-file.cpp
+++ b/core/config-file.cpp
@@ -52,6 +52,25 @@
// do nothing
}
+bool
+ConfigFile::parseYesNo(const ConfigSection::const_iterator& i,
+ const std::string& optionName,
+ const std::string& sectionName)
+{
+ const std::string value = i->second.get_value<std::string>();
+ if (value == "yes") {
+ return true;
+ }
+
+ if (value == "no") {
+ return false;
+ }
+
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for option \"" +
+ optionName + "\" in \"" +
+ sectionName + "\" section"));
+}
+
ConfigFile::ConfigFile(UnknownConfigSectionHandler unknownSectionCallback)
: m_unknownSectionCallback(unknownSectionCallback)
{