From 0c3b738af7c01d98795cba3ce06059420ac77103 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 2 Jun 2016 23:30:46 +0100 Subject: [PATCH] Added URL property for saving data from a CalendarEventObject. Added the code and unit tests for the URL property. --- .../calendarevent/CalendarEvent-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaleventsave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendarevent/CalendarEvent-Save.cpp b/source/objects/calendarevent/CalendarEvent-Save.cpp index e66baf8..e652d7a 100644 --- a/source/objects/calendarevent/CalendarEvent-Save.cpp +++ b/source/objects/calendarevent/CalendarEvent-Save.cpp @@ -548,6 +548,32 @@ void CalendarEventObject::SaveObjectData(string *SaveData){ } + // Process the URL value. + + if (URLData.size() > 0){ + + DataLine += "URL"; + + if (URLDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += URLDataTokens; + + } + + DataLine += ":"; + DataLine += URLData; + 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 5004d12..e64e02c 100644 --- a/source/tests/xestiacalendar_icaleventsave.h +++ b/source/tests/xestiacalendar_icaleventsave.h @@ -91,6 +91,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){ "SEQUENCE;TEST=YAY:3\n" "STATUS;LANGUAGE=kw;FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN:2.0;Success\n" "TRANSP;OPAQUE=NOTYET:TRANSPARENT\n" + "URL;EXTERNAL=YES:http://www.example.com/\n" "END:VEVENT\n" "END:VCARD"; -- 2.39.5