mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Cleanup on PR #142 : remove whitespaces and mutualize some code
This commit is contained in:
parent
f4947e7a03
commit
94c7897d1b
@ -75,11 +75,10 @@ public:
|
|||||||
/// Finalize and unregister the SQL query from the SQLite Database Connection.
|
/// Finalize and unregister the SQL query from the SQLite Database Connection.
|
||||||
~Statement();
|
~Statement();
|
||||||
|
|
||||||
/// Reset the statement to make it ready for a new execution.
|
/// Reset the statement to make it ready for a new execution. Throws an exception on error.
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
/// Reset the statement to make it ready for a new execution. Returns the sqlite result code
|
/// Reset the statement. Returns the sqlite result code instead of throwing an exception on error.
|
||||||
/// instead of throwing an exception on error.
|
|
||||||
int tryReset() noexcept;
|
int tryReset() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,9 +52,7 @@ Statement::~Statement()
|
|||||||
// Reset the statement to make it ready for a new execution (see also #clearBindings() bellow)
|
// Reset the statement to make it ready for a new execution (see also #clearBindings() bellow)
|
||||||
void Statement::reset()
|
void Statement::reset()
|
||||||
{
|
{
|
||||||
mbOk = false;
|
const int ret = tryReset();
|
||||||
mbDone = false;
|
|
||||||
const int ret = sqlite3_reset(mStmtPtr);
|
|
||||||
check(ret);
|
check(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,8 +60,7 @@ int Statement::tryReset() noexcept
|
|||||||
{
|
{
|
||||||
mbOk = false;
|
mbOk = false;
|
||||||
mbDone = false;
|
mbDone = false;
|
||||||
const int ret = sqlite3_reset(mStmtPtr);
|
return sqlite3_reset(mStmtPtr);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clears away all the bindings of a prepared statement (can be associated with #reset() above).
|
// Clears away all the bindings of a prepared statement (can be associated with #reset() above).
|
||||||
@ -274,7 +271,8 @@ bool Statement::executeStep()
|
|||||||
return mbOk; // true only if one row is accessible by getColumn(N)
|
return mbOk; // true only if one row is accessible by getColumn(N)
|
||||||
}
|
}
|
||||||
|
|
||||||
int Statement::tryExecuteStep() noexcept {
|
int Statement::tryExecuteStep() noexcept
|
||||||
|
{
|
||||||
const int ret = sqlite3_step(mStmtPtr);
|
const int ret = sqlite3_step(mStmtPtr);
|
||||||
if (SQLITE_ROW == ret) // one row is ready : call getColumn(N) to access it
|
if (SQLITE_ROW == ret) // one row is ready : call getColumn(N) to access it
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user