From 75f3158d0acbd85b7c98def3938dd56319630399 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 23:12:44 +0100 Subject: [PATCH] Added EXDATE property for saving data from a CalendarTaskObject. Added the code and unit tests for the EXDATE property. --- .../calendartask/CalendarTask-Save.cpp | 44 +++++++++++++++++++ source/tests/xestiacalendar_icaltasksave.h | 3 ++ 2 files changed, 47 insertions(+) diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index ecf2362..96488ca 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -973,6 +973,50 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the EXDATE value. + + if (ExcludeDateData.size() > 0){ + + for (int ExcludeDateDataSeek = 0; ExcludeDateDataSeek < ExcludeDateData.size(); + ExcludeDateDataSeek++){ + + DataLine += "EXDATE"; + + if (ExcludeDateDataTimeZoneParam[ExcludeDateDataSeek].size() > 0){ + + DataLine += ";TZID="; + DataLine += ExcludeDateDataTimeZoneParam[ExcludeDateDataSeek]; + + } + + if (ExcludeDateDataValue[ExcludeDateDataSeek].size() > 0){ + + DataLine += ";VALUE="; + DataLine += ExcludeDateDataValue[ExcludeDateDataSeek]; + + } + + if (ExcludeDateDataTokens[ExcludeDateDataSeek].size() > 0){ + + DataLine += ";"; + DataLine += ExcludeDateDataTokens[ExcludeDateDataSeek]; + + } + + DataLine += ":"; + DataLine += ExcludeDateData[ExcludeDateDataSeek]; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + + } *SaveData += "END:VTODO\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltasksave.h b/source/tests/xestiacalendar_icaltasksave.h index 4313604..59012cb 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -103,6 +103,9 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "CONTACT:First Contact\n" "CONTACT;ALTREP=\"null:nodata\";LANGUAGE=en-GB:Second Contact\n" "CONTACT;ZEBRAS=NO:Third Contact\n" + "EXDATE:20160125T120000Z\n" + "EXDATE;TZID=Europe/Truro;VALUE=DATE-TIME:20160125T130000Z\n" + "EXDATE;ZOOP=ZIPPO:20160125T133000Z\n" "END:VTODO\n" "END:VCALENDAR"; -- 2.39.5