database.h
Go to the documentation of this file.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
00026
00028
00029 #ifndef _DATABASE
00030 #define _DATABASE
00031
00032 #include <string>
00033 #include <map>
00034
00035 #ifdef USE_LIBDB
00036 #include <db_cxx.h>
00037
00038
00039 #if (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==0)
00040 #define OPEN(name,db,type,flags,mode) open(name,db,type,flags,mode)
00041 #else
00042 #if DB_VERSION_MAJOR>=4
00043 #define OPEN(name,db,type,flags,mode) open(NULL,name,db,type,flags,mode)
00044 #endif
00045 #endif
00046
00047 #endif
00048
00049
00054
00055 #ifdef USE_LIBDB
00056 class database : Db {
00057 #else
00058 class database {
00059 #endif
00060
00061 private:
00063 bool usingDB;
00065 std::map<std::string,std::string> dbmap;
00066
00067 public:
00069 database();
00071 ~database();
00072
00074 void open_database(const std::string &);
00076 void close_database();
00078 std::string access_database(const std::string &);
00079 };
00080
00081 #endif