Update of /cvsroot/pclasses/pclasses2/include/pclasses/App
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27116/include/pclasses/App
Modified Files:
Config.h
Log Message:
- Removed ConfigValue and use LexT instead, as it adds unneeded complexity
Index: Config.h
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/App/Config.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Config.h 29 Jun 2005 00:11:09 -0000 1.2
+++ Config.h 1 Jul 2005 12:16:04 -0000 1.3
@@ -24,6 +24,7 @@
#include <pclasses/Export.h>
#include <pclasses/Exception.h>
#include <pclasses/StringList.h>
+#include <pclasses/LexT.h>
#include <pclasses/Unicode/String.h>
#include <pclasses/IO/IOError.h>
#include <pclasses/IO/URL.h>
@@ -40,46 +41,15 @@
~ConfigError() throw();
};
-class PAPP_EXPORT ConfigValue {
- public:
- ConfigValue();
- ConfigValue(const std::string& value);
- ConfigValue(const Unicode::String& value);
-
- template <class StringType>
- ConfigValue(const StringList<StringType>& value)
- : _value(value.join(","))
- { }
-
- ConfigValue(double value);
- ConfigValue(Int32 value);
- ConfigValue(UInt32 value);
-
- ~ConfigValue() throw();
-
- const Unicode::String& toString() const throw();
-
- StringList<Unicode::String> toStringList() const;
-
- double toDouble() const;
-
- Int32 toInt() const;
-
- UInt32 toUInt() const;
-
- private:
- Unicode::String _value;
-};
-
class PAPP_EXPORT ConfigSection {
public:
typedef std::list<ConfigSection*> section_list;
typedef section_list::iterator section_iterator;
typedef section_list::const_iterator section_const_iterator;
- typedef std::list<std::pair<std::string, ConfigValue> > value_map;
- typedef value_map::iterator value_iterator;
- typedef value_map::const_iterator value_const_iterator;
+ typedef std::list<std::pair<std::string, LexT> > value_list;
+ typedef value_list::iterator value_iterator;
+ typedef value_list::const_iterator value_const_iterator;
const std::string& name() const throw();
@@ -110,13 +80,13 @@
value_const_iterator findValue(const std::string& name)
const throw();
- const ConfigValue& value(const std::string& name, bool add = false)
+ const LexT& value(const std::string& name, bool add = false)
throw(ConfigError);
- const ConfigValue& value(const std::string& name,
- const ConfigValue& defaultVal, bool add = false);
+ const LexT& value(const std::string& name,
+ const LexT& defaultVal, bool add = false);
- void setValue(const std::string& name, const ConfigValue& val);
+ void setValue(const std::string& name, const LexT& val);
bool removeValue(const std::string& name) throw();
@@ -132,7 +102,7 @@
Config* _cfg;
std::string _name;
section_list _sections;
- value_map _values;
+ value_list _values;
};
class PAPP_EXPORT Config {
|