X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_PropManager.cpp;h=ad5ceca9b779bb2a0b0c3865c6625219646e1b86;hb=853e0eec6016120b641efa6adf427a239cf203cf;hp=82ec43f5871c82fba052e124ee830189943d53ef;hpb=f1cd93fd02a54259f72e3191d037323a496b2bef;p=modules%2Fshaper.git diff --git a/src/Config/Config_PropManager.cpp b/src/Config/Config_PropManager.cpp index 82ec43f58..ad5ceca9b 100644 --- a/src/Config/Config_PropManager.cpp +++ b/src/Config/Config_PropManager.cpp @@ -9,6 +9,7 @@ std::vector stringToRGB(const std::string& theColor); int stringToInteger(const std::string& theInt); double stringToDouble(const std::string& theDouble); +bool stringToBoolean(const std::string& theInt); Config_Properties Config_PropManager::myProps; @@ -121,6 +122,14 @@ double Config_PropManager::real(const std::string& theSection, const std::string return stringToDouble(aStr); } +bool Config_PropManager::boolean(const std::string& theSection, + const std::string& theName, + const std::string& theDefault) +{ + std::string aStr = string(theSection, theName, theDefault); + return stringToBoolean(aStr); +} + std::vector stringToRGB(const std::string& theColor) { std::vector aRes(3); @@ -173,3 +182,8 @@ double stringToDouble(const std::string& theDouble) char* p; return strtod(theDouble.c_str(), &p); } + +bool stringToBoolean(const std::string& theBoolean) +{ + return theBoolean == "true"; +}