From 717c45c031e6c57dab228e37e9bd63cfb3b02b79 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 9 Jun 2016 22:40:45 +0100 Subject: [PATCH] Added LAST-MODIFIED property for saving data from a CalendarTimezoneObject. Added the code and unit tests for the LAST-MODIFIED property. --- .../CalendarTimezone-Save.cpp | 28 +++++++++++++++++++ .../tests/xestiacalendar_icaltimezonesave.h | 1 + 2 files changed, 29 insertions(+) diff --git a/source/objects/calendartimezone/CalendarTimezone-Save.cpp b/source/objects/calendartimezone/CalendarTimezone-Save.cpp index 2bdadff..8858e15 100644 --- a/source/objects/calendartimezone/CalendarTimezone-Save.cpp +++ b/source/objects/calendartimezone/CalendarTimezone-Save.cpp @@ -37,6 +37,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){ } + // Process the LAST-MODIFIED value. + + if (LastModifiedData.size() > 0){ + + if (LastModifiedTokens.size() > 0){ + + DataLine += "LAST-MODIFIED;"; + DataLine += LastModifiedTokens; + + } else { + + DataLine += "LAST-MODIFIED"; + + } + + DataLine += ":"; + DataLine += LastModifiedData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VTIMEZONE\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltimezonesave.h b/source/tests/xestiacalendar_icaltimezonesave.h index 8afaa2d..eff6583 100644 --- a/source/tests/xestiacalendar_icaltimezonesave.h +++ b/source/tests/xestiacalendar_icaltimezonesave.h @@ -62,6 +62,7 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){ "PRODID:-//Xestia//Calendar Unit Testing//KW\n" "BEGIN:VTIMEZONE\n" "TZID;OTHER=PARAM:Example/Starrgazy\n" + "LAST-MODIFIED;FUTURE=ODD:20160203T200700Z\n" "END:VTIMEZONE\n" "END:VCALENDAR"; -- 2.39.5