summaryrefslogtreecommitdiff
path: root/lib/input/mysqlBindings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/input/mysqlBindings.cpp')
-rw-r--r--lib/input/mysqlBindings.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/input/mysqlBindings.cpp b/lib/input/mysqlBindings.cpp
new file mode 100644
index 0000000..3895821
--- /dev/null
+++ b/lib/input/mysqlBindings.cpp
@@ -0,0 +1,28 @@
+#include "mysqlBindings.h"
+
+namespace MyGrate::Input {
+ MYSQL_TIME &
+ operator<<(MYSQL_TIME & t, const Date & dt)
+ {
+ t.year = dt.year;
+ t.month = dt.month;
+ t.day = dt.day;
+ return t;
+ }
+
+ MYSQL_TIME &
+ operator<<(MYSQL_TIME & t, const Time & dt)
+ {
+ t.hour = dt.hour;
+ t.minute = dt.minute;
+ t.second = dt.second;
+ return t;
+ }
+
+ MYSQL_TIME &
+ operator<<(MYSQL_TIME & t, const DateTime & dt)
+ {
+ return t << (Date)dt << (Time)dt;
+ }
+
+}