From 1f55ddbbdb45044c0de9500ee3f2e59fbebffe2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Sun, 7 Apr 2013 18:16:31 +0200 Subject: [PATCH] Cleaning of include dependencies --- src/Database.cpp | 3 ++ src/Database.h | 4 ++- src/Exception.h | 1 + src/SQLiteC++.h | 85 ++++++++++++++++++++++----------------------- src/Statement.h | 5 ++- src/Transaction.cpp | 2 ++ src/Transaction.h | 3 +- 7 files changed, 55 insertions(+), 48 deletions(-) diff --git a/src/Database.cpp b/src/Database.cpp index b77a617..eccb9ec 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -12,9 +12,11 @@ #include "Statement.h" + namespace SQLite { + // Open the provided database UTF-8 filename with SQLITE_OPEN_xxx provided flags. Database::Database(const char* apFilename, const int aFlags /*= SQLITE_OPEN_READONLY*/) : // throw(SQLite::Exception) mpSQLite(NULL), @@ -80,4 +82,5 @@ void Database::check(const int aRet) const // throw(SQLite::Exception) } } + } // namespace SQLite diff --git a/src/Database.h b/src/Database.h index 9ecde61..293a9eb 100644 --- a/src/Database.h +++ b/src/Database.h @@ -11,12 +11,14 @@ #pragma once #include -#include "Exception.h" + #include "Column.h" + namespace SQLite { + /** * @brief RAII management of a SQLite Database Connection. * diff --git a/src/Exception.h b/src/Exception.h index 4f5c3d5..af866bb 100644 --- a/src/Exception.h +++ b/src/Exception.h @@ -33,6 +33,7 @@ namespace SQLite { + /** * @brief Encapsulation of the error message from SQLite3, based on std::runtime_error. */ diff --git a/src/SQLiteC++.h b/src/SQLiteC++.h index 19f1db1..5630f37 100644 --- a/src/SQLiteC++.h +++ b/src/SQLiteC++.h @@ -1,44 +1,41 @@ -/** - * @file SQLiteC++.h - * @ingroup SQLiteCpp - * @brief SQLiteC++ is a smart and simple C++ SQLite3 wrapper. This file is only "easy include" for other files. - * - * Include this main header file in your project to gain access to all functionality provided by the wrapper. - * - * Copyright (c) 2012-2013 Sebastien Rombauts (sebastien.rombauts@gmail.com) - * - * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt - * or copy at http://opensource.org/licenses/MIT) - */ -/** - * @defgroup SQLiteCpp SQLiteC++ - * @brief SQLiteC++ is a smart and simple C++ SQLite3 wrapper. This file is only "easy include" for other files. - */ -#pragma once - - -// SQLiteC++.h requires sqlite3, and the corresponding library header -#include - -// Include useful headers of SQLiteC++ -#include "Exception.h" -#include "Database.h" -#include "Statement.h" -#include "Column.h" -#include "Transaction.h" - - -/** - * @brief Version numbers for SQLiteC++ are provided in the same way as sqlite3.h - * - * The [SQLITECPP_VERSION] C preprocessor macro in the SQLiteC++.h header - * evaluates to a string literal that is the SQLite version in the - * format "X.Y.Z" where X is the major version number - * and Y is the minor version number and Z is the release number. - * - * The [SQLITECPP_VERSION_NUMBER] C preprocessor macro resolves to an integer - * with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same - * numbers used in [SQLITECPP_VERSION]. - */ -#define SQLITECPP_VERSION "0.5.0" -#define SQLITECPP_VERSION_NUMBER 0005000 +/** + * @file SQLiteC++.h + * @ingroup SQLiteCpp + * @brief SQLiteC++ is a smart and simple C++ SQLite3 wrapper. This file is only "easy include" for other files. + * + * Include this main header file in your project to gain access to all functionality provided by the wrapper. + * + * Copyright (c) 2012-2013 Sebastien Rombauts (sebastien.rombauts@gmail.com) + * + * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt + * or copy at http://opensource.org/licenses/MIT) + */ +/** + * @defgroup SQLiteCpp SQLiteC++ + * @brief SQLiteC++ is a smart and simple C++ SQLite3 wrapper. This file is only "easy include" for other files. + */ +#pragma once + + +// Include useful headers of SQLiteC++ +#include "Exception.h" +#include "Database.h" +#include "Statement.h" +#include "Column.h" +#include "Transaction.h" + + +/** + * @brief Version numbers for SQLiteC++ are provided in the same way as sqlite3.h + * + * The [SQLITECPP_VERSION] C preprocessor macro in the SQLiteC++.h header + * evaluates to a string literal that is the SQLite version in the + * format "X.Y.Z" where X is the major version number + * and Y is the minor version number and Z is the release number. + * + * The [SQLITECPP_VERSION_NUMBER] C preprocessor macro resolves to an integer + * with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same + * numbers used in [SQLITECPP_VERSION]. + */ +#define SQLITECPP_VERSION "0.5.0" +#define SQLITECPP_VERSION_NUMBER 0005000 diff --git a/src/Statement.h b/src/Statement.h index 642a9d4..d4a0ded 100644 --- a/src/Statement.h +++ b/src/Statement.h @@ -11,11 +11,13 @@ #pragma once #include -#include "Exception.h" +#include + namespace SQLite { + // Forward declaration class Database; class Column; @@ -310,4 +312,5 @@ private: bool mbDone; //!< true when the last executeStep() had no more row to fetch }; + } // namespace SQLite diff --git a/src/Transaction.cpp b/src/Transaction.cpp index 0f6f01c..c3c3358 100644 --- a/src/Transaction.cpp +++ b/src/Transaction.cpp @@ -12,9 +12,11 @@ #include "Database.h" + namespace SQLite { + // Begins the SQLite transaction Transaction::Transaction(Database& aDatabase) : // throw(SQLite::Exception) mDatabase(aDatabase), diff --git a/src/Transaction.h b/src/Transaction.h index b364e5f..85390d7 100644 --- a/src/Transaction.h +++ b/src/Transaction.h @@ -10,12 +10,11 @@ */ #pragma once -#include -#include "Exception.h" namespace SQLite { + // Forward declaration class Database;