1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 // Created: 12 Aug 2014
5 // Author: Vitaly SMETANNIKOV
10 #include "Config_def.h"
17 * \brief Class which describes a one property
24 /// Type of stored property
52 * Creates a one property
53 * \param theSection - name of section (domain of using) of the property.
54 * \param theName - name (title) of the value.
55 * \param theTitle - title of the value
56 * \param theType - type of the value.
57 * \param theDefaultValue - default value of the property. This is an initial property value
59 Config_Prop(const std::string& theSection, const std::string& theName,
60 const std::string& theTitle, PropType theType, const std::string& theDefaultValue)
62 mySection = theSection;
66 myValue = theDefaultValue;
67 myDefaultValue = theDefaultValue;
70 /// Get name of section
71 std::string section() const
75 /// Get name of property
76 std::string name() const
80 /// Get title of property
81 std::string title() const
85 /// Set title of property
86 void setTitle(const std::string& theTitle)
90 /// Get type of property
95 /// Set type of property
96 void setType(PropType theType)
100 /// Get property's value in string format
101 std::string value() const
105 /// Set property's value in string format
106 CONFIG_EXPORT void setValue(const std::string& theValue);
107 /// Get default value of property
108 std::string defaultValue() const
110 return myDefaultValue;
112 /// Set default value of property
113 CONFIG_EXPORT void setDefaultValue(const std::string& theValue);
114 /// Alows to compare Config_Prop with each other
115 bool operator==(const Config_Prop* theProp) const
117 return (mySection == theProp->section()) && (myName == theProp->name());
121 std::string mySection; ///< Name of section
122 std::string myName; ///< Name of property
123 std::string myTitle; ///< Title of property
124 PropType myType; ///< Type of property
125 std::string myValue; // Value in string format
126 std::string myDefaultValue; // Default value
129 typedef std::list<Config_Prop*> Config_Properties;