Update of /cvsroot/pclasses/pclasses2/src/App
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27116/src/App
Modified Files:
Config.cpp
Log Message:
- Removed ConfigValue and use LexT instead, as it adds unneeded complexity
Index: Config.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/src/App/Config.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Config.cpp 29 Jun 2005 00:11:10 -0000 1.2
+++ Config.cpp 1 Jul 2005 12:16:05 -0000 1.3
@@ -36,39 +36,6 @@
}
-ConfigValue::ConfigValue()
-{
-}
-
-ConfigValue::ConfigValue(const std::string& value)
-: _value(value)
-{
-}
-
-ConfigValue::ConfigValue(const Unicode::String& value)
-: _value(value)
-{
-}
-
-ConfigValue::ConfigValue(double value)
-{
- //@todo
-}
-
-ConfigValue::~ConfigValue() throw()
-{
-}
-
-const Unicode::String& ConfigValue::toString() const throw()
-{
- return _value;
-}
-
-StringList<Unicode::String> ConfigValue::toStringList() const
-{
- return StringList<Unicode::String>(_value, ",");
-}
-
ConfigSection::ConfigSection(Config* cfg, const std::string& name)
: _cfg(cfg), _name(name)
{
@@ -224,7 +191,7 @@
return i;
}
-const ConfigValue& ConfigSection::value(const std::string& name,
+const LexT& ConfigSection::value(const std::string& name,
bool add) throw(ConfigError)
{
value_iterator i = findValue(name);
@@ -234,32 +201,32 @@
if(!add)
throw ConfigError("Value not found", P_SOURCEINFO);
- const ConfigValue& val =
- (*_values.insert(_values.begin(), std::make_pair(name, ConfigValue()))).second;
+ const LexT& val =
+ (*_values.insert(_values.begin(), std::make_pair(name, LexT()))).second;
_cfg->setModified();
return val;
}
-const ConfigValue& ConfigSection::value(const std::string& name,
- const ConfigValue& defaultVal, bool add)
+const LexT& ConfigSection::value(const std::string& name,
+ const LexT& defaultVal, bool add)
{
value_iterator i = findValue(name);
if(i != _values.end())
return i->second;
- const ConfigValue* v = &defaultVal;
+ const LexT* v = &defaultVal;
if(add)
{
- v = &(*_values.insert(_values.begin(), std::make_pair(name, ConfigValue()))).second;
+ v = &(*_values.insert(_values.begin(), std::make_pair(name, defaultVal))).second;
_cfg->setModified();
}
return *v;
}
-void ConfigSection::setValue(const std::string& name, const ConfigValue& val)
+void ConfigSection::setValue(const std::string& name, const LexT& val)
{
value_iterator i = findValue(name);
if(i != _values.end())
|