Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / Config / Config_PropManager.cpp
index e6f800c27f649ba7c91b23f5c4ac701ff5a79e59..ad5ceca9b779bb2a0b0c3865c6625219646e1b86 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        Config_PropManager.cpp
 // Created:     13 Aug 2014
 // Author:      Vitaly SMETANNIKOV
@@ -7,6 +9,7 @@
 std::vector<int> 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;
 
@@ -119,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<int> stringToRGB(const std::string& theColor)
 {
   std::vector<int> aRes(3);
@@ -171,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";
+}