46
46
static const char * const TRUE_STR = "true";
47
47
static const char * const FALSE_STR = "false";
49
class ConfigTreeItem {
52
ConfigTreeItem() : name_(""), value_(""), defaultValue_(""), type_("string") {}
54
// defaultvalue = value
55
ConfigTreeItem(const std::string& name, const std::string& value, const std::string& type) :
56
name_(name), value_(value),
57
defaultValue_(value), type_(type) {}
59
ConfigTreeItem(const std::string& name, const std::string& value, const std::string& defaultValue, const std::string& type) :
60
name_(name), value_(value),
61
defaultValue_(defaultValue), type_(type) {}
63
void setValue(const std::string& value) {
67
std::string getName() const {
71
std::string getValue() const {
75
std::string getDefaultValue() const {
79
std::string getType() const {
86
std::string defaultValue_;
50
92
typedef std::map<std::string, ConfigTreeItem> ItemMap;
51
93
typedef std::map<std::string, ItemMap> SectionMap;
152
194
NON_COPYABLE(ConfigTree);
155
class ConfigTreeItem {
158
ConfigTreeItem() : name_(""), value_(""), defaultValue_(""), type_("string") {}
160
// defaultvalue = value
161
ConfigTreeItem(const std::string& name, const std::string& value, const std::string& type) :
162
name_(name), value_(value),
163
defaultValue_(value), type_(type) {}
165
ConfigTreeItem(const std::string& name, const std::string& value, const std::string& defaultValue, const std::string& type) :
166
name_(name), value_(value),
167
defaultValue_(defaultValue), type_(type) {}
169
void setValue(const std::string& value) {
173
std::string getName() const {
177
std::string getValue() const {
181
std::string getDefaultValue() const {
182
return defaultValue_;
185
std::string getType() const {
192
std::string defaultValue_;
196
197
} // end namespace ConfigTree
198
199
#endif // __CONFIG_CONFIG_H__