From 39a1ea10078f52463676e5df33eabc51476f31fd Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 22 Jun 2012 23:35:16 +0000 Subject: [PATCH] added: to Date: template void SerializeMonthDay(Stream & out) const; template void SerializeHourMin(Stream & out) const; git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@417 e52654a7-88a9-db11-a3e9-0013d4bc506e --- date/date.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/date/date.h b/date/date.h index e108807..487f921 100644 --- a/date/date.h +++ b/date/date.h @@ -266,6 +266,20 @@ public: void SerializeHourMinSec(Stream & out) const; + /* + this method outputs to the given stream: MM-DD, eg. 02-12 (02 month, 12 day) + */ + template + void SerializeMonthDay(Stream & out) const; + + + /* + this method outputs to the given stream: HH:MM, eg: 13:05 + */ + template + void SerializeHourMin(Stream & out) const; + + /* this method outputs to the given stream: YYYY-MM-DD HH:MM:SS, eg: 1990-02-12 13:05:39 ISO 8601 format @@ -527,6 +541,24 @@ void Date::SerializeHourMinSec(Stream & out) const } +template +void Date::SerializeMonthDay(Stream & out) const +{ + SerializeInt(out, month); + out << '-'; + SerializeInt(out, day); +} + + +template +void Date::SerializeHourMin(Stream & out) const +{ + SerializeInt(out, hour); + out << ':'; + SerializeInt(out, min); +} + + template void Date::Serialize(Stream & out) const {