Minor code formating changes & comments

This commit is contained in:
Sébastien Rombauts 2023-05-24 18:31:05 +02:00
parent 4bb70c19b8
commit cf3b75063b
15 changed files with 247 additions and 260 deletions

View File

@ -18,9 +18,9 @@ cmake --build .
ctest --output-on-failure
@if ERRORLEVEL 1 goto onError
goto onSuccess
@goto onSuccess
:onError
@echo An error occured!
:onSuccess
cd ..
@cd ..

View File

@ -10,7 +10,7 @@ set -e
mkdir -p build
cd build
# Generate a Makefile for GCC (or Clang, depanding on CC/CXX envvar)
# Generate a Makefile for GCC (or Clang, depending on CC/CXX envvar)
cmake -DCMAKE_BUILD_TYPE=Debug -DSQLITECPP_USE_ASAN=ON -DSQLITECPP_USE_GCOV=OFF -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON ..
# Build (ie 'make')

View File

@ -12,7 +12,6 @@
#include <cassert>
/**
* SQLITECPP_ASSERT SQLITECPP_ASSERT() is used in destructors, where exceptions shall not be thrown
*
@ -25,9 +24,10 @@
// if an assert handler is provided by user code, use it instead of assert()
namespace SQLite
{
// declaration of the assert handler to define in user code
void assertion_failed(const char* apFile, const int apLine, const char* apFunc,
const char* apExpr, const char* apMsg);
// declaration of the assert handler to define in user code
void assertion_failed(const char* apFile, const int apLine, const char* apFunc,
const char* apExpr, const char* apMsg);
#ifdef _MSC_VER
#define __func__ __FUNCTION__
@ -35,6 +35,7 @@ namespace SQLite
// call the assert handler provided by user code
#define SQLITECPP_ASSERT(expression, message) \
if (!(expression)) SQLite::assertion_failed(__FILE__, __LINE__, __func__, #expression, message)
} // namespace SQLite
#else

View File

@ -125,7 +125,7 @@ private:
void operator()(sqlite3_backup* apBackup);
};
std::unique_ptr<sqlite3_backup, Deleter> mpSQLiteBackup{}; ///< Pointer to SQLite Database Backup Handle
std::unique_ptr<sqlite3_backup, Deleter> mpSQLiteBackup; ///< Pointer to SQLite Database Backup Handle
};
} // namespace SQLite

View File

@ -228,8 +228,8 @@ public:
}
private:
Statement::TStatementPtr mStmtPtr; ///< Shared Pointer to the prepared SQLite Statement Object
int mIndex; ///< Index of the column in the row of result, starting at 0
Statement::TStatementPtr mStmtPtr; ///< Shared Pointer to the prepared SQLite Statement Object
int mIndex; ///< Index of the column in the row of result, starting at 0
};
/**

View File

@ -109,8 +109,8 @@ SQLITECPP_API extern const int OPEN_NOFOLLOW; // SQLITE_OPEN_NOFOLLOW
SQLITECPP_API extern const int OK; ///< SQLITE_OK (used by check() bellow)
SQLITECPP_API extern const char* const VERSION; ///< SQLITE_VERSION string from the sqlite3.h used at compile time
SQLITECPP_API extern const int VERSION_NUMBER; ///< SQLITE_VERSION_NUMBER from the sqlite3.h used at compile time
SQLITECPP_API extern const char* const VERSION; ///< SQLITE_VERSION string from sqlite3.h used at compile time
SQLITECPP_API extern const int VERSION_NUMBER; ///< SQLITE_VERSION_NUMBER from sqlite3.h used at compile time
/// Return SQLite version string using runtime call to the compiled library
SQLITECPP_API const char* getLibVersion() noexcept;
@ -617,9 +617,8 @@ public:
private:
// TODO: perhaps switch to having Statement sharing a pointer to the Connexion
std::unique_ptr<sqlite3, Deleter> mSQLitePtr; ///< Pointer to SQLite Database Connection Handle
std::string mFilename; ///< UTF-8 filename used to open the database
std::unique_ptr<sqlite3, Deleter> mSQLitePtr; ///< Pointer to SQLite Database Connection Handle
std::string mFilename; ///< UTF-8 filename used to open the database
};
} // namespace SQLite

View File

@ -20,7 +20,6 @@ struct sqlite3;
namespace SQLite
{
/**
* @brief Encapsulation of the error message from SQLite3, based on std::runtime_error.
*/
@ -89,5 +88,4 @@ private:
int mExtendedErrcode; ///< Detailed error code if any
};
} // namespace SQLite

View File

@ -23,6 +23,7 @@
namespace SQLite
{
/// @endcond
/**

View File

@ -22,11 +22,9 @@
struct sqlite3;
struct sqlite3_stmt;
namespace SQLite
{
// Forward declaration
class Database;
class Column;
@ -710,5 +708,4 @@ private:
mutable std::map<std::string, int> mColumnNames;
};
} // namespace SQLite

View File

@ -13,11 +13,9 @@
#include <SQLiteCpp/SQLiteCppExport.h>
#include <SQLiteCpp/Exception.h>
namespace SQLite
{
// Forward declaration
class Database;
@ -39,7 +37,7 @@ enum class TransactionBehavior {
* or if it fails, all the changes are rolled back to the initial state.
*
* Resource Acquisition Is Initialization (RAII) means that the Transaction
* begins in the constructor and is rolled back in the destructor (unless comitted before), so that there is
* begins in the constructor and is rolled back in the destructor (unless committed before), so that there is
* no need to worry about memory management or the validity of the underlying SQLite Connection.
*
* This method also offers big performances improvements compared to individually executed statements.
@ -97,5 +95,4 @@ private:
bool mbCommited = false; ///< True when commit has been called
};
} // namespace SQLite

View File

@ -80,5 +80,4 @@ void SQLite::Backup::Deleter::operator()(sqlite3_backup* apBackup)
}
}
} // namespace SQLite

View File

@ -14,7 +14,6 @@
#include <iostream>
namespace SQLite
{
@ -121,5 +120,4 @@ std::ostream& operator<<(std::ostream& aStream, const Column& aColumn)
return aStream;
}
} // namespace SQLite

View File

@ -12,7 +12,6 @@
#include <sqlite3.h>
namespace SQLite
{
@ -43,5 +42,4 @@ const char* Exception::getErrorStr() const noexcept
return sqlite3_errstr(mErrcode);
}
} // namespace SQLite

View File

@ -18,7 +18,6 @@
namespace SQLite
{
// Begins the SQLite transaction
Transaction::Transaction(Database& aDatabase, TransactionBehavior behavior) :
mDatabase(aDatabase)