Removed all meaningless (void) from method definitions

This commit is contained in:
Sébastien Rombauts 2014-03-13 21:56:28 +01:00
parent 3af95da230
commit 78ea5b254f
9 changed files with 52 additions and 52 deletions

View File

@ -42,12 +42,12 @@ class Example
{
public:
// Constructor
Example(void) :
Example() :
mDb(filename_example_db3), // Open a database file in readonly mode
mQuery(mDb, "SELECT * FROM test WHERE weight > :min_weight")// Compile a SQL query, containing one parameter (index 1)
{
}
virtual ~Example(void)
virtual ~Example()
{
}
@ -75,7 +75,7 @@ private:
};
int main (void)
int main ()
{
// Basic example (1/6) :
try

View File

@ -51,7 +51,7 @@ public:
*/
Column(Statement::Ptr& aStmtPtr, int aIndex) noexcept; // nothrow
/// @brief Simple destructor
virtual ~Column(void) noexcept; // nothrow
virtual ~Column() noexcept; // nothrow
// default copy constructor and assignment operator are perfectly suited :
// they copy the Statement::Ptr which in turn increments the reference counter.
@ -59,7 +59,7 @@ public:
/**
* @brief Return a pointer to the named assigned to a result column (potentially aliased)
*/
const char* getName(void) const noexcept; // nothrow
const char* getName() const noexcept; // nothrow
#ifdef SQLITE_ENABLE_COLUMN_METADATA
/**
@ -69,15 +69,15 @@ public:
* - when building the SQLite library itself (which is the case for the Debian libsqlite3 binary for instance),
* - and also when compiling this wrapper.
*/
const char* getOriginName(void) const noexcept; // nothrow
const char* getOriginName() const noexcept; // nothrow
#endif
/// @brief Return the integer value of the column.
int getInt(void) const noexcept; // nothrow
int getInt() const noexcept; // nothrow
/// @brief Return the 64bits integer value of the column.
sqlite3_int64 getInt64(void) const noexcept; // nothrow
sqlite3_int64 getInt64() const noexcept; // nothrow
/// @brief Return the double (64bits float) value of the column.
double getDouble(void) const noexcept; // nothrow
double getDouble() const noexcept; // nothrow
/**
* @brief Return a pointer to the text value (NULL terminated string) of the column.
*
@ -91,7 +91,7 @@ public:
* @warning The value pointed at is only valid while the statement is valid (ie. not finalized),
* thus you must copy it before using it beyond its scope (to a std::string for instance).
*/
const void* getBlob(void) const noexcept; // nothrow
const void* getBlob() const noexcept; // nothrow
/**
* @brief Return the type of the value of the column
@ -101,30 +101,30 @@ public:
* @warning After a type conversion (by a call to a getXxx on a Column of a Yyy type),
* the value returned by sqlite3_column_type() is undefined.
*/
int getType(void) const noexcept; // nothrow
int getType() const noexcept; // nothrow
/// @brief Test if the column is an integer type value (meaningful only before any conversion)
inline bool isInteger(void) const noexcept // nothrow
inline bool isInteger() const noexcept // nothrow
{
return (SQLITE_INTEGER == getType());
}
/// @brief Test if the column is a floating point type value (meaningful only before any conversion)
inline bool isFloat(void) const noexcept // nothrow
inline bool isFloat() const noexcept // nothrow
{
return (SQLITE_FLOAT == getType());
}
/// @brief Test if the column is a text type value (meaningful only before any conversion)
inline bool isText(void) const noexcept // nothrow
inline bool isText() const noexcept // nothrow
{
return (SQLITE_TEXT == getType());
}
/// @brief Test if the column is a binary blob type value (meaningful only before any conversion)
inline bool isBlob(void) const noexcept // nothrow
inline bool isBlob() const noexcept // nothrow
{
return (SQLITE_BLOB == getType());
}
/// @brief Test if the column is NULL (meaningful only before any conversion)
inline bool isNull(void) const noexcept // nothrow
inline bool isNull() const noexcept // nothrow
{
return (SQLITE_NULL == getType());
}
@ -138,10 +138,10 @@ public:
* - size in bytes of the binary blob returned by getBlob()
* - 0 for a NULL value
*/
int getBytes(void) const noexcept;
int getBytes() const noexcept;
/// @brief Alias returning the number of bytes used by the text (or blob) value of the column
inline int size(void) const noexcept
inline int size() const noexcept
{
return getBytes ();
}
@ -193,7 +193,7 @@ public:
#endif
/// @brief Return UTF-8 encoded English language explanation of the most recent error.
inline const char* errmsg(void) const
inline const char* errmsg() const
{
return sqlite3_errmsg(mStmtPtr);
}

View File

@ -87,7 +87,7 @@ public:
*
* @warning assert in case of error
*/
virtual ~Database(void) noexcept; // nothrow
virtual ~Database() noexcept; // nothrow
/**
* @brief Shortcut to execute one or multiple statements without results.
@ -224,7 +224,7 @@ public:
*
* @return Rowid of the most recent successful INSERT into the database, or 0 if there was none.
*/
inline sqlite3_int64 getLastInsertRowid(void) const noexcept // nothrow
inline sqlite3_int64 getLastInsertRowid() const noexcept // nothrow
{
return sqlite3_last_insert_rowid(mpSQLite);
}
@ -232,7 +232,7 @@ public:
/**
* @brief Return the filename used to open the database
*/
inline const std::string& getFilename(void) const noexcept // nothrow
inline const std::string& getFilename() const noexcept // nothrow
{
return mFilename;
}
@ -240,7 +240,7 @@ public:
/**
* @brief Return UTF-8 encoded English language explanation of the most recent error.
*/
inline const char* errmsg(void) const noexcept // nothrow
inline const char* errmsg() const noexcept // nothrow
{
return sqlite3_errmsg(mpSQLite);
}

View File

@ -69,12 +69,12 @@ public:
/**
* @brief Finalize and unregister the SQL query from the SQLite Database Connection.
*/
virtual ~Statement(void) noexcept; // nothrow
virtual ~Statement() noexcept; // nothrow
/**
* @brief Reset the statement to make it ready for a new execution.
*/
void reset(void);
void reset();
////////////////////////////////////////////////////////////////////////////
// Bind a value to a parameter of the SQL statement,
@ -238,7 +238,7 @@ public:
*
* @throw SQLite::Exception in case of error
*/
bool executeStep(void);
bool executeStep();
/**
* @brief Execute a one-step query with no expected result.
@ -259,7 +259,7 @@ public:
*
* @throw SQLite::Exception in case of error, or if row of results are returned !
*/
int exec(void);
int exec();
////////////////////////////////////////////////////////////////////////////
@ -302,27 +302,27 @@ public:
////////////////////////////////////////////////////////////////////////////
/// @brief Return the UTF-8 SQL Query.
inline const std::string& getQuery(void) const
inline const std::string& getQuery() const
{
return mQuery;
}
/// @brief Return the number of columns in the result set returned by the prepared statement
inline int getColumnCount(void) const
inline int getColumnCount() const
{
return mColumnCount;
}
/// @brief true when a row has been fetched with executeStep()
inline bool isOk(void) const
inline bool isOk() const
{
return mbOk;
}
/// @brief true when the last executeStep() had no more row to fetch
inline bool isDone(void) const
inline bool isDone() const
{
return mbDone;
}
/// @brief Return UTF-8 encoded English language explanation of the most recent error.
inline const char* errmsg(void) const
inline const char* errmsg() const
{
return sqlite3_errmsg(mStmtPtr);
}
@ -343,7 +343,7 @@ public:
// Copy constructor increments the ref counter
Ptr(const Ptr& aPtr);
// Decrement the ref counter and finalize the sqlite3_stmt when it reaches 0
~Ptr(void) noexcept; // nothrow (no virtual destructor needed here)
~Ptr() noexcept; // nothrow (no virtual destructor needed here)
/// @brief Inline cast operator returning the pointer to SQLite Database Connection Handle
inline operator sqlite3*() const

View File

@ -55,12 +55,12 @@ public:
/**
* @brief Safely rollback the transaction if it has not been committed.
*/
virtual ~Transaction(void) noexcept; // nothrow
virtual ~Transaction() noexcept; // nothrow
/**
* @brief Commit the transaction.
*/
void commit(void);
void commit();
private:
// Transaction must be non-copyable

View File

@ -25,39 +25,39 @@ Column::Column(Statement::Ptr& aStmtPtr, int aIndex) noexcept : // nothrow
}
// Finalize and unregister the SQL query from the SQLite Database Connection.
Column::~Column(void) noexcept // nothrow
Column::~Column() noexcept // nothrow
{
// the finalization will be done by the destructor of the last shared pointer
}
// Return the named assigned to this result column (potentially aliased)
const char * Column::getName(void) const noexcept // nothrow
const char * Column::getName() const noexcept // nothrow
{
return sqlite3_column_name(mStmtPtr, mIndex);
}
#ifdef SQLITE_ENABLE_COLUMN_METADATA
// Return the name of the table column that is the origin of this result column
const char * Column::getOriginName(void) const noexcept // nothrow
const char * Column::getOriginName() const noexcept // nothrow
{
return sqlite3_column_origin_name(mStmtPtr, mIndex);
}
#endif
// Return the integer value of the column specified by its index starting at 0
int Column::getInt(void) const noexcept // nothrow
int Column::getInt() const noexcept // nothrow
{
return sqlite3_column_int(mStmtPtr, mIndex);
}
// Return the 64bits integer value of the column specified by its index starting at 0
sqlite3_int64 Column::getInt64(void) const noexcept // nothrow
sqlite3_int64 Column::getInt64() const noexcept // nothrow
{
return sqlite3_column_int64(mStmtPtr, mIndex);
}
// Return the double value of the column specified by its index starting at 0
double Column::getDouble(void) const noexcept // nothrow
double Column::getDouble() const noexcept // nothrow
{
return sqlite3_column_double(mStmtPtr, mIndex);
}
@ -70,19 +70,19 @@ const char* Column::getText(const char* apDefaultValue /* = "" */) const noexcep
}
// Return a pointer to the text value (NULL terminated string) of the column specified by its index starting at 0
const void* Column::getBlob(void) const noexcept // nothrow
const void* Column::getBlob() const noexcept // nothrow
{
return sqlite3_column_blob(mStmtPtr, mIndex);
}
// Return the type of the value of the column
int Column::getType(void) const noexcept // nothrow
int Column::getType() const noexcept // nothrow
{
return sqlite3_column_type(mStmtPtr, mIndex);
}
// Return the number of bytes used by the text value of the column
int Column::getBytes(void) const noexcept // nothrow
int Column::getBytes() const noexcept // nothrow
{
return sqlite3_column_bytes(mStmtPtr, mIndex);
}

View File

@ -54,7 +54,7 @@ Database::Database(const std::string& aFilename, const int aFlags /*= SQLITE_OPE
}
// Close the SQLite database connection.
Database::~Database(void) noexcept // nothrow
Database::~Database() noexcept // nothrow
{
int ret = sqlite3_close(mpSQLite);
// Never throw an exception in a destructor

View File

@ -44,13 +44,13 @@ Statement::Statement(Database &aDatabase, const std::string& aQuery) :
}
// Finalize and unregister the SQL query from the SQLite Database Connection.
Statement::~Statement(void) noexcept // nothrow
Statement::~Statement() noexcept // nothrow
{
// the finalization will be done by the destructor of the last shared pointer
}
// Reset the statement to make it ready for a new execution
void Statement::reset(void)
void Statement::reset()
{
mbOk = false;
mbDone = false;
@ -166,7 +166,7 @@ void Statement::bind(const char* apName)
// Execute a step of the query to fetch one row of results
bool Statement::executeStep(void)
bool Statement::executeStep()
{
if (false == mbDone)
{
@ -196,7 +196,7 @@ bool Statement::executeStep(void)
}
// Execute a one-step query with no expected result
int Statement::exec(void)
int Statement::exec()
{
if (false == mbDone)
{
@ -317,7 +317,7 @@ Statement::Ptr::Ptr(const Statement::Ptr& aPtr) :
/**
* @brief Decrement the ref counter and finalize the sqlite3_stmt when it reaches 0
*/
Statement::Ptr::~Ptr(void) noexcept // nothrow
Statement::Ptr::~Ptr() noexcept // nothrow
{
assert(NULL != mpRefCount);
assert(0 != *mpRefCount);

View File

@ -27,7 +27,7 @@ Transaction::Transaction(Database& aDatabase) :
}
// Safely rollback the transaction if it has not been committed.
Transaction::~Transaction(void) noexcept // nothrow
Transaction::~Transaction() noexcept // nothrow
{
if (false == mbCommited)
{
@ -44,7 +44,7 @@ Transaction::~Transaction(void) noexcept // nothrow
}
// Commit the transaction.
void Transaction::commit(void)
void Transaction::commit()
{
if (false == mbCommited)
{