diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3e713b4..c11db12 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 from headers to .cpp files only using forward declarations diff --git a/include/SQLiteCpp/Backup.h b/include/SQLiteCpp/Backup.h index b3a378e..bd9a143 100644 --- a/include/SQLiteCpp/Backup.h +++ b/include/SQLiteCpp/Backup.h @@ -14,7 +14,7 @@ #include -// Forward declaration to avoid including the sqlite3.h header +// Forward declaration to avoid including the header struct sqlite3_backup; namespace SQLite diff --git a/include/SQLiteCpp/Statement.h b/include/SQLiteCpp/Statement.h index 4757b46..e4dad53 100644 --- a/include/SQLiteCpp/Statement.h +++ b/include/SQLiteCpp/Statement.h @@ -10,13 +10,16 @@ */ #pragma once -#include #include #include #include #include +// Forward declaration to avoid including the 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: /** diff --git a/src/Statement.cpp b/src/Statement.cpp index e141f17..9c7441e 100644 --- a/src/Statement.cpp +++ b/src/Statement.cpp @@ -15,6 +15,7 @@ #include #include +#include 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 ////////////////////////////////////////////////////////////////////////////////