From 910d07c484cb6930d9deef1c76c12c7a997dffda Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 4 Jun 2016 20:56:29 +0100 Subject: [PATCH] Added REQUEST-STATUS property for saving data from a CalendarEventObject. Added the code and unit tests for the REQUEST-STATUS property. --- .../calendarevent/CalendarEvent-Save.cpp | 38 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 4 ++ 2 files changed, 42 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index 7d303ca..0181d0a 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -988,6 +988,44 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the REQUEST-STATUS value. + + if (RequestStatusData.size() > 0){ + + for (int RequestStatusDataSeek = 0; RequestStatusDataSeek < RequestStatusData.size(); + RequestStatusDataSeek++){ + + DataLine += "REQUEST-STATUS"; + + if (RequestStatusLanguage[RequestStatusDataSeek].size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += RequestStatusLanguage[RequestStatusDataSeek]; + + } + + if (RequestStatusTokens[RequestStatusDataSeek].size() > 0){ + + DataLine += ";"; + DataLine += RequestStatusTokens[RequestStatusDataSeek]; + + } + + DataLine += ":"; + DataLine += RequestStatusData[RequestStatusDataSeek]; + 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 f33662c..8b851fc 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -119,6 +119,10 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "EXDATE:20160125T120000Z\n" "EXDATE;TZID=Europe/Truro;VALUE=DATE-TIME:20160125T130000Z\n" "EXDATE;ZOOP=ZIPPO:20160125T133000Z\n" + "REQUEST-STATUS:2.0;Success\n" + "REQUEST-STATUS;LANGUAGE=en:3.42;Really big irrecoverable error caused by the \n" + " user\n" + "REQUEST-STATUS;USER=MISSING:3.7;Invalid calendar user\n" "END:VEVENT\n" "END:VCARD"; -- 2.39.5