diff options
author | randomdan <randomdan@localhost> | 2014-03-03 20:57:27 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2014-03-03 20:57:27 +0000 |
commit | e267def4f9f2e47402d72b56a45924f0bd2c0a18 (patch) | |
tree | 3384c10e1dbd84247c6d9429ffe3fab4ae398a48 /libodbcpp/column.h | |
parent | Fix slice scanner and split .ice files back into logical blocks (diff) | |
download | libdbpp-odbc-e267def4f9f2e47402d72b56a45924f0bd2c0a18.tar.bz2 libdbpp-odbc-e267def4f9f2e47402d72b56a45924f0bd2c0a18.tar.xz libdbpp-odbc-e267def4f9f2e47402d72b56a45924f0bd2c0a18.zip |
Adds native support for time_duration as a variable type
Pass/retrieve boost::posix_time ptime and time_duration into/out of the db tier
Diffstat (limited to 'libodbcpp/column.h')
-rw-r--r-- | libodbcpp/column.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libodbcpp/column.h b/libodbcpp/column.h index e981a14..f973577 100644 --- a/libodbcpp/column.h +++ b/libodbcpp/column.h @@ -101,6 +101,18 @@ namespace ODBC { virtual const Param * meAsAParam() const { return this; } virtual void apply(DB::HandleField &) const; }; + class IntervalColumn : public Column, public IntervalParam { + public: + IntervalColumn(SelectCommand * sc, const Glib::ustring & n, unsigned int i) : + DB::Column(n, i), + Column(sc, n, i) { } + virtual SQLSMALLINT ctype() const { return IntervalParam::ctype(); } + virtual SQLULEN size() const { return IntervalParam::size(); } + virtual void * rwDataAddress() { return &data; } + virtual operator boost::posix_time::time_duration () const; + virtual const Param * meAsAParam() const { return this; } + virtual void apply(DB::HandleField &) const; + }; class TimeStampColumn : public Column, public TimeStampParam { public: TimeStampColumn(SelectCommand * sc, const Glib::ustring & n, unsigned int i) : @@ -109,8 +121,7 @@ namespace ODBC { virtual SQLSMALLINT ctype() const { return TimeStampParam::ctype(); } virtual SQLULEN size() const { return TimeStampParam::size(); } virtual void * rwDataAddress() { return &data; } - virtual operator struct tm () const; - virtual operator SQL_TIMESTAMP_STRUCT () const { return data; } + virtual operator boost::posix_time::ptime () const; virtual const Param * meAsAParam() const { return this; } virtual void apply(DB::HandleField &) const; }; |