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 | c27104f6b93fb314bf4deab87fa97490ffac0420 (patch) | |
tree | ae4b2aa743ad14eb182776188076777dcee0c046 | |
parent | Fix slice scanner and split .ice files back into logical blocks (diff) | |
download | libdbpp-c27104f6b93fb314bf4deab87fa97490ffac0420.tar.bz2 libdbpp-c27104f6b93fb314bf4deab87fa97490ffac0420.tar.xz libdbpp-c27104f6b93fb314bf4deab87fa97490ffac0420.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
-rw-r--r-- | libdbpp/Jamfile.jam | 2 | ||||
-rw-r--r-- | libdbpp/column.h | 6 | ||||
-rw-r--r-- | libdbpp/command.h | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/libdbpp/Jamfile.jam b/libdbpp/Jamfile.jam index ba60a55..387afd6 100644 --- a/libdbpp/Jamfile.jam +++ b/libdbpp/Jamfile.jam @@ -2,6 +2,7 @@ alias glibmm : : : : <cflags>"`pkg-config --cflags glibmm-2.4`" <linkflags>"`pkg-config --libs glibmm-2.4`" ; +lib boost_date_time : : <name>boost_date_time ; lib dbpp : [ glob *.cpp ] : @@ -10,4 +11,5 @@ lib dbpp : : : <include>. <library>glibmm + <library>boost_date_time ; diff --git a/libdbpp/column.h b/libdbpp/column.h index c0b3c37..80bec8c 100644 --- a/libdbpp/column.h +++ b/libdbpp/column.h @@ -2,8 +2,7 @@ #define DB_COLUMN_H #include <glibmm/ustring.h> -#include <vector> -#include <stdlib.h> +#include <boost/date_time/posix_time/posix_time_types.hpp> namespace DB { class HandleField { @@ -12,7 +11,8 @@ namespace DB { virtual void string(const char *, size_t len) = 0; virtual void integer(int64_t) = 0; virtual void floatingpoint(double) = 0; - virtual void timestamp(const struct tm &) = 0; + virtual void interval(const boost::posix_time::time_duration &) = 0; + virtual void timestamp(const boost::posix_time::ptime &) = 0; }; class Command; class Column { diff --git a/libdbpp/command.h b/libdbpp/command.h index 40b5e2a..df621d2 100644 --- a/libdbpp/command.h +++ b/libdbpp/command.h @@ -2,6 +2,7 @@ #define DB_COMMAND_H #include <glibmm/ustring.h> +#include <boost/date_time/posix_time/posix_time_types.hpp> namespace DB { class Command { @@ -21,8 +22,8 @@ namespace DB { virtual void bindParamS(unsigned int i, const Glib::ustring &) = 0; - virtual void bindParamT(unsigned int i, const struct tm *) = 0; - virtual void bindParamT(unsigned int i, time_t) = 0; + virtual void bindParamT(unsigned int i, const boost::posix_time::time_duration &) = 0; + virtual void bindParamT(unsigned int i, const boost::posix_time::ptime &) = 0; virtual void bindNull(unsigned int i) = 0; |