From 7297648c278903589beebf6fbc7511e5c1ff421d Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 16 Sep 2010 00:01:56 +0000 Subject: Rewrite the whole of parameter and column binding almost from scratch No more template rubbish, no more messy partial specialisation Add copyless rebind of column to parameter Changes in project2 to suit --- libodbcpp/bind.h | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'libodbcpp/bind.h') diff --git a/libodbcpp/bind.h b/libodbcpp/bind.h index fd69900..cd45cf6 100644 --- a/libodbcpp/bind.h +++ b/libodbcpp/bind.h @@ -5,25 +5,20 @@ #include namespace ODBC { - class Command; - class BindBase { - public: - BindBase(); - virtual ~BindBase() {} - protected: - SQLLEN bindLen; // Used memory - friend class Param; - friend class Column; - friend class Command; - }; - template class Bind { public: - virtual ~Bind() {} - mutable t value; + Bind(); + virtual ~Bind() = 0; + + virtual SQLSMALLINT ctype() const = 0; // The C type ID + virtual SQLINTEGER size() const = 0; // The size of the data + protected: + mutable SQLLEN bindLen; // How much data the driver wants to store }; - typedef std::vector SQLCHARVEC; } +void operator << (SQL_TIMESTAMP_STRUCT & target, const struct tm &); +void operator << (struct tm &, const SQL_TIMESTAMP_STRUCT & target); + #endif -- cgit v1.2.3