From f036fb38fb75c1298f6729ffc2f7d411b5478854 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 21 Sep 2021 17:59:41 +0100 Subject: First commit passing IWYU --- libsqlitepp/sqlite-command.cpp | 11 +++++++++-- libsqlitepp/sqlite-command.h | 9 +++++++++ libsqlitepp/sqlite-connection.cpp | 3 +++ libsqlitepp/sqlite-connection.h | 3 +++ libsqlitepp/sqlite-error.cpp | 2 +- libsqlitepp/sqlite-error.h | 4 ++-- libsqlitepp/sqlite-mock.cpp | 5 ++++- libsqlitepp/sqlite-mock.h | 3 +++ libsqlitepp/sqlite-modifycommand.cpp | 5 ++++- libsqlitepp/sqlite-modifycommand.h | 1 + libsqlitepp/sqlite-selectcommand.cpp | 10 ++++++++-- libsqlitepp/sqlite-selectcommand.h | 2 +- libsqlitepp/unittests/testsqlite.cpp | 7 +++++-- 13 files changed, 53 insertions(+), 12 deletions(-) (limited to 'libsqlitepp') diff --git a/libsqlitepp/sqlite-command.cpp b/libsqlitepp/sqlite-command.cpp index 694c5d2..662e053 100644 --- a/libsqlitepp/sqlite-command.cpp +++ b/libsqlitepp/sqlite-command.cpp @@ -1,7 +1,14 @@ #include "sqlite-command.h" +#include "command.h" #include "sqlite-connection.h" -#include -#include +#include "sqlite-error.h" + +namespace Glib { + class ustring; +} +namespace boost::posix_time { + class time_duration; +} SQLite::Command::Command(const Connection * conn, const std::string & sql) : DB::Command(sql), c(conn), stmt(nullptr) { diff --git a/libsqlitepp/sqlite-command.h b/libsqlitepp/sqlite-command.h index 1bf93c4..cf36ec3 100644 --- a/libsqlitepp/sqlite-command.h +++ b/libsqlitepp/sqlite-command.h @@ -1,8 +1,17 @@ #ifndef SQLITE_COMMAND_H #define SQLITE_COMMAND_H +#include +#include #include +#include #include +#include +#include + +namespace boost::posix_time { + class time_duration; +} namespace SQLite { class Connection; diff --git a/libsqlitepp/sqlite-connection.cpp b/libsqlitepp/sqlite-connection.cpp index e1a6de7..346c6db 100644 --- a/libsqlitepp/sqlite-connection.cpp +++ b/libsqlitepp/sqlite-connection.cpp @@ -1,7 +1,10 @@ #include "sqlite-connection.h" +#include "connection.h" #include "sqlite-error.h" #include "sqlite-modifycommand.h" #include "sqlite-selectcommand.h" +#include +#include NAMEDFACTORY("sqlite", SQLite::Connection, DB::ConnectionFactory) diff --git a/libsqlitepp/sqlite-connection.h b/libsqlitepp/sqlite-connection.h index 1be1514..efb18dd 100644 --- a/libsqlitepp/sqlite-connection.h +++ b/libsqlitepp/sqlite-connection.h @@ -1,9 +1,12 @@ #ifndef SQLITE_CONNECTION_H #define SQLITE_CONNECTION_H +#include "command_fwd.h" #include "sqlite-error.h" #include +#include #include +#include namespace SQLite { class ConnectionError : public virtual Error, public virtual DB::ConnectionError { diff --git a/libsqlitepp/sqlite-error.cpp b/libsqlitepp/sqlite-error.cpp index 0e4d084..71dda04 100644 --- a/libsqlitepp/sqlite-error.cpp +++ b/libsqlitepp/sqlite-error.cpp @@ -1,5 +1,5 @@ #include "sqlite-error.h" -#include +#include SQLite::Error::Error(sqlite3 * db) : msg(sqlite3_errmsg(db)) { } diff --git a/libsqlitepp/sqlite-error.h b/libsqlitepp/sqlite-error.h index 9735966..4b9fb59 100644 --- a/libsqlitepp/sqlite-error.h +++ b/libsqlitepp/sqlite-error.h @@ -1,10 +1,10 @@ #ifndef SQLITE_ERROR_H #define SQLITE_ERROR_H -#include +#include // IWYU pragma: keep #include #include -#include +#include namespace SQLite { class Error : public AdHoc::Exception { diff --git a/libsqlitepp/sqlite-mock.cpp b/libsqlitepp/sqlite-mock.cpp index 11f4f90..9c37012 100644 --- a/libsqlitepp/sqlite-mock.cpp +++ b/libsqlitepp/sqlite-mock.cpp @@ -1,6 +1,9 @@ #include "sqlite-mock.h" +#include "mockDatabase.h" #include "sqlite-connection.h" -#include +#include +#include +#include NAMEDFACTORY("sqlite", SQLite::Mock, DB::MockDatabaseFactory) diff --git a/libsqlitepp/sqlite-mock.h b/libsqlitepp/sqlite-mock.h index fd8a8e9..7f21788 100644 --- a/libsqlitepp/sqlite-mock.h +++ b/libsqlitepp/sqlite-mock.h @@ -1,9 +1,12 @@ #ifndef MOCKSQLITEDATASOURCE_H #define MOCKSQLITEDATASOURCE_H +#include "connection_fwd.h" #include #include #include +#include +#include #include namespace SQLite { diff --git a/libsqlitepp/sqlite-modifycommand.cpp b/libsqlitepp/sqlite-modifycommand.cpp index d69516d..ee7a665 100644 --- a/libsqlitepp/sqlite-modifycommand.cpp +++ b/libsqlitepp/sqlite-modifycommand.cpp @@ -1,7 +1,10 @@ #include "sqlite-modifycommand.h" +#include "command.h" +#include "modifycommand.h" +#include "sqlite-command.h" #include "sqlite-connection.h" #include "sqlite-error.h" -#include +#include SQLite::ModifyCommand::ModifyCommand(const Connection * conn, const std::string & sql) : DB::Command(sql), DB::ModifyCommand(sql), SQLite::Command(conn, sql) diff --git a/libsqlitepp/sqlite-modifycommand.h b/libsqlitepp/sqlite-modifycommand.h index d9f58c6..0583da1 100644 --- a/libsqlitepp/sqlite-modifycommand.h +++ b/libsqlitepp/sqlite-modifycommand.h @@ -3,6 +3,7 @@ #include "sqlite-command.h" #include +#include namespace SQLite { class Connection; diff --git a/libsqlitepp/sqlite-selectcommand.cpp b/libsqlitepp/sqlite-selectcommand.cpp index e360dcd..dcb1944 100644 --- a/libsqlitepp/sqlite-selectcommand.cpp +++ b/libsqlitepp/sqlite-selectcommand.cpp @@ -1,9 +1,15 @@ #include "sqlite-selectcommand.h" +#include "column.h" +#include "command.h" +#include "error.h" +#include "selectcommand.h" +#include "sqlite-command.h" #include "sqlite-connection.h" #include "sqlite-error.h" -#include -#include #include +#include +#include +#include namespace SQLite { class Column : public DB::Column { diff --git a/libsqlitepp/sqlite-selectcommand.h b/libsqlitepp/sqlite-selectcommand.h index 30e0118..679e528 100644 --- a/libsqlitepp/sqlite-selectcommand.h +++ b/libsqlitepp/sqlite-selectcommand.h @@ -3,10 +3,10 @@ #include "sqlite-command.h" #include +#include namespace SQLite { class Connection; - class ColumnBase; class SelectCommand : public DB::SelectCommand, public Command { public: SelectCommand(const Connection *, const std::string & sql); diff --git a/libsqlitepp/unittests/testsqlite.cpp b/libsqlitepp/unittests/testsqlite.cpp index 5a14bfb..7d7041f 100644 --- a/libsqlitepp/unittests/testsqlite.cpp +++ b/libsqlitepp/unittests/testsqlite.cpp @@ -1,12 +1,15 @@ #define BOOST_TEST_MODULE TestSQLite #include -#include -#include +#include "mockDatabase.h" +#include #include +#include +#include #include #include #include +#include #include class StandardMockDatabase : public DB::PluginMock { -- cgit v1.2.3