00001 00004 #ifndef P_CONFIG_HH 00005 #define P_CONFIG_HH 00006 00007 #include <stdlib.h> 00008 #include <string> 00009 #include <map> 00010 #include <blort/Recognizer3D/PNamespace.hh> 00011 00012 namespace P 00013 { 00014 00015 class Config 00016 { 00017 public: 00018 map<string, string> items; 00019 00020 public: 00021 Config() {} 00022 Config(const char *filename); 00023 void Load(const char *filename); 00024 void AddItem(const string &name, const string &value) {items[name] = value;} 00025 bool ExistItem(const string &name); 00026 string GetValueString(const string &name) {return items[name];} 00027 int GetValueInt(const string &name) {return atoi(items[name].c_str());} 00028 double GetValueDouble(const string &name) {return atof(items[name].c_str());} 00029 }; 00030 00031 } 00032 00033 #endif 00034