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 theType - type of the value.
56 * \param theDefaultValue - default value of the property. This is an initial property value
58 Config_Prop(const std::string& theSection, const std::string& theName,
59 const std::string& theTitle, PropType theType, const std::string& theDefaultValue)
61 mySection = theSection;
65 myValue = theDefaultValue;
66 myDefaultValue = theDefaultValue;
69 /// Get name of section
70 std::string section() const
74 /// Get name of property
75 std::string name() const
79 /// Get title of property
80 std::string title() const
84 /// Set title of property
85 void setTitle(const std::string& theTitle)
89 /// Get type of property
94 /// Set type of property
95 void setType(PropType theType)
99 /// Get property's value in string format
100 std::string value() const
104 /// Set property's value in string format
105 CONFIG_EXPORT void setValue(const std::string& theValue);
106 /// Get default value of property
107 std::string defaultValue() const
109 return myDefaultValue;
111 /// Set default value of property
112 CONFIG_EXPORT void setDefaultValue(const std::string& theValue);
113 /// Alows to compare Config_Prop with each other
114 bool operator==(const Config_Prop* theProp) const
116 return (mySection == theProp->section()) && (myName == theProp->name());
120 std::string mySection; ///< Name of section
121 std::string myName; ///< Name of property
122 std::string myTitle; ///< Title of property
123 PropType myType; ///< Type of property
124 std::string myValue; // Value in string format
125 std::string myDefaultValue; // Default value
128 typedef std::list<Config_Prop*> Config_Properties;