From 3d95d192836d0f9b8b4a3ab82bc0320d6e22cefc Mon Sep 17 00:00:00 2001 From: Sergey Magidovich Date: Wed, 25 Mar 2015 13:08:04 +0300 Subject: [PATCH] =?UTF-8?q?=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= =?UTF-8?q?=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88-mobile:?= =?UTF-8?q?=20More=20accurate=20clicks=20handling.=20[#MOBMET-1212]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/libmysqlxx/include/mysqlxx/Date.h | 9 +++++++++ libs/libmysqlxx/include/mysqlxx/DateTime.h | 17 ++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/libs/libmysqlxx/include/mysqlxx/Date.h b/libs/libmysqlxx/include/mysqlxx/Date.h index aee23f2ef89..d78f74ea266 100644 --- a/libs/libmysqlxx/include/mysqlxx/Date.h +++ b/libs/libmysqlxx/include/mysqlxx/Date.h @@ -185,3 +185,12 @@ inline std::ostream & operator<< (std::ostream & ostr, const Date & date) } } + + +namespace std +{ +inline string to_string(const mysqlxx::Date & date) +{ + return date.toString(); +} +} diff --git a/libs/libmysqlxx/include/mysqlxx/DateTime.h b/libs/libmysqlxx/include/mysqlxx/DateTime.h index 8e22084d166..1c122b6cc7e 100644 --- a/libs/libmysqlxx/include/mysqlxx/DateTime.h +++ b/libs/libmysqlxx/include/mysqlxx/DateTime.h @@ -28,7 +28,7 @@ private: unsigned char m_hour; unsigned char m_minute; unsigned char m_second; - + void init(time_t time) { if (unlikely(time > DATE_LUT_MAX || time == 0)) @@ -39,10 +39,10 @@ private: m_hour = 0; m_minute = 0; m_second = 0; - + return; } - + DateLUT & date_lut = DateLUT::instance(); const DateLUT::Values & values = date_lut.getValues(time); @@ -190,3 +190,14 @@ inline std::ostream & operator<< (std::ostream & ostr, const DateTime & datetime } } + + +namespace std +{ +inline string to_string(const mysqlxx::DateTime & datetime) +{ + stringstream str; + str << datetime; + return str.str(); +} +}