From 7eef45b2b5417d91b7701d95f4a30248b0d0b17f Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 23:18:56 +0100 Subject: [PATCH] Added LAST-MODIFIED property for saving data from a CalendarJournalObject. Added the code and unit tests for the LAST-MODIFIED property. --- .../calendarjournal/CalendarJournal-Save.cpp | 28 +++++++++++++++++++ source/tests/xestiacalendar_icaljournalsave.h | 1 + 2 files changed, 29 insertions(+) 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"; -- 2.39.5