00001 #ifndef CAFE_CONFIG_HPP__
00002 #define CAFE_CONFIG_HPP__
00003
00004 #include <string>
00005 #include <vector>
00006
00007 class TEnv;
00008 class TDirectory;
00009
00010 namespace cafe {
00011
00035 class Config {
00036 public:
00037 Config(const std::string& name);
00038 virtual ~Config();
00039
00043
00044
00046 std::string get(const std::string& key, const std::string& def);
00047
00049 int get(const std::string& key, int def);
00050
00052 double get(const std::string& key, double def);
00053
00055 std::vector<std::string> getVString(const std::string& key, const std::string& delim = " ");
00056
00058 std::vector<float> getVFloat(const std::string& key, const std::string& delim = " ");
00059
00061 std::vector<int> getVInt(const std::string& key, const std::string& delim = " ");
00062
00064
00066 void set(const std::string& key, const std::string& value);
00067
00069 void dumpConfig(std::ostream& stream);
00070
00072 void dumpConfig(TDirectory* const dir, std::string const name = "configDB");
00073
00074 private:
00075 std::string _name;
00076 static TEnv& getEnv();
00077 };
00078 }
00079
00080 #endif // CAFE_CONFIG_HPP__