From: Steve Brokenshire Date: Sun, 5 Jun 2016 22:18:56 +0000 (+0100) Subject: Added LAST-MODIFIED property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~193 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=7eef45b2b5417d91b7701d95f4a30248b0d0b17f;p=xestiacalendar%2F.git Added LAST-MODIFIED property for saving data from a CalendarJournalObject. Added the code and unit tests for the LAST-MODIFIED property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index a2124e0..c68da9d 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -172,6 +172,34 @@ void CalendarJournalObject::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:VJOURNAL\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaljournalsave.h b/source/tests/xestiacalendar_icaljournalsave.h index 19ed01b..167ca69 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -70,6 +70,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "CLASS;CHOCOLATE=BAR:PUBLIC\n" "DTSTART;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMONE=YES;PARAMTWO=NO:20160131T1\n" " 43500Z\n" + "LAST-MODIFIED;FUTURE=YES:20160131T143700Z\n" "END:VJOURNAL\n" "END:VCALENDAR";