From: Steve Brokenshire Date: Sun, 5 Jun 2016 23:03:23 +0000 (+0100) Subject: Added REQUEST-STATUS property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~177 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=eeb65bde963cf3ccb07b1c73da87a4d2564c7ea7;p=xestiacalendar%2F.git Added REQUEST-STATUS property for saving data from a CalendarJournalObject. Added the code and unit tests for the REQUEST-STATUS property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index b347e0b..a46aa84 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -883,6 +883,45 @@ void CalendarJournalObject::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:VJOURNAL\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaljournalsave.h b/source/tests/xestiacalendar_icaljournalsave.h index 835d995..f9da37e 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -113,6 +113,10 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "RDATE:20160120\n" "RDATE;VALUE=DATE;TZID=Europe/Truro:20160121\n" "RDATE;ZILCH=DATA:20160520\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:VJOURNAL\n" "END:VCALENDAR";