From: Steve Brokenshire Date: Thu, 2 Jun 2016 20:54:44 +0000 (+0100) Subject: Added LAST-MODIFIED property for saving data from a CalendarEventObject. X-Git-Tag: release-0.02~245 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=3b462406bd52d9c05c86d2099ec9ffaaa7f2de95;p=xestiacalendar%2F.git Added LAST-MODIFIED property for saving data from a CalendarEventObject. Added the code and unit tests for the LAST-MODIFIED property. --- diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index ceeb1c4..a5afcd5 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -312,6 +312,34 @@ void CalendarEventObject::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:VEVENT\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaleventsave.h b/source/tests/xestiacalendar_icaleventsave.h index b365b11..dcb07be 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -83,6 +83,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXAMPLE=TOKEN;MOREDATA=YES:This \n" " is a description of the event.\n" "GEO;EXAMPLE=MEEP:5.0;5.0\n" + "LAST-MODIFIED;FUTURE=ODD:20160124T093000Z\n" "END:VEVENT\n" "END:VCARD";