From 0da5345276f1e655e5e099fdf6280466e3a5dda4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 14 Jan 2012 09:43:38 +0200 Subject: Date-time part of Qt profile implementation for SQL Server --- qt/mssql/date-time/test.hxx | 55 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 qt/mssql/date-time/test.hxx (limited to 'qt/mssql/date-time/test.hxx') diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx new file mode 100644 index 0000000..c494efb --- /dev/null +++ b/qt/mssql/date-time/test.hxx @@ -0,0 +1,55 @@ +// file : qt/mssql/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + date_time == x.date_time && + date_time_dt == x.date_time_dt && + date_time_sdt == x.date_time_sdt && + time == x.time; + } + + bool + is_null () const + { + return + date.isNull () && + date_time.isNull () && + date_time_dt.isNull () && + date_time_sdt.isNull () && + time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + + QDateTime date_time; + + #pragma db type ("DATETIME") + QDateTime date_time_dt; + + #pragma db type ("SMALLDATETIME") + QDateTime date_time_sdt; + + QTime time; +}; + +#endif // TEST_HXX -- cgit v1.1