X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_PropManager.h;h=9b2ced3eafdf41b28ec17b152c9c459eb04d39f8;hb=1834431e0e067cbb4616f42679562d56af528f5e;hp=90df27705fb9f1aa7f2a405b12e376a6f4fe10d0;hpb=24f1ad2fd93475684288c899fb4fffcf05f6c21e;p=modules%2Fshaper.git diff --git a/src/Config/Config_PropManager.h b/src/Config/Config_PropManager.h index 90df27705..9b2ced3ea 100644 --- a/src/Config/Config_PropManager.h +++ b/src/Config/Config_PropManager.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: Config_PropManager.h // Created: 13 Aug 2014 // Author: Vitaly SMETANNIKOV @@ -12,49 +14,59 @@ #include #include -//! Class wihich let to register properties +/** + * \class Config_PropManager + * \ingroup Config + * \brief Class which let to register properties + */ class Config_PropManager { public: /** * Registers property parameters - * \param theOwnerId - name of owner (name of plugin for example) * \param theSection - name of section (domain of using) of the property. * \param theName - name (title) of the value. + * \param theTitle - title of the value. * \param theType - type of the value. * \param theDefValue - default and initial value of the property * Returns True if the property succesfully registered */ - CONFIG_EXPORT static bool 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); - + //! Returns std::list of all existing properies CONFIG_EXPORT static Config_Properties getProperties(); - //! Returns list of registered section names. CONFIG_EXPORT static std::list getSections(); - //! Returns list of properties by its owner and section. CONFIG_EXPORT static Config_Properties getProperties(const std::string& theSection); //! 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); - - CONFIG_EXPORT static std::vector color( - const std::string& theSection, const std::string& theName, const std::string& theDefault); - - CONFIG_EXPORT static int integer( - const std::string& theSection, const std::string& theName, const std::string& theDefault); - - CONFIG_EXPORT static double real( - const std::string& theSection, const std::string& theName, const std::string& theDefault); + CONFIG_EXPORT static std::string string(const std::string& theSection, + const std::string& theName, + const std::string& theDefault); + //! Returns color by given section and name as 3-element vector {r,g,b}. + CONFIG_EXPORT static std::vector color(const std::string& theSection, + const std::string& theName, + const std::string& theDefault); + //! Returns integer by given section and name + CONFIG_EXPORT static int integer(const std::string& theSection, + const std::string& theName, + const std::string& theDefault); + //! Returns real by given section and name + CONFIG_EXPORT static double real(const std::string& theSection, + const std::string& theName, + const std::string& theDefault); + //! Returns boolean by given section and name + CONFIG_EXPORT static bool boolean(const std::string& theSection, + const std::string& theName, + const std::string& theDefault); private: - CONFIG_EXPORT static Config_Properties myProps; + CONFIG_EXPORT static Config_Properties myProps; ///< List of all stored properties }; #endif