00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef IXE_conf_conf_set_H
00026 #define IXE_conf_conf_set_H
00027
00028
00029 #include <set>
00030
00031
00032 #include "conf/conf.h"
00033 #include "text/strings.h"
00034
00035 using namespace Tanl::Text;
00036
00037 namespace IXE {
00038
00046 template <class T>
00047 class conf_set : public Var<std::set<T> >
00048 {
00049 public:
00050
00051 conf_set(char const* name) : Var<std::set<T> >(name) { }
00052
00053 conf_set(char const* name, char const* value) : Var<std::set<T> >(name) {
00054 this->value.insert(value);
00055 }
00056
00057 virtual bool contains(T const& s) const {
00058 return this->value.find(s) != this->value.end(); }
00059
00060 protected:
00067 virtual void parseValue(char const*& line);
00068
00069 virtual void reset() { this->value.clear(); }
00070 };
00071
00078 typedef conf_set<std::string> conf_stringset;
00079
00080 template <>
00081 void conf_set<std::string>::parseValue(char const*& line);
00082
00083 template <>
00084 void conf_set<int>::parseValue(char const*& line);
00085
00086 }
00087
00088 #endif