diff options
author | randomdan <randomdan@localhost> | 2006-07-08 16:32:05 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2006-07-08 16:32:05 +0000 |
commit | 2a1fa15d8baa4eda37e17b2e9362f8bde17a939d (patch) | |
tree | 09386e52320b7c52a521ab56fc7553896e639dcd /libodbcpp/timetypepair.h | |
download | libdbpp-odbc-2a1fa15d8baa4eda37e17b2e9362f8bde17a939d.tar.bz2 libdbpp-odbc-2a1fa15d8baa4eda37e17b2e9362f8bde17a939d.tar.xz libdbpp-odbc-2a1fa15d8baa4eda37e17b2e9362f8bde17a939d.zip |
libcodbcpp initial release
Diffstat (limited to 'libodbcpp/timetypepair.h')
-rw-r--r-- | libodbcpp/timetypepair.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libodbcpp/timetypepair.h b/libodbcpp/timetypepair.h new file mode 100644 index 0000000..af77c0f --- /dev/null +++ b/libodbcpp/timetypepair.h @@ -0,0 +1,30 @@ +#ifndef ODBC_TIMETYPEPAIR_H +#define ODBC_TIMETYPEPAIR_H + +#include <time.h> +#include <sql.h> + +namespace ODBC { + class TimeTypePair { + typedef SQL_TIMESTAMP_STRUCT SQL_TS; + public: + TimeTypePair (); + TimeTypePair (const tm&); + TimeTypePair (const SQL_TS&); + + const SQL_TS& set(const tm&); + const tm& set(const SQL_TS&); + SQL_TS& sql() { return _sql; } + tm& c() { return _c; } + const SQL_TS& sql() const { return _sql; } + const tm& c() const { return _c; } + void sql2c() const; + void c2sql() const; + private: + mutable SQL_TS _sql; + mutable tm _c; + }; +}; + +#endif + |