Move #include <sqlite3.h> from Statement.h to the .cpp

This commit is contained in:
Sébastien Rombauts 2016-07-07 08:37:32 +02:00
parent 4dd7b84dc0
commit 8275c7fb29
4 changed files with 26 additions and 14 deletions

View File

@ -90,3 +90,4 @@ Version 1.4.0 - 2016 ?
Rename Backup::remainingPageCount()/totalPageCount() to Backup::getRemainingPageCount()/getTotalPageCount()
Remove Column::errmsg() method : use Database or Statement equivalents
More unit tests, with code coverage status on the GitHub page
Move #include <sqlite3.h> from headers to .cpp files only using forward declarations

View File

@ -14,7 +14,7 @@
#include <string>
// Forward declaration to avoid including the sqlite3.h header
// Forward declaration to avoid including the <sqlite3.h> header
struct sqlite3_backup;
namespace SQLite

View File

@ -10,13 +10,16 @@
*/
#pragma once
#include <sqlite3.h>
#include <string>
#include <map>
#include <stdint.h>
#include <SQLiteCpp/Exception.h>
// Forward declaration to avoid including the <sqlite3.h> header
struct sqlite3;
struct sqlite3_stmt;
namespace SQLite
{
@ -465,20 +468,11 @@ public:
return mbDone;
}
/// Return the numeric result code for the most recent failed API call (if any).
inline int getErrorCode() const noexcept // nothrow
{
return sqlite3_errcode(mStmtPtr);
}
int getErrorCode() const noexcept; // nothrow
/// Return the extended numeric result code for the most recent failed API call (if any).
inline int getExtendedErrorCode() const noexcept // nothrow
{
return sqlite3_extended_errcode(mStmtPtr);
}
int getExtendedErrorCode() const noexcept; // nothrow
/// Return UTF-8 encoded English language explanation of the most recent failed API call (if any).
inline const char* errmsg() const noexcept // nothrow
{
return sqlite3_errmsg(mStmtPtr);
}
const char* errmsg() const noexcept; // nothrow
private:
/**

View File

@ -15,6 +15,7 @@
#include <SQLiteCpp/Assertion.h>
#include <SQLiteCpp/Exception.h>
#include <sqlite3.h>
namespace SQLite
{
@ -358,6 +359,22 @@ const char* Statement::getColumnOriginName(const int aIndex) const
}
#endif
/// Return the numeric result code for the most recent failed API call (if any).
int Statement::getErrorCode() const noexcept // nothrow
{
return sqlite3_errcode(mStmtPtr);
}
/// Return the extended numeric result code for the most recent failed API call (if any).
int Statement::getExtendedErrorCode() const noexcept // nothrow
{
return sqlite3_extended_errcode(mStmtPtr);
}
/// Return UTF-8 encoded English language explanation of the most recent failed API call (if any).
const char* Statement::errmsg() const noexcept // nothrow
{
return sqlite3_errmsg(mStmtPtr);
}
////////////////////////////////////////////////////////////////////////////////
// Internal class : shared pointer to the sqlite3_stmt SQLite Statement Object
////////////////////////////////////////////////////////////////////////////////