From e25bc826e7005de905c7497c946c292495d40f30 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Sun, 13 May 2012 21:49:06 +0000 Subject: [PATCH] changed: Date::SerializeDay outputs the date in a form of YYYY-MM-DD (before was: YYYY.MM.DD) git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@411 e52654a7-88a9-db11-a3e9-0013d4bc506e --- Makefile | 2 +- date/Makefile.dep | 6 +++--- date/Makefile.o.dep | 2 +- date/date.h | 18 +++++++++++++----- mainparser/Makefile.dep | 6 +++--- mainparser/Makefile.o.dep | 2 +- space/Makefile.dep | 8 ++++---- space/Makefile.o.dep | 2 +- utf8/Makefile.dep | 6 +++--- utf8/Makefile.o.dep | 2 +- 10 files changed, 31 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index d3d882e..2f92dc8 100755 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ CXX = g++ endif ifndef CXXFLAGS -CXXFLAGS = -Wall -pedantic -O2 -I/usr/local/include -I.. -L/usr/local/lib +CXXFLAGS = -Wall -O2 -I/usr/local/include -I.. -L/usr/local/lib endif export CXX diff --git a/date/Makefile.dep b/date/Makefile.dep index 2f861c5..5f2e8c9 100644 --- a/date/Makefile.dep +++ b/date/Makefile.dep @@ -1,3 +1,3 @@ -# DO NOT DELETE - -date.o: date.h +# DO NOT DELETE + +date.o: date.h diff --git a/date/Makefile.o.dep b/date/Makefile.o.dep index 1e1c891..a562b44 100644 --- a/date/Makefile.o.dep +++ b/date/Makefile.o.dep @@ -1 +1 @@ -o = date.o \ No newline at end of file +o = date.o diff --git a/date/date.h b/date/date.h index e3cc2e2..91ea3f0 100644 --- a/date/date.h +++ b/date/date.h @@ -207,25 +207,32 @@ public: /* - this method produces: year.month.day, eg. 1990.02.12 + this method outputs to the given stream: YYYY-MM-DD, eg. 1990.02.12 + ISO 8601 format */ template void SerializeDay(Stream & out) const; /* - this method produces: hour:min:sec, eg: 13:05:39 + this method outputs to the given stream: HH:MM:SS, eg: 13:05:39 + ISO 8601 format */ template void SerializeHour(Stream & out) const; /* - this method produces: year.month.day our:min:sec, eg: 1990.02.12 13:05:39 + this method outputs to the given stream: YYYY-MM-DD HH:MM:SS, eg: 1990-02-12 13:05:39 + ISO 8601 format */ template void Serialize(Stream & out) const; + + /* + the date + */ int year; // 1970 - ... int month; // 1 - 12 int day; // 1 - 31 @@ -259,9 +266,10 @@ void Date::SerializeInt(Stream & out, int val) const template void Date::SerializeDay(Stream & out) const { - out << year << '.'; + // !! IMPROVE ME the year should be printed with 4 digits, e.g. 0001 when the year is equal to one + out << year << '-'; SerializeInt(out, month); - out << '.'; + out << '-'; SerializeInt(out, day); } diff --git a/mainparser/Makefile.dep b/mainparser/Makefile.dep index 25b02b8..ad09e57 100644 --- a/mainparser/Makefile.dep +++ b/mainparser/Makefile.dep @@ -1,3 +1,3 @@ -# DO NOT DELETE - -mainparser.o: mainparser.h +# DO NOT DELETE + +mainparser.o: mainparser.h diff --git a/mainparser/Makefile.o.dep b/mainparser/Makefile.o.dep index 0a6c3a7..bf313b1 100644 --- a/mainparser/Makefile.o.dep +++ b/mainparser/Makefile.o.dep @@ -1 +1 @@ -o = mainparser.o \ No newline at end of file +o = mainparser.o diff --git a/space/Makefile.dep b/space/Makefile.dep index cb2d118..c43c31e 100755 --- a/space/Makefile.dep +++ b/space/Makefile.dep @@ -1,4 +1,4 @@ -# DO NOT DELETE - -space.o: space.h ../utf8/utf8.h -spaceparser.o: spaceparser.h space.h ../utf8/utf8.h +# DO NOT DELETE + +space.o: space.h ../utf8/utf8.h +spaceparser.o: spaceparser.h space.h ../utf8/utf8.h diff --git a/space/Makefile.o.dep b/space/Makefile.o.dep index 20925f2..2f519c5 100755 --- a/space/Makefile.o.dep +++ b/space/Makefile.o.dep @@ -1 +1 @@ -o = space.o spaceparser.o \ No newline at end of file +o = space.o spaceparser.o diff --git a/utf8/Makefile.dep b/utf8/Makefile.dep index f08d758..f2f3eba 100755 --- a/utf8/Makefile.dep +++ b/utf8/Makefile.dep @@ -1,3 +1,3 @@ -# DO NOT DELETE - -utf8.o: utf8.h +# DO NOT DELETE + +utf8.o: utf8.h diff --git a/utf8/Makefile.o.dep b/utf8/Makefile.o.dep index 25d2b0d..33f18af 100755 --- a/utf8/Makefile.o.dep +++ b/utf8/Makefile.o.dep @@ -1 +1 @@ -o = utf8.o \ No newline at end of file +o = utf8.o