mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-07 11:16:11 -04:00
Minor code formating changes & comments
This commit is contained in:
parent
4bb70c19b8
commit
cf3b75063b
@ -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
build.sh
2
build.sh
@ -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')
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
namespace SQLite
|
||||
{
|
||||
|
||||
/// @endcond
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -80,5 +80,4 @@ void SQLite::Backup::Deleter::operator()(sqlite3_backup* apBackup)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace SQLite
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -18,7 +18,6 @@
|
||||
namespace SQLite
|
||||
{
|
||||
|
||||
|
||||
// Begins the SQLite transaction
|
||||
Transaction::Transaction(Database& aDatabase, TransactionBehavior behavior) :
|
||||
mDatabase(aDatabase)
|
||||
|
Loading…
x
Reference in New Issue
Block a user