Skip to content

Commit a32e884

Browse files
authored
Merge pull request #377 Some documentation fixes from cbielow/fix_doc
2 parents e744032 + d416b40 commit a32e884

File tree

9 files changed

+443
-217
lines changed

9 files changed

+443
-217
lines changed

Doxyfile

Lines changed: 413 additions & 192 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,17 @@ cmake --build .
193193
ctest --output-on-failure
194194
```
195195

196+
#### Building the Doxygen/html documentation
197+
198+
Make sure you have Dogygen installed and configure CMake using the `SQLITECPP_RUN_DOXYGEN=ON` flag:
199+
200+
```
201+
cmake -DSQLITECPP_RUN_DOXYGEN=ON <MORE ARGUMENTS_HERE>
202+
```
203+
204+
and then execute the `SQLiteCpp_doxygen` target (or build all targets, see above).
205+
The documentation will be generated in the 'doc' subfolder of the source tree.
206+
196207
#### CMake options
197208

198209
* For more options on customizing the build, see the [CMakeLists.txt](https://github.com/SRombauts/SQLiteCpp/blob/master/CMakeLists.txt) file.

include/SQLiteCpp/Column.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern const int Null; ///< SQLITE_NULL
3131
/**
3232
* @brief Encapsulation of a Column in a row of the result pointed by the prepared Statement.
3333
*
34-
* A Column is a particular field of SQLite data in the current row of result
34+
* A Column is a particular field of SQLite data in the current row of result
3535
* of the Statement : it points to a single cell.
3636
*
3737
* Its value can be expressed as a text, and, when applicable, as a numeric
@@ -103,9 +103,12 @@ class Column
103103
std::string getString() const;
104104

105105
/**
106-
* @brief Return the type of the value of the column
106+
* @brief Return the type of the value of the column using sqlite3_column_type()
107107
*
108108
* Return either SQLite::INTEGER, SQLite::FLOAT, SQLite::TEXT, SQLite::BLOB, or SQLite::Null.
109+
* This type may change from one row to the next, since
110+
* SQLite stores data types dynamically for each value and not per column.
111+
* Use Statement::getColumnDeclaredType() to retrieve the declared column type from a SELECT statement.
109112
*
110113
* @warning After a type conversion (by a call to a getXxx on a Column of a Yyy type),
111114
* the value returned by sqlite3_column_type() is undefined.

include/SQLiteCpp/Database.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ class Database
256256
* @brief Set a busy handler that sleeps for a specified amount of time when a table is locked.
257257
*
258258
* This is useful in multithreaded program to handle case where a table is locked for writing by a thread.
259-
* Any other thread cannot access the table and will receive a SQLITE_BUSY error:
260-
* setting a timeout will wait and retry up to the time specified before returning this SQLITE_BUSY error.
259+
* Any other thread cannot access the table and will receive a SQLITE_BUSY error:
260+
* setting a timeout will wait and retry up to the time specified before returning this SQLITE_BUSY error.
261261
* Reading the value of timeout for current connection can be done with SQL query "PRAGMA busy_timeout;".
262262
* Default busy timeout is 0ms.
263263
*
@@ -322,7 +322,7 @@ class Database
322322
*
323323
* @see exec() to execute, returning number of rows modified
324324
*
325-
* @param[in] aQueries one or multiple UTF-8 encoded, semicolon-separate SQL statements
325+
* @param[in] apQueries one or multiple UTF-8 encoded, semicolon-separate SQL statements
326326
*
327327
* @return the sqlite result code.
328328
*/
@@ -424,7 +424,7 @@ class Database
424424
/**
425425
* @brief Get the rowid of the most recent successful INSERT into the database from the current connection.
426426
*
427-
* Each entry in an SQLite table always has a unique 64-bit signed integer key called the rowid.
427+
* Each entry in an SQLite table always has a unique 64-bit signed integer key called the rowid.
428428
* If the table has a column of type INTEGER PRIMARY KEY, then it is an alias for the rowid.
429429
*
430430
* @return Rowid of the most recent successful INSERT into the database, or 0 if there was none.

include/SQLiteCpp/Savepoint.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Database;
2323
* @brief RAII encapsulation of a SQLite Savepoint.
2424
*
2525
* A Savepoint is a way to group multiple SQL statements into an atomic
26-
* secureced operation; either it succeeds, with all the changes commited to the
26+
* secure operation; either it succeeds, with all the changes committed to the
2727
* database file, or if it fails, all the changes are rolled back to the initial
2828
* state at the start of the savepoint.
2929
*
@@ -39,7 +39,7 @@ class Database;
3939
* savepoint to be rolled back.
4040
*
4141
* 3) This savepoint is not saved to the database until this and all savepoints
42-
* or transaction in the savepoint stack have been released or commited.
42+
* or transaction in the savepoint stack have been released or committed.
4343
*
4444
* See also: https://sqlite.org/lang_savepoint.html
4545
*
@@ -66,7 +66,7 @@ class Savepoint {
6666
* Exception is thrown in case of error, then the Savepoint is NOT
6767
* initiated.
6868
*/
69-
Savepoint(Database& aDatabase, const std::string& name);
69+
Savepoint(Database& aDatabase, const std::string& aName);
7070

7171
// Savepoint is non-copyable
7272
Savepoint(const Savepoint&) = delete;

include/SQLiteCpp/Statement.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ class Statement
8686
/// The finalization will be done by the destructor of the last shared pointer
8787
~Statement() = default;
8888

89-
/// Reset the statement to make it ready for a new execution. Throws an exception on error.
89+
/// Reset the statement to make it ready for a new execution by calling sqlite3_reset.
90+
/// Throws an exception on error.
91+
/// Call this function before any news calls to bind() if the statement was already executed before.
92+
/// Calling reset() does not clear the bindings (see clearBindings()).
9093
void reset();
9194

9295
/// Reset the statement. Returns the sqlite result code instead of throwing an exception on error.

include/SQLiteCpp/Transaction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum class TransactionBehavior {
3838
* or if it fails, all the changes are rolled back to the initial state.
3939
*
4040
* Resource Acquisition Is Initialization (RAII) means that the Transaction
41-
* begins in the constructor and is rollbacked in the destructor, so that there is
41+
* begins in the constructor and is rolled back in the destructor (unless comitted before), so that there is
4242
* no need to worry about memory management or the validity of the underlying SQLite Connection.
4343
*
4444
* This method also offers big performances improvements compared to individually executed statements.

src/Database.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,7 @@ void Database::Deleter::operator()(sqlite3* apSQLite)
9292
SQLITECPP_ASSERT(SQLITE_OK == ret, "database is locked"); // See SQLITECPP_ENABLE_ASSERT_HANDLER
9393
}
9494

95-
/**
96-
* @brief Set a busy handler that sleeps for a specified amount of time when a table is locked.
97-
*
98-
* This is useful in multithreaded program to handle case where a table is locked for writting by a thread.
99-
* Any other thread cannot access the table and will receive a SQLITE_BUSY error:
100-
* setting a timeout will wait and retry up to the time specified before returning this SQLITE_BUSY error.
101-
* Reading the value of timeout for current connection can be done with SQL query "PRAGMA busy_timeout;".
102-
* Default busy timeout is 0ms.
103-
*
104-
* @param[in] aBusyTimeoutMs Amount of milliseconds to wait before returning SQLITE_BUSY
105-
*
106-
* @throw SQLite::Exception in case of error
107-
*/
95+
//Set a busy handler that sleeps for a specified amount of time when a table is locked.
10896
void Database::setBusyTimeout(const int aBusyTimeoutMs)
10997
{
11098
const int ret = sqlite3_busy_timeout(getHandle(), aBusyTimeoutMs);

src/Statement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Statement::Statement(Statement&& aStatement) noexcept :
4343
aStatement.mbDone = false;
4444
}
4545

46-
// Reset the statement to make it ready for a new execution (see also #clearBindings() bellow)
46+
// Reset the statement to make it ready for a new execution (see also #clearBindings() below)
4747
void Statement::reset()
4848
{
4949
const int ret = tryReset();

0 commit comments

Comments
 (0)