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