diff --git a/src/Config.cpp b/src/Config.cpp index 833c1f0e5..1141df61f 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -585,6 +585,12 @@ void Config::clear () std::map ::clear (); } +//////////////////////////////////////////////////////////////////////////////// +const bool Config::has (const std::string& key) +{ + return (*this).find (key) != (*this).end (); +} + //////////////////////////////////////////////////////////////////////////////// // Return the configuration value given the specified key. const std::string Config::get (const std::string& key) diff --git a/src/Config.h b/src/Config.h index de5054465..2899c40d4 100644 --- a/src/Config.h +++ b/src/Config.h @@ -49,6 +49,7 @@ public: void setDefaults (); void clear (); + const bool has (const std::string&); const std::string get (const std::string&); const int getInteger (const std::string&); const double getReal (const std::string&);