log
This commit is contained in:
17
Database.hpp
17
Database.hpp
@ -2,17 +2,34 @@
|
||||
#define DATABASE_HPP_
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <sqlite3.h>
|
||||
|
||||
|
||||
class DatabaseError {};
|
||||
|
||||
typedef std::map<std::string, std::string> result_t;
|
||||
|
||||
// resource management class
|
||||
class PreparedStatement {
|
||||
public:
|
||||
friend class DatabaseHandle;
|
||||
|
||||
~PreparedStatement();
|
||||
result_t next();
|
||||
private:
|
||||
PreparedStatement(sqlite3 *dbh, const std::string& statement);
|
||||
sqlite3_stmt *stmt;
|
||||
};
|
||||
|
||||
|
||||
// resource management class
|
||||
class DatabaseHandle {
|
||||
public:
|
||||
DatabaseHandle(const std::string& filename);
|
||||
~DatabaseHandle();
|
||||
sqlite3 *getHandle() { return dbh; }
|
||||
PreparedStatement prepareStatement(const std::string& statement);
|
||||
private:
|
||||
sqlite3 *dbh;
|
||||
};
|
||||
|
Reference in New Issue
Block a user