Update Constant attribute in class SQLDB

This commit is contained in:
Kirigaya Kazuto 2017-06-09 22:59:53 +08:00
parent 01a8eb27b1
commit 81855f4cfc
2 changed files with 5 additions and 5 deletions

View File

@ -42,13 +42,13 @@ int _global_sqldb_executor(void* ExParam,int colNum,char** colVal,char** colName
return (*p)(colNum,colVal,colName);
}
//private
void SQLDB::_set(sqlite3* p)
{
_db.reset(p,sqlite3_close);
}
sqlite3* SQLDB::_get()
//private
sqlite3* SQLDB::_get() const
{
return _db.get();
}
@ -85,7 +85,7 @@ int SQLDB::exec_raw(const std::string& SQLCommand,SQLCallback callback,void* par
{
return _exec_real(SQLCommand,callback,param);
}
//private
int SQLDB::_exec_real(const std::string& SQLCommand,SQLCallback callback,void* param)
{
return sqlite3_exec(_get(),SQLCommand.c_str(),callback,param,&_errmsg);

View File

@ -58,7 +58,7 @@ public:
private:
int _exec_real(const std::string& SQLCommand,SQLCallback callback,void* param);
sqlite3* _get();
sqlite3* _get() const;
void _set(sqlite3*);
std::shared_ptr<sqlite3> _db;
char* _errmsg;