From 25b00fe5680382f26a0d18a0d5ddb26cacdf221d Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 18:19:03 +0100 Subject: [PATCH] Added URL property for saving data from a CalendarFreeBusyObject. Added the code and unit tests for the URL property. --- .../CalendarFreeBusy-Save.cpp | 26 +++++++++++++++++++ .../tests/xestiacalendar_icalfreebusysave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp b/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp index 46c09ac..e60db34 100644 --- a/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp +++ b/source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp @@ -246,6 +246,32 @@ void CalendarFreeBusyObject::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:VFREEBUSY\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icalfreebusysave.h b/source/tests/xestiacalendar_icalfreebusysave.h index 6b92a0f..dd28e96 100644 --- a/source/tests/xestiacalendar_icalfreebusysave.h +++ b/source/tests/xestiacalendar_icalfreebusysave.h @@ -65,6 +65,7 @@ TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){ " 183000Z\n" "ORGANIZER;CN=ExampleOrganiser;DIR=\"null:nodata\";SENT-BY=\"mailto:organiser.nor\n" " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@example.com\n" + "URL;EXTERNAL=YES:http://www.example.com/\n" "END:VFREEBUSY\n" "END:VCALENDAR"; -- 2.39.5