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