diff --git a/src/SQLiteC++/Database.cpp b/src/SQLiteC++/Database.cpp index 1360ac8..d4ce6b2 100644 --- a/src/SQLiteC++/Database.cpp +++ b/src/SQLiteC++/Database.cpp @@ -2,7 +2,7 @@ * @file Database.cpp * @brief Management of a SQLite Database Connection. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) @@ -31,16 +31,6 @@ Database::Database(const char* apFilename, const int aFlags /*= SQLITE_OPEN_READ // Close the SQLite database connection. Database::~Database(void) throw() // nothrow { - // check for undestroyed statements - std::vector::iterator iStatement; - for (iStatement = mStatementList.begin(); - iStatement != mStatementList.end(); - iStatement++) - { - // TODO (*iStatement)->Finalize(); ? - //std::cout << "Unregistered statement: " << (*iStatement)->getQuery().c_str() << " !\n"; - } - int ret = sqlite3_close(mpSQLite); if (SQLITE_OK != ret) { @@ -49,23 +39,6 @@ Database::~Database(void) throw() // nothrow } } -// Register a Statement object (a SQLite query) -void Database::registerStatement(Statement& aStatement) // throw(SQLite::Exception) -{ - mStatementList.push_back(&aStatement); -} - -// Unregister a Statement object -void Database::unregisterStatement(Statement& aStatement) // throw(SQLite::Exception) -{ - TStatementList::iterator iStatement; - iStatement = std::find(mStatementList.begin(), mStatementList.end(), &aStatement); - if (mStatementList.end() != iStatement) - { - mStatementList.erase(iStatement); - } -} - // Shortcut to execute one or multiple SQL statements without results. int Database::exec(const char* apQueries) // throw(SQLite::Exception); { diff --git a/src/SQLiteC++/Database.h b/src/SQLiteC++/Database.h index 2455162..8240fc9 100644 --- a/src/SQLiteC++/Database.h +++ b/src/SQLiteC++/Database.h @@ -2,7 +2,7 @@ * @file Database.h * @brief Management of a SQLite Database Connection. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) @@ -10,8 +10,6 @@ #pragma once #include -#include -#include #include "Exception.h" namespace SQLite @@ -35,9 +33,6 @@ class Database { friend class Statement; -public: - typedef std::vector TStatementList; /// List of statements pointers - public: /** * @brief Open the provided database UTF-8 filename. @@ -62,16 +57,6 @@ public: */ virtual ~Database(void) throw(); // nothrow - /** - * @brief Register a Statement object (a SQLite query) - */ - void registerStatement(Statement& aStatement); // throw(SQLite::Exception); - - /** - * @brief Unregister a Statement object - */ - void unregisterStatement(Statement& aStatement); // throw(SQLite::Exception); - /** * @brief Shortcut to execute one or multiple statements without results. * @@ -91,14 +76,6 @@ public: return mFilename; } - /** - * @brief List of registered statements - */ - inline const TStatementList& getStatementList(void) const - { - return mStatementList; - } - private: // Database must not be copyable Database(void); @@ -111,9 +88,8 @@ private: void check(const int aRet) const; // throw(SQLite::Exception); private: - sqlite3* mpSQLite; //!< Pointer to SQLite Database Connection Handle - std::string mFilename; //!< UTF-8 filename used to open the database - TStatementList mStatementList; //!< List of SQL registered statements used with this database connexion + sqlite3* mpSQLite; //!< Pointer to SQLite Database Connection Handle + std::string mFilename; //!< UTF-8 filename used to open the database }; diff --git a/src/SQLiteC++/Exception.h b/src/SQLiteC++/Exception.h index 7a2699a..91462fe 100644 --- a/src/SQLiteC++/Exception.h +++ b/src/SQLiteC++/Exception.h @@ -2,7 +2,7 @@ * @file Exception.h * @brief Encapsulation of the error message from SQLite3 on a std::runtime_error. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) diff --git a/src/SQLiteC++/SQLiteC++.h b/src/SQLiteC++/SQLiteC++.h index 8714874..49b7a3e 100644 --- a/src/SQLiteC++/SQLiteC++.h +++ b/src/SQLiteC++/SQLiteC++.h @@ -2,7 +2,7 @@ * @file SQLiteC++.h * @brief SQLiteC++ is a smart and simple C++ SQLite3 wrapper. This file is only "easy include" for other files. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) diff --git a/src/SQLiteC++/Statement.cpp b/src/SQLiteC++/Statement.cpp index 2679cc9..e28e6d0 100644 --- a/src/SQLiteC++/Statement.cpp +++ b/src/SQLiteC++/Statement.cpp @@ -2,7 +2,7 @@ * @file Statement.cpp * @brief A prepared SQLite Statement is a compiled SQL query ready to be executed. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) @@ -26,7 +26,6 @@ Statement::Statement(Database &aDatabase, const char* apQuery) : // throw(SQLite int ret = sqlite3_prepare_v2(mDatabase.mpSQLite, mQuery.c_str(), mQuery.size(), &mpStmt, NULL); check(ret); mColumnCount = sqlite3_column_count(mpStmt); - mDatabase.registerStatement(*this); } // Finalize and unregister the SQL query from the SQLite Database Connection. @@ -39,7 +38,6 @@ Statement::~Statement(void) throw() // nothrow //std::cout << sqlite3_errmsg(mDatabase.mpSQLite); } mpStmt = NULL; - mDatabase.unregisterStatement(*this); } // Reset the statement to make it ready for a new execution diff --git a/src/SQLiteC++/Statement.h b/src/SQLiteC++/Statement.h index 8099798..5c01e23 100644 --- a/src/SQLiteC++/Statement.h +++ b/src/SQLiteC++/Statement.h @@ -2,7 +2,7 @@ * @file Statement.h * @brief A prepared SQLite Statement is a compiled SQL query ready to be executed. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) diff --git a/src/SQLiteC++/Transaction.cpp b/src/SQLiteC++/Transaction.cpp index bcaff90..b996992 100644 --- a/src/SQLiteC++/Transaction.cpp +++ b/src/SQLiteC++/Transaction.cpp @@ -2,7 +2,7 @@ * @file Transaction.cpp * @brief A prepared SQLite Transaction is a compiled SQL query ready to be executed. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) diff --git a/src/SQLiteC++/Transaction.h b/src/SQLiteC++/Transaction.h index 0a13586..9f63f7d 100644 --- a/src/SQLiteC++/Transaction.h +++ b/src/SQLiteC++/Transaction.h @@ -2,7 +2,7 @@ * @file Transaction.h * @brief A Transaction is way to group multiple SQL statements into an atomic secured operation. * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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) diff --git a/src/example1/main.cpp b/src/example1/main.cpp index dda8103..60c6e01 100644 --- a/src/example1/main.cpp +++ b/src/example1/main.cpp @@ -4,7 +4,7 @@ * * Demonstrate how-to use the SQLite++ wrapper * - * Copyright (c) 2012 Sebastien Rombauts (sebastien dot rombauts at gmail dot com) + * Copyright (c) 2012 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)