Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added X-Token property for saving data from a CalendarTimezoneObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 12 Jun 2016 00:00:48 +0000 (01:00 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 12 Jun 2016 00:00:48 +0000 (01:00 +0100)
Added the code and unit tests for the X-Token property in both
STANDARD and DAYLIGHT timezone types.

source/objects/calendartimezone/CalendarTimezone-Save.cpp
source/tests/xestiacalendar_icaltimezonesave.h

index 82b2d65..bf25e6d 100644 (file)
@@ -342,7 +342,30 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                }
                
                        }
+                       
+                       // Process data from X-*
+       
+                       if (TimezoneStandardCollection[TimezoneStandardSeek].XTokensData.size() > 0){
+                               
+                               for (int TimezoneXTokenSeek = 0; TimezoneXTokenSeek < TimezoneStandardCollection[TimezoneStandardSeek].XTokensData.size();
+                                       TimezoneXTokenSeek++){
+                               
+                                       DataLine += TimezoneStandardCollection[TimezoneStandardSeek].XTokensDataTokens[TimezoneXTokenSeek];
+                                       DataLine += ":";
+                                       DataLine += TimezoneStandardCollection[TimezoneStandardSeek].XTokensData[TimezoneXTokenSeek];
+                                       DataLine += "\n";
+
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                                               
+                               }
                                
+                       }
+                       
                        *SaveData += "END:STANDARD\n";
                                
                }
@@ -598,6 +621,29 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                }
                
                        }
+
+                       // Process data from X-*
+       
+                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].XTokensData.size() > 0){
+                               
+                               for (int TimezoneXTokenSeek = 0; TimezoneXTokenSeek < TimezoneDaylightCollection[TimezoneDaylightSeek].XTokensData.size();
+                                       TimezoneXTokenSeek++){
+                               
+                                       DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].XTokensDataTokens[TimezoneXTokenSeek];
+                                       DataLine += ":";
+                                       DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].XTokensData[TimezoneXTokenSeek];
+                                       DataLine += "\n";
+
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                                               
+                               }
+                               
+                       }
                        
                        *SaveData += "END:DAYLIGHT\n";
                                
index 678ea60..9799558 100644 (file)
@@ -83,6 +83,15 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "RDATE;VALUE=DATE;TZID=Europe/Truro;BEEP=BOOP:20160205,20160207,20160216,20160\n"
        " 305\n"
        "TZNAME;LANGUAGE=en;NOPE=YES:Example Timezone Name 1\n"
+       "X-MOO:Meep\n"
+       "X-MOO:Moop\n"
+       "X-MOO;MEEP=YIKES:Zaap\n"
+       "X-ITEM:Fork\n"
+       "X-ITEM:Spoon\n"
+       "X-ITEM;DIRTY=NO:Knife\n"
+       "X-NOPE:1\n"
+       "X-NOPE:2\n"
+       "X-NOPE;LONG=YES:3\n"
        "END:STANDARD\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART:20160204T020000\n"
@@ -103,6 +112,15 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "RDATE;VALUE=DATE;TZID=Europe/Truro;BEEP=BOOP:20160205,20160207,20160216,20160\n"
        " 305\n"
        "TZNAME;LANGUAGE=en;NOPE=YES:Example Timezone Name 1\n"
+       "X-MOO:Meep\n"
+       "X-MOO:Moop\n"
+       "X-MOO;MEEP=YIKES:Zaap\n"
+       "X-ITEM:Fork\n"
+       "X-ITEM:Spoon\n"
+       "X-ITEM;DIRTY=NO:Knife\n"
+       "X-NOPE:1\n"
+       "X-NOPE:2\n"
+       "X-NOPE;LONG=YES:3\n"
        "END:DAYLIGHT\n"
        "END:VTIMEZONE\n"
        "END:VCALENDAR";
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy