SQLite fixes; minor cosmetic fixes

This commit is contained in:
Guenter Obiltschnig
2007-06-13 15:11:21 +00:00
parent 8b374cd84b
commit 0b2b989a95
73 changed files with 222 additions and 138 deletions

View File

@@ -1,7 +1,7 @@
//
// Binder.h
//
// $Id: //poco/Main/Data/SQLite/include/Poco/Data/SQLite/Binder.h#3 $
// $Id: //poco/Main/Data/SQLite/include/Poco/Data/SQLite/Binder.h#4 $
//
// Library: SQLite
// Package: SQLite
@@ -63,56 +63,58 @@ public:
~Binder();
/// Destroys the Binder.
void bind(std::size_t pos, const Poco::Int8 &val);
void bind(std::size_t pos, const Poco::Int8 &val, Direction dir);
/// Binds an Int8.
void bind(std::size_t pos, const Poco::UInt8 &val);
void bind(std::size_t pos, const Poco::UInt8 &val, Direction dir);
/// Binds an UInt8.
void bind(std::size_t pos, const Poco::Int16 &val);
void bind(std::size_t pos, const Poco::Int16 &val, Direction dir);
/// Binds an Int16.
void bind(std::size_t pos, const Poco::UInt16 &val);
void bind(std::size_t pos, const Poco::UInt16 &val, Direction dir);
/// Binds an UInt16.
void bind(std::size_t pos, const Poco::Int32 &val);
void bind(std::size_t pos, const Poco::Int32 &val, Direction dir);
/// Binds an Int32.
void bind(std::size_t pos, const Poco::UInt32 &val);
void bind(std::size_t pos, const Poco::UInt32 &val, Direction dir);
/// Binds an UInt32.
void bind(std::size_t pos, const Poco::Int64 &val);
void bind(std::size_t pos, const Poco::Int64 &val, Direction dir);
/// Binds an Int64.
void bind(std::size_t pos, const Poco::UInt64 &val);
void bind(std::size_t pos, const Poco::UInt64 &val, Direction dir);
/// Binds an UInt64.
void bind(std::size_t pos, const bool &val);
void bind(std::size_t pos, const bool &val, Direction dir);
/// Binds a boolean.
void bind(std::size_t pos, const float &val);
void bind(std::size_t pos, const float &val, Direction dir);
/// Binds a float.
void bind(std::size_t pos, const double &val);
void bind(std::size_t pos, const double &val, Direction dir);
/// Binds a double.
void bind(std::size_t pos, const char &val);
void bind(std::size_t pos, const char &val, Direction dir);
/// Binds a single character.
void bind(std::size_t pos, const char* const &pVal);
void bind(std::size_t pos, const char* const &pVal, Direction dir);
/// Binds a const char ptr.
void bind(std::size_t pos, const std::string& val);
void bind(std::size_t pos, const std::string& val, Direction dir);
/// Binds a string.
void bind(std::size_t pos, const Poco::Data::BLOB& val);
void bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir);
/// Binds a BLOB.
void bind(std::size_t pos, const DateTime& val, Direction dir);
/// Binds a DateTime.
private:
void checkReturn(int rc);
/// Checks the SQLite return code and throws an appropriate exception.
private:
sqlite3_stmt* _pStmt;
};
@@ -120,73 +122,73 @@ private:
//
// inlines
//
inline void Binder::bind(std::size_t pos, const Poco::Int8 &val)
inline void Binder::bind(std::size_t pos, const Poco::Int8 &val, Direction dir)
{
Poco::Int32 tmp = val;
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const Poco::UInt8 &val)
inline void Binder::bind(std::size_t pos, const Poco::UInt8 &val, Direction dir)
{
Poco::Int32 tmp = val;
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const Poco::Int16 &val)
inline void Binder::bind(std::size_t pos, const Poco::Int16 &val, Direction dir)
{
Poco::Int32 tmp = val;
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const Poco::UInt16 &val)
inline void Binder::bind(std::size_t pos, const Poco::UInt16 &val, Direction dir)
{
Poco::Int32 tmp = val;
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const Poco::UInt32 &val)
inline void Binder::bind(std::size_t pos, const Poco::UInt32 &val, Direction dir)
{
Poco::Int32 tmp = static_cast<Poco::Int32>(val);
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const Poco::UInt64 &val)
inline void Binder::bind(std::size_t pos, const Poco::UInt64 &val, Direction dir)
{
Poco::Int64 tmp = static_cast<Poco::Int64>(val);
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const bool &val)
inline void Binder::bind(std::size_t pos, const bool &val, Direction dir)
{
Poco::Int32 tmp = (val ? 1 : 0);
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const float &val)
inline void Binder::bind(std::size_t pos, const float &val, Direction dir)
{
double tmp = val;
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const char &val)
inline void Binder::bind(std::size_t pos, const char &val, Direction dir)
{
Poco::Int32 tmp = val;
bind(pos, tmp);
bind(pos, tmp, dir);
}
inline void Binder::bind(std::size_t pos, const char* const &pVal)
inline void Binder::bind(std::size_t pos, const char* const &pVal, Direction dir)
{
std::string val(pVal);
bind(pos, val);
bind(pos, val, dir);
}

View File

@@ -1,7 +1,7 @@
//
// Extractor.h
//
// $Id: //poco/Main/Data/SQLite/include/Poco/Data/SQLite/Extractor.h#3 $
// $Id: //poco/Main/Data/SQLite/include/Poco/Data/SQLite/Extractor.h#4 $
//
// Library: SQLite
// Package: SQLite
@@ -106,6 +106,9 @@ public:
bool extract(std::size_t pos, Poco::Data::BLOB& val);
/// Extracts a BLOB.
bool extract(std::size_t pos, Poco::DateTime& val);
/// Extracts a DateTime.
bool extract(std::size_t pos, Poco::Any& val);
/// Extracts an Any.

View File

@@ -1,7 +1,7 @@
//
// SQLiteStatementImpl.h
//
// $Id: //poco/Main/Data/SQLite/include/Poco/Data/SQLite/SQLiteStatementImpl.h#3 $
// $Id: //poco/Main/Data/SQLite/include/Poco/Data/SQLite/SQLiteStatementImpl.h#4 $
//
// Library: SQLite
// Package: SQLite
@@ -61,7 +61,7 @@ class SQLite_API SQLiteStatementImpl: public Poco::Data::StatementImpl
/// Implements statement functionality needed for SQLite
{
public:
SQLiteStatementImpl(sqlite3* pDB);
SQLiteStatementImpl(Poco::Data::SessionImpl& rSession, sqlite3* pDB);
/// Creates the SQLiteStatementImpl.
~SQLiteStatementImpl();