codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#ifndef ENVTEST_H_ #define ENVTEST_H_ #include <sys/types.h> #include <errno.h> #include <iostream> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* include environtmenCreate class */ #include <db_cxx.h> using std::ostream; using std::cout; using std::cerr; class EnvironmentCreate { public: /* * constructor for create path and database name. */ EnvironmentCreate( std::string& pathCreate, std::string& databaseName, const char *valuePrograms_, bool isSecondary ); EnvironmentCreate(); /* * Desconstructor */ ~EnvironmentCreate(){ close(); } /* insert value into database * Boolean return,If can insert value into database */ virtual bool insertDatabase( char *keyInsert, char *valueInsertm, const EnvironmentCreate& environmentDatabasePathName); // // /* // * If can read database,return bool and show data in database; // */ // virtual bool readDatabase( const char* pathRead, const char* databaseName ); /*Accessor*/ inline Db& getDb() { return databaseDBObject_; } // inline setDbt( char* keyInsert, unsigned int keylen ) // { // keySet_( keyInsert, keylen +1 ); // } private: /*for create database and depend path */ std::string pathCreate_; std::string databaseName_; const char *keyInsert_; const char *valueInsert_; /*set file name in constructor*/ std::string pathDbFileName_; /* database object */ Db databaseDBObject_; u_int32_t cFlags_; /* * author Chatsiri.rat * Dbt for set key and data */ Dbt keySet_, valueSet_; /* Environment object*/ //DbEnv databaseEnvironmentObject_; /*default constructor */ /*close database*/ void close(); const char *programs_; //EnvironmentCreate(): databaseDBObject_(NULL,0){} }; #endif /*ENVTEST_H_*/
Private
[
?
]
Run code