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

This commit is contained in:
Sébastien Rombauts 2016-07-06 09:05:23 +02:00
parent b033abb3fd
commit 300f278281
2 changed files with 10 additions and 6 deletions

View File

@ -10,8 +10,6 @@
*/ */
#pragma once #pragma once
#include <sqlite3.h>
#include <SQLiteCpp/Statement.h> #include <SQLiteCpp/Statement.h>
#include <SQLiteCpp/Exception.h> #include <SQLiteCpp/Exception.h>
@ -236,10 +234,8 @@ public:
#endif #endif
/// Return UTF-8 encoded English language explanation of the most recent error. /// Return UTF-8 encoded English language explanation of the most recent error.
inline const char* errmsg() const const char* errmsg() const;
{
return sqlite3_errmsg(mStmtPtr);
}
private: private:
Statement::Ptr mStmtPtr; //!< Shared Pointer to the prepared SQLite Statement Object Statement::Ptr mStmtPtr; //!< Shared Pointer to the prepared SQLite Statement Object
int mIndex; //!< Index of the column in the row of result, starting at 0 int mIndex; //!< Index of the column in the row of result, starting at 0

View File

@ -10,6 +10,8 @@
*/ */
#include <SQLiteCpp/Column.h> #include <SQLiteCpp/Column.h>
#include <sqlite3.h>
#include <iostream> #include <iostream>
@ -104,6 +106,12 @@ int Column::getBytes() const noexcept // nothrow
return sqlite3_column_bytes(mStmtPtr, mIndex); return sqlite3_column_bytes(mStmtPtr, mIndex);
} }
// Return UTF-8 encoded English language explanation of the most recent error.
const char* Column::errmsg() const
{
return sqlite3_errmsg(mStmtPtr);
}
// Standard std::ostream inserter // Standard std::ostream inserter
std::ostream& operator<<(std::ostream& aStream, const Column& aColumn) std::ostream& operator<<(std::ostream& aStream, const Column& aColumn)
{ {