00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __CONFIG_H
00013 #define __CONFIG_H
00014
00015 #ifdef HAVE_CONFIG_H
00016 #include <config.h>
00017 #endif
00018
00019 #include <string>
00020
00021 #include <Error.h>
00022 #include <HashUtils.h>
00023 #include <XMLReader.h>
00024
00025
00026 using namespace std;
00027
00031 class Config
00032 {
00033 public:
00037 Config( string filename );
00038
00042 ~Config();
00043
00049 ConfigError get( string key, string &value );
00050
00057 string getDefault( string key, string defvalue );
00058
00064 ConfigError set( string key, string value );
00065
00069 ConfigError load();
00070
00074 ConfigError save();
00075
00076 private:
00077 string filename;
00078 hash_map<string,string,_hash_string> keys;
00079 };
00080
00081 #endif