acl/lib_acl_cpp/include/acl_cpp/db/sqlite_pool.hpp

38 lines
776 B
C++
Raw Normal View History

#pragma once
2017-06-02 14:47:24 +08:00
#include "../acl_cpp_define.hpp"
#include "../db/db_pool.hpp"
2014-11-19 00:25:21 +08:00
#if !defined(ACL_DB_DISABLE)
2014-11-19 00:25:21 +08:00
namespace acl {
class db_handle;
2015-08-12 16:48:24 +08:00
class ACL_CPP_API sqlite_pool : public db_pool
2014-11-19 00:25:21 +08:00
{
public:
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param dbfile {const char*} sqlite <EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
* @param dblimit {size_t} <EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param charset {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
sqlite_pool(const char* dbfile, size_t dblimit = 64,
const char* charset = "utf-8");
2014-11-19 00:25:21 +08:00
~sqlite_pool();
2015-08-12 16:48:24 +08:00
2014-11-19 00:25:21 +08:00
protected:
// <20><><EFBFBD><EFBFBD> connect_pool <20><><EFBFBD><EFBFBD><E9BAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ӿ<EFBFBD><D3BE><EFBFBD>
2015-08-12 16:48:24 +08:00
connect_client* create_connect();
2014-11-19 00:25:21 +08:00
private:
// sqlite <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
2014-11-19 00:25:21 +08:00
char* dbfile_;
// sqlite <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
char* charset_;
2014-11-19 00:25:21 +08:00
};
} // namespace acl
#endif // !defined(ACL_DB_DISABLE)