diff options
Diffstat (limited to 'lib/configuration')
-rw-r--r-- | lib/configuration/configuration.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/configuration/configuration.h b/lib/configuration/configuration.h index 1c919b0..c5e044f 100644 --- a/lib/configuration/configuration.h +++ b/lib/configuration/configuration.h @@ -9,13 +9,13 @@ #ifndef SMOLBOTE_CONFIGURATION_H #define SMOLBOTE_CONFIGURATION_H -#include <optional> -#include <string> -#include <vector> #include <QString> -#include <boost/program_options.hpp> #include <QStringList> #include <QVariant> +#include <boost/program_options.hpp> +#include <optional> +#include <string> +#include <vector> class Configuration { @@ -43,16 +43,15 @@ public: std::string r; try { r = vm[path].as<std::string>(); - } catch (boost::bad_any_cast &) { + } catch(boost::bad_any_cast &) { // try int try { r = std::to_string(vm[path].as<int>()); - } catch (boost::bad_any_cast &) { + } catch(boost::bad_any_cast &) { // try bool, and crash if not that either r = vm[path].as<bool>() ? "true" : "false"; } - } // check if it's a path @@ -65,7 +64,8 @@ public: return std::optional<T>(vm[path].as<T>()); } - const std::vector<boost::shared_ptr<boost::program_options::option_description>> & options() { + const std::vector<boost::shared_ptr<boost::program_options::option_description>> &options() + { return desc.options(); } |