Skip to content

Commit

Permalink
Minor code formating changes & comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SRombauts committed May 24, 2023
1 parent 4bb70c1 commit cf3b750
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 260 deletions.
460 changes: 230 additions & 230 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
9 changes: 5 additions & 4 deletions include/SQLiteCpp/Assertion.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <cassert>


/**
* SQLITECPP_ASSERT SQLITECPP_ASSERT() is used in destructors, where exceptions shall not be thrown
*
Expand All @@ -25,16 +24,18 @@
// 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__
#endif
// 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
Expand Down
2 changes: 1 addition & 1 deletion include/SQLiteCpp/Backup.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class SQLITECPP_API Backup
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
4 changes: 2 additions & 2 deletions include/SQLiteCpp/Column.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ class SQLITECPP_API Column
}

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
};

/**
Expand Down
9 changes: 4 additions & 5 deletions include/SQLiteCpp/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -617,9 +617,8 @@ class SQLITECPP_API Database

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
2 changes: 0 additions & 2 deletions include/SQLiteCpp/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ struct sqlite3;
namespace SQLite
{


/**
* @brief Encapsulation of the error message from SQLite3, based on std::runtime_error.
*/
Expand Down Expand Up @@ -89,5 +88,4 @@ class SQLITECPP_API Exception : public std::runtime_error
int mExtendedErrcode; ///< Detailed error code if any
};


} // namespace SQLite
1 change: 1 addition & 0 deletions include/SQLiteCpp/ExecuteMany.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

namespace SQLite
{

/// @endcond

/**
Expand Down
3 changes: 0 additions & 3 deletions include/SQLiteCpp/Statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
struct sqlite3;
struct sqlite3_stmt;


namespace SQLite
{


// Forward declaration
class Database;
class Column;
Expand Down Expand Up @@ -710,5 +708,4 @@ class SQLITECPP_API Statement
mutable std::map<std::string, int> mColumnNames;
};


} // namespace SQLite
5 changes: 1 addition & 4 deletions include/SQLiteCpp/Transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
#include <SQLiteCpp/SQLiteCppExport.h>
#include <SQLiteCpp/Exception.h>


namespace SQLite
{


// Forward declaration
class Database;

Expand All @@ -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.
Expand Down Expand Up @@ -97,5 +95,4 @@ class SQLITECPP_API Transaction
bool mbCommited = false; ///< True when commit has been called
};


} // namespace SQLite
1 change: 0 additions & 1 deletion src/Backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,4 @@ void SQLite::Backup::Deleter::operator()(sqlite3_backup* apBackup)
}
}


} // namespace SQLite
2 changes: 0 additions & 2 deletions src/Column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include <iostream>


namespace SQLite
{

Expand Down Expand Up @@ -121,5 +120,4 @@ std::ostream& operator<<(std::ostream& aStream, const Column& aColumn)
return aStream;
}


} // namespace SQLite
2 changes: 0 additions & 2 deletions src/Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <sqlite3.h>


namespace SQLite
{

Expand Down Expand Up @@ -43,5 +42,4 @@ const char* Exception::getErrorStr() const noexcept
return sqlite3_errstr(mErrcode);
}


} // namespace SQLite
1 change: 0 additions & 1 deletion src/Transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace SQLite
{


// Begins the SQLite transaction
Transaction::Transaction(Database& aDatabase, TransactionBehavior behavior) :
mDatabase(aDatabase)
Expand Down

0 comments on commit cf3b750

Please sign in to comment.