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.
|
||||
~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();
|
||||
|
||||
/// Reset the statement to make it ready for a new execution. Returns the sqlite result code
|
||||
/// instead of throwing an exception on error.
|
||||
|
||||
/// Reset the statement. Returns the sqlite result code instead of throwing an exception on error.
|
||||
int tryReset() noexcept;
|
||||
|
||||
/**
|
||||
@ -350,7 +349,7 @@ public:
|
||||
* @throw SQLite::Exception in case of error
|
||||
*/
|
||||
bool executeStep();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Try to execute a step of the prepared query to fetch one row of results, returning the sqlite result code.
|
||||
*
|
||||
|
@ -52,9 +52,7 @@ Statement::~Statement()
|
||||
// Reset the statement to make it ready for a new execution (see also #clearBindings() bellow)
|
||||
void Statement::reset()
|
||||
{
|
||||
mbOk = false;
|
||||
mbDone = false;
|
||||
const int ret = sqlite3_reset(mStmtPtr);
|
||||
const int ret = tryReset();
|
||||
check(ret);
|
||||
}
|
||||
|
||||
@ -62,8 +60,7 @@ int Statement::tryReset() noexcept
|
||||
{
|
||||
mbOk = false;
|
||||
mbDone = false;
|
||||
const int ret = sqlite3_reset(mStmtPtr);
|
||||
return ret;
|
||||
return sqlite3_reset(mStmtPtr);
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
int Statement::tryExecuteStep() noexcept {
|
||||
int Statement::tryExecuteStep() noexcept
|
||||
{
|
||||
const int ret = sqlite3_step(mStmtPtr);
|
||||
if (SQLITE_ROW == ret) // one row is ready : call getColumn(N) to access it
|
||||
{
|
||||
@ -290,7 +288,7 @@ int Statement::tryExecuteStep() noexcept {
|
||||
mbOk = false;
|
||||
mbDone = false;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user