Salome HOME
Fix due to the coding standards.
[modules/shaper.git] / src / Config / Config_PropManager.h
index 9b2ced3eafdf41b28ec17b152c9c459eb04d39f8..60e32f58967e6fbe46575f109508b2d0141e04e6 100644 (file)
@@ -1,8 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        Config_PropManager.h
-// Created:     13 Aug 2014
-// Author:      Vitaly SMETANNIKOV
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef Config_PropManager_H
 #define Config_PropManager_H
@@ -32,8 +46,10 @@ class Config_PropManager
    * \param theDefValue - default and initial value of the property
    * Returns True if the property succesfully registered
    */
-  CONFIG_EXPORT static Config_Prop* registerProp(const std::string& theSection, const std::string& theName,
-    const std::string& theTitle, Config_Prop::PropType theType, const std::string& theDefValue = "");
+  CONFIG_EXPORT static Config_Prop* registerProp(const std::string& theSection,
+    const std::string& theName,
+    const std::string& theTitle, Config_Prop::PropType theType,
+    const std::string& theDefValue = "");
   //! Finds property in the given section by the given name, if property not found returns NULL
   CONFIG_EXPORT static Config_Prop* findProp(
     const std::string& theSection, const std::string& theName);
@@ -46,24 +62,24 @@ class Config_PropManager
 
   //! Returns value of the property by its owner, section, and name
   CONFIG_EXPORT static std::string string(const std::string& theSection,
-                                          const std::string& theName,
-                                          const std::string& theDefault);
+                                          const std::string& theName);
   //! Returns color by given section and name as 3-element vector {r,g,b}.
   CONFIG_EXPORT static std::vector<int> color(const std::string& theSection,
-                                              const std::string& theName,
-                                              const std::string& theDefault);
+                                              const std::string& theName);
   //! Returns integer by given section and name
   CONFIG_EXPORT static int integer(const std::string& theSection,
-                                   const std::string& theName,
-                                   const std::string& theDefault);
+                                   const std::string& theName);
   //! Returns real by given section and name
   CONFIG_EXPORT static double real(const std::string& theSection,
-                                   const std::string& theName,
-                                   const std::string& theDefault);
+                                   const std::string& theName);
   //! Returns boolean by given section and name
   CONFIG_EXPORT static bool boolean(const std::string& theSection,
-                                   const std::string& theName,
-                                   const std::string& theDefault);
+                                   const std::string& theName);
+  //! Returns convertion of the string to double value. Temporary changes locale to process
+  //! values contained "," or "." separator.
+  //! \param theDouble a value to be converted
+  //! \return double result or zero
+  CONFIG_EXPORT static double stringToDouble(const std::string& theDouble);
 
  private:
   CONFIG_EXPORT static Config_Properties myProps; ///< List of all stored properties