add read/writeIntList support for ConfigFile (for blindslist)

This commit is contained in:
doitux
2007-09-22 23:58:17 +00:00
parent 2f5cf87291
commit 5c1847adf4
3 changed files with 171 additions and 20 deletions
+6 -3
View File
@@ -27,7 +27,7 @@
#include <boost/thread.hpp>
enum ConfigState { NONEXISTING, OLD };
enum ConfigType { CONFIG_TYPE_INT, CONFIG_TYPE_STRING };
enum ConfigType { CONFIG_TYPE_INT, CONFIG_TYPE_STRING, CONFIG_TYPE_INT_LIST };
class QtToolsInterface;
@@ -46,8 +46,9 @@ public:
void writeConfigString(std::string varName, std::string varCont);
int readConfigInt(std::string varName) const;
std::list<int> readConfigIntList(std::string varName) const;
void writeConfigInt(std::string varName, int varCont);
void writeConfigIntList(std::string varName, std::list<int> varCont);
private:
@@ -55,10 +56,12 @@ private:
struct ConfigInfo
{
ConfigInfo(const std::string &n, ConfigType t, const std::string &d) : name(n), type(t), defaultValue(d) {}
ConfigInfo(const std::string &n, ConfigType t, const std::string &d, const std::list<std::string> &l =std::list<std::string>()) : name(n), type(t), defaultValue(d), defaultListValue(l) {}
std::string name;
ConfigType type;
std::string defaultValue;
std::list<std::string> defaultListValue;
};
std::vector<ConfigInfo> configList;