Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Version 0.08 release
[xestiacalendar/.git] / objects / calendarevent / CalendarEvent.cpp
1 #include "CalendarEvent.h"
3 using namespace std;
5 CalendarObjectValidResult CalendarEventObject::ValidObject(){
6  
7         bool ValidBegin = false;
8         bool ValidEnd = false;
9         bool ValidDateTimeStamp = false;
10         bool ValidUniqueID = false;
11         bool ValidDateTimeStart = false;
12         int SeekCount = 0;
13         string PropertyName;
14         
15         // Look for BEGIN:VEVENT.
16         
17         for (vector<string>::iterator iter = ObjectName.begin();
18                 iter != ObjectName.end(); iter++){
19         
20                 if (ObjectName[SeekCount] == "BEGIN" &&
21                         ObjectData[SeekCount] == "VEVENT"){
22                         
23                         if (ValidBegin == false){
24                                 ValidBegin = true;
25                         } else {
26                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
27                         }
28                                 
29                 }
30                 
31                 if (ObjectName[SeekCount] == "END" &&
32                         ObjectData[SeekCount] == "VEVENT" &&
33                         ValidBegin == false){
34                 
35                         return CALENDAROBJECTVALID_INVALIDFORMAT;
36                                 
37                 }
38                 
39                 SeekCount++;
40                         
41         }
42         
43         SeekCount = 0;
44         
45         // Look for DTSTAMP.
46         
47         for (vector<string>::iterator iter = ObjectName.begin();
48                 iter != ObjectName.end(); iter++){
49                         
50                 try{
51                         PropertyName = ObjectName[SeekCount].substr(0,7);
52                 }
53                         
54                 catch(const out_of_range& oor){
55                         continue;
56                 }
57                 
58                 if (PropertyName == "DTSTAMP"){
59                         
60                         if (ValidDateTimeStamp == false){
61                                 ValidDateTimeStamp = true;
62                         } else {
63                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
64                         }
65                                 
66                 }
67                         
68                 SeekCount++;
69                         
70         }
71         
72         SeekCount = 0;
73         
74         // Look for UID.
75         
76         for (vector<string>::iterator iter = ObjectName.begin();
77                 iter != ObjectName.end(); iter++){
78         
79                 try{
80                         PropertyName = ObjectName[SeekCount].substr(0,3);
81                 }
82                 
83                 catch(const out_of_range& oor){
84                         continue;
85                 }
86                         
87                 if (PropertyName == "UID"){
88                         
89                         if (ValidUniqueID == false){
90                                 ValidUniqueID = true;
91                         } else {
92                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
93                         }
94                                 
95                 }
96                         
97                 SeekCount++;
98                         
99         }
100         
101         SeekCount = 0;
102         
103         // Look for DTSTART if nothing is set for METHOD..
104         
105         if (MethodData.size() == 0){
106         
107                 for (vector<string>::iterator iter = ObjectName.begin();
108                         iter != ObjectName.end(); iter++){
109                         
110                         try{
111                                 PropertyName = ObjectName[SeekCount].substr(0,7);
112                         }
113                         
114                         catch(const out_of_range& oor){
115                                 continue;
116                         }
117                 
118                         if (PropertyName == "DTSTART"){
119                         
120                                 if (ValidDateTimeStart == false){
121                                         ValidDateTimeStart = true;
122                                 } else {
123                                         return CALENDAROBJECTVALID_INVALIDFORMAT;
124                                 }
125                                 
126                         }
127                         
128                         SeekCount++;
129                         
130                 }
131         
132         } else {
133                 ValidDateTimeStart = true;
134         }
135         
136         SeekCount = 0;
137         
138         // Look for END:VEVENT.
139         
140         for (vector<string>::iterator iter = ObjectName.begin();
141                 iter != ObjectName.end(); iter++){
142         
143                 if (ObjectName[SeekCount] == "END" &&
144                         ObjectData[SeekCount] == "VEVENT"){
145                         
146                         if (ValidEnd == false){
147                                 ValidEnd = true;
148                         } else {
149                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
150                         }
151                                 
152                 }
153                         
154                 SeekCount++;
155                         
156         }
157         
158         // Check if the VEVENT is valid.
160         if (ValidBegin == true && 
161                 ValidEnd == true && 
162                 ValidDateTimeStamp == true &&
163                 ValidDateTimeStart == true &&
164                 ValidUniqueID == true){
165                 
166                 return CALENDAROBJECTVALID_OK;
167                         
168         } else {
169                 
170                 return CALENDAROBJECTVALID_INVALIDFORMAT;
171                 
172         }
173         
176 void CalendarEventObject::ProcessData(){
177         
178         // Process the data.
179         
180         multimap<string,string> DataReceived;
181         map<string,string> PropertyData;
182         string *PropertyNameData = nullptr;
183         int ObjectSeekCount = 0;
184         
185         // Get the Date Time Stamp (DTSTAMP).
186         
187         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTAMP");
188         
189         // Process the data from DTSTAMP.
190         
191         if (DataReceived.begin() != DataReceived.end()){
192         
193                 try {
194                         DateTimeStampTokens = DataReceived.begin()->first.substr(8);
195                 }
196                 
197                 catch(const out_of_range &oor){
198                         // Do nothing as there is no data.
199                 }               
200                 
201                 DateTimeStampData = DataReceived.begin()->second;
202                 
203         }
205         // Get the Unique ID (UID).
206         
207         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "UID");
208         
209         // Process the data from UID.
210         
211         if (DataReceived.begin() != DataReceived.end()){
212         
213                 try {
214                         UniqueIDTokens = DataReceived.begin()->first.substr(4);
215                 }
216                 
217                 catch(const out_of_range &oor){
218                         // Do nothing as there is no data.
219                 }               
220                 
221                 UniqueID = DataReceived.begin()->second;
222                 
223         }
224         
225         // Get the Date Time Start value.
226         
227         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTART");
228         
229         // Process the data from DTSTART.
230         
231         if (DataReceived.begin() != DataReceived.end()){
232         
233                 bool TokenData = false;
234                 string PropertyTokens;
235                 
236                 PropertyNameData = (string*)&DataReceived.begin()->first;
237                 
238                 PropertyData = SplitValues(*PropertyNameData);
239                 
240                 for(map<string,string>::iterator iter = PropertyData.begin();
241                         iter != PropertyData.end(); iter++){
242                         
243                         if (iter->first == "VALUE"){
244                                 
245                                 DateTimeStartDataValue = iter->second;
246                                 
247                         } else if (iter->first == "TZID"){
248                                 
249                                 DateTimeStartDataTimeZoneID = iter->second;
250                                 
251                         } else {
252                                 
253                                 if (TokenData == false){
254                                         TokenData = true;
255                                 } else {
256                                         PropertyTokens += ";";
257                                 }
258                                 
259                                 PropertyTokens += iter->first;
260                                 PropertyTokens += "=";
261                                 PropertyTokens += iter->second;
262                                 
263                         }
264                                 
265                 }
266                 
267                 if (PropertyTokens.size() > 0){
268                         DateTimeStartDataTokens = PropertyTokens;
269                 }
270                 
271                 DateTimeStartData = DataReceived.begin()->second;
272                 
273         }
274         
275         // Process the data from CLASS.
276         
277         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CLASS");
278         
279         if (DataReceived.begin() != DataReceived.end()){
280         
281                 try {
282                         ClassDataTokens = DataReceived.begin()->first.substr(6);
283                 }
284                 
285                 catch(const out_of_range &oor){
286                         // Do nothing as there is no data.
287                 }               
288                 
289                 ClassData = DataReceived.begin()->second;
290                 
291         }
292         
293         // Process the data from CREATED.
294         
295         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CREATED");
296         
297         if (DataReceived.begin() != DataReceived.end()){
298         
299                 try {
300                         DateTimeCreatedTokens = DataReceived.begin()->first.substr(8);
301                 }
302                 
303                 catch(const out_of_range &oor){
304                         // Do nothing as there is no data.
305                 }               
306                 
307                 DateTimeCreatedData = DataReceived.begin()->second;
308                 
309         }
310         
311         // Process the data from DESCRIPTION.
312         
313         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DESCRIPTION");
314         
315         if (DataReceived.begin() != DataReceived.end()){
316         
317                 bool TokenData = false;
318                 string PropertyTokens;
319                 
320                 PropertyNameData = (string*)&DataReceived.begin()->first;
321                 
322                 PropertyData = SplitValues(*PropertyNameData);
323                 
324                 for(map<string,string>::iterator iter = PropertyData.begin();
325                         iter != PropertyData.end(); iter++){
326                         
327                         if (iter->first == "ALTREP"){
328                                 
329                                 DescriptionListAltRep.clear();
330                                 DescriptionListAltRep.push_back(iter->second);
331                                 
332                         } else if (iter->first == "LANGUAGE"){
333                                 
334                                 DescriptionListLanguage.clear();
335                                 DescriptionListLanguage.push_back(iter->second);
336                                 
337                         } else {
338                                 
339                                 if (TokenData == false){
340                                         TokenData = true;
341                                 } else {
342                                         PropertyTokens += ";";
343                                 }
344                                 
345                                 PropertyTokens += iter->first;
346                                 PropertyTokens += "=";
347                                 PropertyTokens += iter->second;
348                                 
349                         }
350                                 
351                 }
352                 
353                 if (PropertyTokens.size() > 0){
354                         DescriptionListTokens.clear();
355                         DescriptionListTokens.push_back(PropertyTokens);
356                 }
357                 
358                 DescriptionList.clear();
359                 DescriptionList.push_back(DataReceived.begin()->second);
360                 
361         }
362         
363         // Process the data from GEO.
364         
365         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "GEO");
366         
367         if (DataReceived.begin() != DataReceived.end()){
368         
369                 try {
370                         GeographicTokens = DataReceived.begin()->first.substr(4);
371                 }
372                 
373                 catch(const out_of_range &oor){
374                         // Do nothing as there is no data.
375                 }               
376                 
377                 GeographicData = DataReceived.begin()->second;
378                 
379         }
380         
381         // Process the data from LAST-MODIFIED.
382         
383         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LAST-MODIFIED");
384         
385         if (DataReceived.begin() != DataReceived.end()){
386         
387                 try {
388                         LastModifiedTokens = DataReceived.begin()->first.substr(14);
389                 }
390                 
391                 catch(const out_of_range &oor){
392                         // Do nothing as there is no data.
393                 }               
394                 
395                 LastModifiedData = DataReceived.begin()->second;
396                 
397         }
398         
399         // Process the data from LOCATION.
400         
401         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LOCATION");
402         
403         if (DataReceived.begin() != DataReceived.end()){
404         
405                 bool TokenData = false;
406                 string PropertyTokens;
407                 
408                 PropertyNameData = (string*)&DataReceived.begin()->first;
409                 
410                 PropertyData = SplitValues(*PropertyNameData);
411                 
412                 for(map<string,string>::iterator iter = PropertyData.begin();
413                         iter != PropertyData.end(); iter++){
414                         
415                         if (iter->first == "ALTREP"){
416                                 
417                                 LocationDataAltRep = iter->second;
418                                 
419                         } else if (iter->first == "LANGUAGE"){
420                                 
421                                 LocationDataLanguage = iter->second;
422                                 
423                         } else {
424                                 
425                                 if (TokenData == false){
426                                         TokenData = true;
427                                 } else {
428                                         PropertyTokens += ";";
429                                 }
430                                 
431                                 PropertyTokens += iter->first;
432                                 PropertyTokens += "=";
433                                 PropertyTokens += iter->second;
434                                 
435                         }
436                                 
437                 }
438                 
439                 if (PropertyTokens.size() > 0){
440                         
441                         LocationDataTokens = PropertyTokens;
442                         
443                 }
444                 
445                 LocationData = DataReceived.begin()->second;
446                 
447         }
448         
449         // Process the data from ORGANIZER.
450         
451         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "ORGANIZER");
452         
453         if (DataReceived.begin() != DataReceived.end()){
454         
455                 bool TokenData = false;
456                 string PropertyTokens;
457                 
458                 PropertyNameData = (string*)&DataReceived.begin()->first;
459                 
460                 PropertyData = SplitValues(*PropertyNameData);
461                 
462                 for(map<string,string>::iterator iter = PropertyData.begin();
463                         iter != PropertyData.end(); iter++){
464                         
465                         if (iter->first == "CN"){
466                                 
467                                 OrganiserDataCommonName = iter->second;
468                                 
469                         } else if (iter->first == "DIR"){
470                                 
471                                 OrganiserDataDirectoryEntry = iter->second;
472                                 
473                         } else if (iter->first == "SENT-BY"){
474                                 
475                                 OrganiserDataSentByParam = iter->second;
476                                 
477                         } else if (iter->first == "LANGUAGE"){
478                                 
479                                 OrganiserDataLanguage = iter->second;
480                                 
481                         } else {
482                                 
483                                 if (TokenData == false){
484                                         TokenData = true;
485                                 } else {
486                                         PropertyTokens += ";";
487                                 }
488                                 
489                                 PropertyTokens += iter->first;
490                                 PropertyTokens += "=";
491                                 PropertyTokens += iter->second;
492                                 
493                         }
494                                 
495                 }
496                 
497                 if (PropertyTokens.size() > 0){
498                         
499                         OrganiserDataTokens = PropertyTokens;
500                         
501                 }
502                 
503                 OrganiserData = DataReceived.begin()->second;
504                 
505         }
507         // Process the data from PRIORITY.
508         
509         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "PRIORITY");
510         
511         if (DataReceived.begin() != DataReceived.end()){
512         
513                 try {
514                         PriorityTokens = DataReceived.begin()->first.substr(9);
515                 }
516                 
517                 catch(const out_of_range &oor){
518                         // Do nothing as there is no data.
519                 }               
520                 
521                 try {
522                         PriorityData = stoi(DataReceived.begin()->second);
523                 }
524                 
525                 catch(const invalid_argument &oor){
526                         PriorityTokens.clear();
527                 }
528                 
529         }
530         
531         // Process the data from SEQUENCE.
532         
533         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SEQUENCE");
534         
535         if (DataReceived.begin() != DataReceived.end()){
536         
537                 try {
538                         SequenceTokens = DataReceived.begin()->first.substr(9);
539                 }
540                 
541                 catch(const out_of_range &oor){
542                         // Do nothing as there is no data.
543                 }               
544                 
545                 try {
546                         SequenceData = stoi(DataReceived.begin()->second);
547                 }
548                 
549                 catch(const invalid_argument &oor){
550                         SequenceTokens.clear();
551                 }
552                 
553         }
554         
555         // Process the data from STATUS.
556         
557         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "STATUS");
558         
559         if (DataReceived.begin() != DataReceived.end()){
560         
561                 bool TokenData = false;
562                 string PropertyTokens;
563                 
564                 PropertyNameData = (string*)&DataReceived.begin()->first;
565                 
566                 PropertyData = SplitValues(*PropertyNameData);
567                 
568                 for(map<string,string>::iterator iter = PropertyData.begin();
569                         iter != PropertyData.end(); iter++){
570                         
571                         if (iter->first == "LANGUAGE"){
572                                 
573                                 StatusLanguage = iter->second;
574                                 
575                         } else {
576                                 
577                                 if (TokenData == false){
578                                         TokenData = true;
579                                 } else {
580                                         PropertyTokens += ";";
581                                 }
582                                 
583                                 PropertyTokens += iter->first;
584                                 PropertyTokens += "=";
585                                 PropertyTokens += iter->second;
586                                 
587                         }
588                                 
589                 }
590                 
591                 if (PropertyTokens.size() > 0){
592                         
593                         StatusTokens = PropertyTokens;
594                         
595                 }
596                 
597                 StatusData = DataReceived.begin()->second;
598                 
599         }
600         
601         // Process the data from SUMMARY.
602         
603         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SUMMARY");
604         
605         if (DataReceived.begin() != DataReceived.end()){
606         
607                 bool TokenData = false;
608                 string PropertyTokens;
609                 
610                 PropertyNameData = (string*)&DataReceived.begin()->first;
611                 
612                 PropertyData = SplitValues(*PropertyNameData);
613                 
614                 for(map<string,string>::iterator iter = PropertyData.begin();
615                         iter != PropertyData.end(); iter++){
616                         
617                         if (iter->first == "ALTREP"){
618                                 
619                                 SummaryDataAltRep = iter->second;
620                                 
621                         } else if (iter->first == "LANGUAGE"){
622                                 
623                                 SummaryDataLanguage = iter->second;
624                                 
625                         } else {
626                                 
627                                 if (TokenData == false){
628                                         TokenData = true;
629                                 } else {
630                                         PropertyTokens += ";";
631                                 }
632                                 
633                                 PropertyTokens += iter->first;
634                                 PropertyTokens += "=";
635                                 PropertyTokens += iter->second;
636                                 
637                         }
638                                 
639                 }
640                 
641                 if (PropertyTokens.size() > 0){
642                         
643                         SummaryDataTokens = PropertyTokens;
644                         
645                 }
646                 
647                 SummaryData = DataReceived.begin()->second;
648                 
649         }
650         
651         // Process the data from TRANSP.
652         
653         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "TRANSP");
654         
655         if (DataReceived.begin() != DataReceived.end()){
656         
657                 try {
658                         TimeTransparencyDataTokens = DataReceived.begin()->first.substr(7);
659                 }
660                 
661                 catch(const out_of_range &oor){
662                         // Do nothing as there is no data.
663                 }               
664                 
665                 TimeTransparencyData = DataReceived.begin()->second;
666                 
667         }
668         
669         // Process the data from URL.
670         
671         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "URL");
672         
673         if (DataReceived.begin() != DataReceived.end()){
674         
675                 try {
676                         URLDataTokens = DataReceived.begin()->first.substr(4);
677                 }
678                 
679                 catch(const out_of_range &oor){
680                         // Do nothing as there is no data.
681                 }               
682                 
683                 URLData = DataReceived.begin()->second;
684                 
685         }
686         
687         // Process the data from RECURRENCE-ID.
688         
689         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RECURRENCE-ID");
690         
691         if (DataReceived.begin() != DataReceived.end()){
692         
693                 bool TokenData = false;
694                 string PropertyTokens;
695                 
696                 PropertyNameData = (string*)&DataReceived.begin()->first;
697                 
698                 PropertyData = SplitValues(*PropertyNameData);
699                 
700                 for(map<string,string>::iterator iter = PropertyData.begin();
701                         iter != PropertyData.end(); iter++){
702                         
703                         if (iter->first == "TZID"){
704                                 
705                                 RecurranceIDDataTimeZoneParam = iter->second;
706                                 
707                         } else if (iter->first == "VALUE"){
708                                 
709                                 RecurranceIDDataValue = iter->second;
710                                 
711                         } else if (iter->first == "RANGE"){
712                                 
713                                 RecurranceIDDataRangeParam = iter->second;
714                                 
715                         } else {
716                                 
717                                 if (TokenData == false){
718                                         TokenData = true;
719                                 } else {
720                                         PropertyTokens += ";";
721                                 }
722                                 
723                                 PropertyTokens += iter->first;
724                                 PropertyTokens += "=";
725                                 PropertyTokens += iter->second;
726                                 
727                         }
728                                 
729                 }
730                 
731                 if (PropertyTokens.size() > 0){
732                         
733                         RecurranceIDDataTokens = PropertyTokens;
734                         
735                 }
736                 
737                 RecurranceIDData = DataReceived.begin()->second;
738                 
739         }
740         
741         // Process the data from RRULE.
742         
743         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RRULE");
744         
745         if (DataReceived.begin() != DataReceived.end()){
746         
747                 try {
748                         RecurranceRuleDataTokens = DataReceived.begin()->first.substr(6);
749                 }
750                 
751                 catch(const out_of_range &oor){
752                         // Do nothing as there is no data.
753                 }               
754                 
755                 RecurranceRuleData = DataReceived.begin()->second;
756                 
757         }
758         
759         // Process the data from DTEND.
760         
761         bool DateTimeEndProcessed = false;
762         
763         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTEND");
764         
765         if (DataReceived.begin() != DataReceived.end()){
766         
767                 bool TokenData = false;
768                 string PropertyTokens;
769                 
770                 PropertyNameData = (string*)&DataReceived.begin()->first;
771                 
772                 PropertyData = SplitValues(*PropertyNameData);
773                 
774                 for(map<string,string>::iterator iter = PropertyData.begin();
775                         iter != PropertyData.end(); iter++){
776                         
777                         if (iter->first == "VALUE"){
778                                 
779                                 DateTimeEndDataValue = iter->second;
780                                 
781                         } else if (iter->first == "TZID"){
782                                 
783                                 DateTimeEndDataTimeZoneID = iter->second;
784                                 
785                         } else {
786                                 
787                                 if (TokenData == false){
788                                         TokenData = true;
789                                 } else {
790                                         PropertyTokens += ";";
791                                 }
792                                 
793                                 PropertyTokens += iter->first;
794                                 PropertyTokens += "=";
795                                 PropertyTokens += iter->second;
796                                 
797                         }
798                                 
799                 }
800                 
801                 if (PropertyTokens.size() > 0){
802                         DateTimeEndDataTokens = PropertyTokens;
803                 }
804                 
805                 DateTimeEndData = DataReceived.begin()->second;
806                 
807                 DateTimeEndProcessed = true;
808                 
809         }
810         
811         if (DateTimeEndProcessed == false){
812                 
813                 // Process the data from DURATION if DTEND 
814                 // hasn't already been processed.
815                 
816                 DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DURATION");
817                 
818                 if (DataReceived.begin() != DataReceived.end()){
819         
820                         try {
821                                 DurationDataTokens = DataReceived.begin()->first.substr(9);
822                         }
823                 
824                         catch(const out_of_range &oor){
825                                 // Do nothing as there is no data.
826                         }               
827                 
828                         DurationData = DataReceived.begin()->second;
829                 
830                 }
831                 
832         }
833         
834         // Process the data from ATTACH.
835         
836         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTACH");
837         
838         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
839                 iter != DataReceived.end(); 
840                 ++iter){
841                 
842                 AttachListEncoding.push_back("");
843                 AttachListValue.push_back("");
844                 AttachListFormatType.push_back("");
845                 AttachListTokens.push_back("");
846                 AttachList.push_back("");
847                         
848                 bool TokenData = false;
849                 string PropertyTokens;
850                 
851                 PropertyNameData = (string*)&iter->first;
852                 
853                 PropertyData = SplitValues(*PropertyNameData);
854                         
855                 for(map<string,string>::iterator dataiter = PropertyData.begin();
856                         dataiter != PropertyData.end(); dataiter++){
857                         
858                         if (dataiter->first == "ENCODING"){
859                                 
860                                 AttachListEncoding[ObjectSeekCount] = dataiter->second;
861                                 
862                         } else if (dataiter->first == "VALUE"){
863                                 
864                                 AttachListValue[ObjectSeekCount] = dataiter->second;
865                                 
866                         } else if (dataiter->first == "FMTTYPE"){
867                                 
868                                 AttachListFormatType[ObjectSeekCount] = dataiter->second;
869                                 
870                         } else {
871                                 
872                                 if (TokenData == false){
873                                         TokenData = true;
874                                 } else {
875                                         PropertyTokens += ";";
876                                 }
877                                 
878                                 PropertyTokens += dataiter->first;
879                                 PropertyTokens += "=";
880                                 PropertyTokens += dataiter->second;
881                                 
882                         }
883                                 
884                 }
885                 
886                 if (PropertyTokens.size() > 0){
887                         AttachListTokens[ObjectSeekCount] = PropertyTokens;
888                 }
889                         
890                 AttachList[ObjectSeekCount] = iter->second;
891                 
892                 ObjectSeekCount++;
893                 
894         }
895         
896         // Process the data from ATTENDEE.
897         
898         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTENDEE");
899         
900         ObjectSeekCount = 0;
901         
902         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
903                 iter != DataReceived.end(); 
904                 ++iter){
905                         
906                 AttendeeListMember.push_back("");
907                 AttendeeListDelegatedFrom.push_back("");
908                 AttendeeListDelegatedTo.push_back("");
909                 AttendeeListRole.push_back("");
910                 AttendeeListRSVP.push_back("");
911                 AttendeeListDirectoryEntry.push_back("");
912                 AttendeeListSentBy.push_back("");
913                 AttendeeListCommonName.push_back("");
914                 AttendeeListCalendarUserType.push_back("");
915                 AttendeeListParticipationStatus.push_back("");
916                 AttendeeListLanguage.push_back("");
917                 AttendeeListTokens.push_back("");
918                 AttendeeList.push_back("");
919                         
920                 bool TokenData = false;
921                 string PropertyTokens;
922                 
923                 PropertyNameData = (string*)&iter->first;
924                 
925                 PropertyData = SplitValues(*PropertyNameData);
926                         
927                 for(map<string,string>::iterator dataiter = PropertyData.begin();
928                         dataiter != PropertyData.end(); dataiter++){
929                         
930                         if (dataiter->first == "CUTYPE"){
931                                 
932                                 AttendeeListCalendarUserType[ObjectSeekCount] = dataiter->second;
933                                 
934                         } else if (dataiter->first == "MEMBER"){
935                                 
936                                 AttendeeListMember[ObjectSeekCount] = dataiter->second;
937                                 
938                         } else if (dataiter->first == "ROLE"){
939                                 
940                                 AttendeeListRole[ObjectSeekCount] = dataiter->second;
941                                 
942                         } else if (dataiter->first == "PARTSTAT"){
943                                 
944                                 AttendeeListParticipationStatus[ObjectSeekCount] = dataiter->second;
945                                 
946                         } else if (dataiter->first == "RSVP"){
947                                 
948                                 AttendeeListRSVP[ObjectSeekCount] = dataiter->second;
949                                 
950                         } else if (dataiter->first == "DELEGATED-TO"){
951                                 
952                                 AttendeeListDelegatedTo[ObjectSeekCount] = dataiter->second;
953                                 
954                         } else if (dataiter->first == "DELEGATED-FROM"){
955                                 
956                                 AttendeeListDelegatedFrom[ObjectSeekCount] = dataiter->second;
957                                 
958                         } else if (dataiter->first == "SENT-BY"){
959                                 
960                                 AttendeeListSentBy[ObjectSeekCount] = dataiter->second;
961                                 
962                         } else if (dataiter->first == "CN"){
963                                 
964                                 AttendeeListCommonName[ObjectSeekCount] = dataiter->second;
965                                 
966                         } else if (dataiter->first == "DIR"){
967                                 
968                                 AttendeeListDirectoryEntry[ObjectSeekCount] = dataiter->second;
969                                 
970                         } else if (dataiter->first == "LANGUAGE"){
971                                 
972                                 AttendeeListLanguage[ObjectSeekCount] = dataiter->second;
973                                 
974                         } else {
975                                 
976                                 if (TokenData == false){
977                                         TokenData = true;
978                                 } else {
979                                         PropertyTokens += ";";
980                                 }
981                                 
982                                 PropertyTokens += dataiter->first;
983                                 PropertyTokens += "=";
984                                 PropertyTokens += dataiter->second;
985                                 
986                         }
987                                 
988                 }
989                 
990                 if (PropertyTokens.size() > 0){
991                         AttendeeListTokens[ObjectSeekCount] = PropertyTokens;
992                 }
993                         
994                 AttendeeList[ObjectSeekCount] = iter->second;
995                 
996                 ObjectSeekCount++;
997                 
998         }
1000         // Process the data from CATEGORIES.
1001         
1002         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CATEGORIES");
1003         
1004         ObjectSeekCount = 0;
1005         
1006         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1007                 iter != DataReceived.end(); 
1008                 ++iter){
1009                 
1010                 CategoriesListTokens.push_back("");
1011                 CategoriesListLanguage.push_back("");
1012                 CategoriesList.push_back("");
1013                         
1014                 bool TokenData = false;
1015                 string PropertyTokens;
1016                 
1017                 PropertyNameData = (string*)&iter->first;
1018                 
1019                 PropertyData = SplitValues(*PropertyNameData);
1020                         
1021                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1022                         dataiter != PropertyData.end(); dataiter++){
1023                         
1024                         if (dataiter->first == "LANGUAGE"){
1025                                 
1026                                 CategoriesListLanguage[ObjectSeekCount] = dataiter->second;
1027                                 
1028                         } else {
1029                                 
1030                                 if (TokenData == false){
1031                                         TokenData = true;
1032                                 } else {
1033                                         PropertyTokens += ";";
1034                                 }
1035                                 
1036                                 PropertyTokens += dataiter->first;
1037                                 PropertyTokens += "=";
1038                                 PropertyTokens += dataiter->second;
1039                                 
1040                         }
1041                                 
1042                 }
1043                 
1044                 if (PropertyTokens.size() > 0){
1045                         CategoriesListTokens[ObjectSeekCount] = PropertyTokens;
1046                 }
1047                         
1048                 CategoriesList[ObjectSeekCount] = iter->second;
1049                 
1050                 ObjectSeekCount++;
1051                 
1052         }
1053         
1054         // Process the data from COMMENT.
1055         
1056         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "COMMENT");
1058         ObjectSeekCount = 0;
1059         
1060         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1061                 iter != DataReceived.end(); 
1062                 ++iter){
1063                 
1064                 CommentListTokens.push_back("");
1065                 CommentListAltRep.push_back("");
1066                 CommentListLanguage.push_back("");
1067                 CommentList.push_back("");
1068                         
1069                 bool TokenData = false;
1070                 string PropertyTokens;
1071                 
1072                 PropertyNameData = (string*)&iter->first;
1073                 
1074                 PropertyData = SplitValues(*PropertyNameData);
1075                         
1076                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1077                         dataiter != PropertyData.end(); dataiter++){
1078                         
1079                         if (dataiter->first == "ALTREP"){
1080                                 
1081                                 CommentListAltRep[ObjectSeekCount] = dataiter->second;
1082                                 
1083                         } else if (dataiter->first == "LANGUAGE"){
1084                                 
1085                                 CommentListLanguage[ObjectSeekCount] = dataiter->second;
1086                                 
1087                         } else {
1088                                 
1089                                 if (TokenData == false){
1090                                         TokenData = true;
1091                                 } else {
1092                                         PropertyTokens += ";";
1093                                 }
1094                                 
1095                                 PropertyTokens += dataiter->first;
1096                                 PropertyTokens += "=";
1097                                 PropertyTokens += dataiter->second;
1098                                 
1099                         }
1100                                 
1101                 }
1102                 
1103                 if (PropertyTokens.size() > 0){
1104                         CommentListTokens[ObjectSeekCount] = PropertyTokens;
1105                 }
1106                         
1107                 CommentList[ObjectSeekCount] = iter->second;
1108                 
1109                 ObjectSeekCount++;
1110                 
1111         }
1112         
1113         // Process the data from CONTACT.
1114         
1115         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CONTACT");
1117         ObjectSeekCount = 0;
1118         
1119         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1120                 iter != DataReceived.end(); 
1121                 ++iter){
1122                 
1123                 ContactListTokens.push_back("");
1124                 ContactListAltRep.push_back("");
1125                 ContactListLanguage.push_back("");
1126                 ContactList.push_back("");
1127                         
1128                 bool TokenData = false;
1129                 string PropertyTokens;
1130                 
1131                 PropertyNameData = (string*)&iter->first;
1132                 
1133                 PropertyData = SplitValues(*PropertyNameData);
1134                         
1135                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1136                         dataiter != PropertyData.end(); dataiter++){
1137                         
1138                         if (dataiter->first == "ALTREP"){
1139                                 
1140                                 ContactListAltRep[ObjectSeekCount] = dataiter->second;
1141                                 
1142                         } else if (dataiter->first == "LANGUAGE"){
1143                                 
1144                                 ContactListLanguage[ObjectSeekCount] = dataiter->second;
1145                                 
1146                         } else {
1147                                 
1148                                 if (TokenData == false){
1149                                         TokenData = true;
1150                                 } else {
1151                                         PropertyTokens += ";";
1152                                 }
1153                                 
1154                                 PropertyTokens += dataiter->first;
1155                                 PropertyTokens += "=";
1156                                 PropertyTokens += dataiter->second;
1157                                 
1158                         }
1159                                 
1160                 }
1161                 
1162                 if (PropertyTokens.size() > 0){
1163                         ContactListTokens[ObjectSeekCount] = PropertyTokens;
1164                 }
1165                         
1166                 ContactList[ObjectSeekCount] = iter->second;
1167                 
1168                 ObjectSeekCount++;
1169                 
1170         }
1171         
1172         // Process the data from EXDATE.
1173         
1174         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "EXDATE");
1176         ObjectSeekCount = 0;
1177         
1178         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1179                 iter != DataReceived.end(); 
1180                 ++iter){
1181                 
1182                 ExcludeDateDataTokens.push_back("");
1183                 ExcludeDateDataValue.push_back("");
1184                 ExcludeDateDataTimeZoneParam.push_back("");
1185                 ExcludeDateData.push_back("");
1186                         
1187                 bool TokenData = false;
1188                 string PropertyTokens;
1189                 
1190                 PropertyNameData = (string*)&iter->first;
1191                 
1192                 PropertyData = SplitValues(*PropertyNameData);
1193                         
1194                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1195                         dataiter != PropertyData.end(); dataiter++){
1196                         
1197                         if (dataiter->first == "VALUE"){
1198                                 
1199                                 ExcludeDateDataValue[ObjectSeekCount] = dataiter->second;
1200                                 
1201                         } else if (dataiter->first == "TZID"){
1202                                 
1203                                 ExcludeDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
1204                                 
1205                         } else {
1206                                 
1207                                 if (TokenData == false){
1208                                         TokenData = true;
1209                                 } else {
1210                                         PropertyTokens += ";";
1211                                 }
1212                                 
1213                                 PropertyTokens += dataiter->first;
1214                                 PropertyTokens += "=";
1215                                 PropertyTokens += dataiter->second;
1216                                 
1217                         }
1218                                 
1219                 }
1220                 
1221                 if (PropertyTokens.size() > 0){
1222                         ExcludeDateDataTokens[ObjectSeekCount] = PropertyTokens;
1223                 }
1224                         
1225                 ExcludeDateData[ObjectSeekCount] = iter->second;
1226                 
1227                 ObjectSeekCount++;
1228                 
1229         }
1230         
1231         // Process the data from REQUEST-STATUS.
1232         
1233         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "REQUEST-STATUS");
1235         ObjectSeekCount = 0;
1236         
1237         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1238                 iter != DataReceived.end(); 
1239                 ++iter){
1240                 
1241                 RequestStatusTokens.push_back("");
1242                 RequestStatusLanguage.push_back("");
1243                 RequestStatusData.push_back("");
1244                         
1245                 bool TokenData = false;
1246                 string PropertyTokens;
1247                 
1248                 PropertyNameData = (string*)&iter->first;
1249                 
1250                 PropertyData = SplitValues(*PropertyNameData);
1251                         
1252                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1253                         dataiter != PropertyData.end(); dataiter++){
1254                         
1255                         if (dataiter->first == "LANGUAGE"){
1256                                 
1257                                 RequestStatusLanguage[ObjectSeekCount] = dataiter->second;
1258                                 
1259                         } else {
1260                                 
1261                                 if (TokenData == false){
1262                                         TokenData = true;
1263                                 } else {
1264                                         PropertyTokens += ";";
1265                                 }
1266                                 
1267                                 PropertyTokens += dataiter->first;
1268                                 PropertyTokens += "=";
1269                                 PropertyTokens += dataiter->second;
1270                                 
1271                         }
1272                                 
1273                 }
1274                 
1275                 if (PropertyTokens.size() > 0){
1276                         RequestStatusTokens[ObjectSeekCount] = PropertyTokens;
1277                 }
1278                         
1279                 RequestStatusData[ObjectSeekCount] = iter->second;
1280                 
1281                 ObjectSeekCount++;
1282                 
1283         }
1284         
1285         // Process the data from RELATED-TO.
1286         
1287         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RELATED-TO");
1289         ObjectSeekCount = 0;
1290         
1291         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1292                 iter != DataReceived.end(); 
1293                 ++iter){
1294                 
1295                 RelatedToDataTokens.push_back("");
1296                 RelatedToDataRelationType.push_back("");
1297                 RelatedToData.push_back("");
1298                         
1299                 bool TokenData = false;
1300                 string PropertyTokens;
1301                 
1302                 PropertyNameData = (string*)&iter->first;
1303                 
1304                 PropertyData = SplitValues(*PropertyNameData);
1305                         
1306                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1307                         dataiter != PropertyData.end(); dataiter++){
1308                         
1309                         if (dataiter->first == "RELTYPE"){
1310                                 
1311                                 RelatedToDataRelationType[ObjectSeekCount] = dataiter->second;
1312                                 
1313                         } else {
1314                                 
1315                                 if (TokenData == false){
1316                                         TokenData = true;
1317                                 } else {
1318                                         PropertyTokens += ";";
1319                                 }
1320                                 
1321                                 PropertyTokens += dataiter->first;
1322                                 PropertyTokens += "=";
1323                                 PropertyTokens += dataiter->second;
1324                                 
1325                         }
1326                                 
1327                 }
1328                 
1329                 if (PropertyTokens.size() > 0){
1330                         RelatedToDataTokens[ObjectSeekCount] = PropertyTokens;
1331                 }
1332                         
1333                 RelatedToData[ObjectSeekCount] = iter->second;
1334                 
1335                 ObjectSeekCount++;
1336                 
1337         }
1339         // Process the data from RESOURCES.
1340         
1341         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RESOURCES");
1343         ObjectSeekCount = 0;
1344         
1345         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1346                 iter != DataReceived.end(); 
1347                 ++iter){
1348                 
1349                 ResourcesDataTokens.push_back("");
1350                 ResourcesDataAltRep.push_back("");
1351                 ResourcesDataLanguage.push_back("");
1352                 ResourcesData.push_back("");
1353                         
1354                 bool TokenData = false;
1355                 string PropertyTokens;
1356                 
1357                 PropertyNameData = (string*)&iter->first;
1358                 
1359                 PropertyData = SplitValues(*PropertyNameData);
1360                         
1361                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1362                         dataiter != PropertyData.end(); dataiter++){
1363                         
1364                         if (dataiter->first == "ALTREP"){
1365                                 
1366                                 ResourcesDataAltRep[ObjectSeekCount] = dataiter->second;
1367                                 
1368                         } else if (dataiter->first == "LANGUAGE"){
1369                                 
1370                                 ResourcesDataLanguage[ObjectSeekCount] = dataiter->second;
1371                                 
1372                         } else {
1373                                 
1374                                 if (TokenData == false){
1375                                         TokenData = true;
1376                                 } else {
1377                                         PropertyTokens += ";";
1378                                 }
1379                                 
1380                                 PropertyTokens += dataiter->first;
1381                                 PropertyTokens += "=";
1382                                 PropertyTokens += dataiter->second;
1383                                 
1384                         }
1385                                 
1386                 }
1387                 
1388                 if (PropertyTokens.size() > 0){
1389                         ResourcesDataTokens[ObjectSeekCount] = PropertyTokens;
1390                 }
1391                         
1392                 ResourcesData[ObjectSeekCount] = iter->second;
1393                 
1394                 ObjectSeekCount++;
1395                 
1396         }
1397         
1398         // Process the data from RDATE.
1399         
1400         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RDATE");
1402         ObjectSeekCount = 0;
1403         
1404         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1405                 iter != DataReceived.end(); 
1406                 ++iter){
1407                 
1408                 RecurranceDateDataTokens.push_back("");
1409                 RecurranceDateDataValue.push_back("");
1410                 RecurranceDateDataTimeZoneParam.push_back("");
1411                 RecurranceDateData.push_back("");
1412                         
1413                 bool TokenData = false;
1414                 string PropertyTokens;
1415                 
1416                 PropertyNameData = (string*)&iter->first;
1417                 
1418                 PropertyData = SplitValues(*PropertyNameData);
1419                         
1420                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1421                         dataiter != PropertyData.end(); dataiter++){
1422                         
1423                         if (dataiter->first == "VALUE"){
1424                                 
1425                                 RecurranceDateDataValue[ObjectSeekCount] = dataiter->second;
1426                                 
1427                         } else if (dataiter->first == "TZID"){
1428                                 
1429                                 RecurranceDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
1430                                 
1431                         } else {
1432                                 
1433                                 if (TokenData == false){
1434                                         TokenData = true;
1435                                 } else {
1436                                         PropertyTokens += ";";
1437                                 }
1438                                 
1439                                 PropertyTokens += dataiter->first;
1440                                 PropertyTokens += "=";
1441                                 PropertyTokens += dataiter->second;
1442                                 
1443                         }
1444                                 
1445                 }
1446                 
1447                 if (PropertyTokens.size() > 0){
1448                         RecurranceDateDataTokens[ObjectSeekCount] = PropertyTokens;
1449                 }
1450                         
1451                 RecurranceDateData[ObjectSeekCount] = iter->second;
1452                 
1453                 ObjectSeekCount++;
1454                 
1455         }
1456         
1457         // Process VALARM section.
1458         
1459         int SeekCount = 0;
1460         int AlarmObjectCount = 0;
1461         
1462         bool AlarmActionFound = false;
1463         
1464         for (vector<vector<string>>::iterator iter = EventAlarmName.begin();
1465                 iter != EventAlarmName.end(); iter++){
1466                         
1467                 CalendarAlarmDataStruct NewAlarmData;
1468                         
1469                 // Process the data from ACTION.
1470         
1471                 bool AlarmActionFound = false;
1472                 bool AlarmTriggerFound = false;
1473                 bool AlarmDurationFound = false;
1474                 bool AlarmDescriptionFound = false;
1475                 bool AlarmSummaryFound = false;
1476                         
1477                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], 
1478                                 &EventAlarmData[SeekCount], false, "ACTION");
1479         
1480                 if (DataReceived.begin() != DataReceived.end()){
1481         
1482                         try {
1483                                 NewAlarmData.AlarmActionTokens = DataReceived.begin()->first.substr(7);
1484                         }
1485                 
1486                         catch(const out_of_range &oor){
1487                                 // Do nothing as there is no data.
1488                         }
1489                 
1490                         NewAlarmData.AlarmAction = DataReceived.begin()->second;
1491                         AlarmActionFound = true;
1492                 
1493                 }
1494                 
1495                 // Check if a value was set for AlarmAction, otherwise
1496                 // process the next VALARM section.
1497                 
1498                 if (NewAlarmData.AlarmAction.size() < 1){
1499                         
1500                         SeekCount++;
1501                         continue;
1502                         
1503                 }
1504                 
1505                 // Check if AlarmAction is DISPLAY, AUDIO or EMAIL.
1506                 // Process the next VALARM section if not.
1507                 
1508                 if (NewAlarmData.AlarmAction == "AUDIO"){
1509                         
1510                         NewAlarmData.AlarmType = CALENDARALARM_AUDIO;
1511                         
1512                 } else if (NewAlarmData.AlarmAction == "DISPLAY"){
1513                         
1514                         NewAlarmData.AlarmType = CALENDARALARM_DISPLAY;
1515                         
1516                 } else if (NewAlarmData.AlarmAction == "EMAIL"){
1517                         
1518                         NewAlarmData.AlarmType = CALENDARALARM_EMAIL;
1519                         
1520                 } else {
1521                 
1522                         SeekCount++;
1523                         continue;
1524                         
1525                 }
1526                 
1527                 // Process the data from TRIGGER.
1528                 
1529                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "TRIGGER");
1530         
1531                 if (DataReceived.begin() != DataReceived.end()){
1532         
1533                         bool TokenData = false;
1534                         string PropertyTokens;
1535                 
1536                         PropertyNameData = (string*)&DataReceived.begin()->first;
1537                 
1538                         PropertyData = SplitValues(*PropertyNameData);
1539                 
1540                         for(map<string,string>::iterator iter = PropertyData.begin();
1541                                 iter != PropertyData.end(); iter++){
1542                         
1543                                 if (iter->first == "VALUE"){
1544                                 
1545                                         NewAlarmData.TriggerValue = iter->second;
1546                                 
1547                                 } else if (iter->first == "RELATED"){
1548                                 
1549                                         NewAlarmData.TriggerRelated = iter->second;
1550                                 
1551                                 } else {
1552                                 
1553                                         if (TokenData == false){
1554                                                 TokenData = true;
1555                                         } else {
1556                                                 PropertyTokens += ";";
1557                                         }
1558                                 
1559                                         PropertyTokens += iter->first;
1560                                         PropertyTokens += "=";
1561                                         PropertyTokens += iter->second;
1562                                 
1563                                 }
1564                                 
1565                         }
1566                 
1567                         if (PropertyTokens.size() > 0){
1568                                 NewAlarmData.TriggerTokens = PropertyTokens;
1569                         }
1570                 
1571                         NewAlarmData.TriggerData = DataReceived.begin()->second;
1572                         AlarmTriggerFound = true;
1573                 
1574                 }
1575                 
1576                 // Process the data from DESCRIPTION.
1577                 
1578                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "DESCRIPTION");
1579         
1580                 if (DataReceived.begin() != DataReceived.end() &&
1581                         (NewAlarmData.AlarmType == CALENDARALARM_DISPLAY ||
1582                         NewAlarmData.AlarmType == CALENDARALARM_EMAIL)){
1583         
1584                         bool TokenData = false;
1585                         string PropertyTokens;
1586                 
1587                         PropertyNameData = (string*)&DataReceived.begin()->first;
1588                 
1589                         PropertyData = SplitValues(*PropertyNameData);
1590                 
1591                         for(map<string,string>::iterator iter = PropertyData.begin();
1592                                 iter != PropertyData.end(); iter++){
1593                         
1594                                 if (iter->first == "ALTREP"){
1595                                 
1596                                         NewAlarmData.DescriptionAltRep = iter->second;
1597                                 
1598                                 } else if (iter->first == "LANGUAGE"){
1599                                 
1600                                         NewAlarmData.DescriptionLanguage = iter->second;
1601                                 
1602                                 } else {
1603                                 
1604                                         if (TokenData == false){
1605                                                 TokenData = true;
1606                                         } else {
1607                                                 PropertyTokens += ";";
1608                                         }
1609                                 
1610                                         PropertyTokens += iter->first;
1611                                         PropertyTokens += "=";
1612                                         PropertyTokens += iter->second;
1613                                 
1614                                 }
1615                                 
1616                         }
1617                 
1618                         if (PropertyTokens.size() > 0){
1619                                 NewAlarmData.DescriptionTokens = PropertyTokens;
1620                         }
1621                 
1622                         NewAlarmData.DescriptionData = DataReceived.begin()->second;
1623                         AlarmDescriptionFound = true;
1624                 
1625                 }
1626                 
1627                 // Process data from SUMMARY.
1628                 
1629                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "SUMMARY");
1630         
1631                 if (DataReceived.begin() != DataReceived.end() &&
1632                         NewAlarmData.AlarmType == CALENDARALARM_EMAIL){
1633         
1634                         bool TokenData = false;
1635                         string PropertyTokens;
1636                 
1637                         PropertyNameData = (string*)&DataReceived.begin()->first;
1638                 
1639                         PropertyData = SplitValues(*PropertyNameData);
1640                 
1641                         for(map<string,string>::iterator iter = PropertyData.begin();
1642                                 iter != PropertyData.end(); iter++){
1643                         
1644                                 if (iter->first == "ALTREP"){
1645                                 
1646                                         NewAlarmData.SummaryAltRep = iter->second;
1647                                 
1648                                 } else if (iter->first == "LANGUAGE"){
1649                                 
1650                                         NewAlarmData.SummaryLanguage = iter->second;
1651                                 
1652                                 } else {
1653                                 
1654                                         if (TokenData == false){
1655                                                 TokenData = true;
1656                                         } else {
1657                                                 PropertyTokens += ";";
1658                                         }
1659                                 
1660                                         PropertyTokens += iter->first;
1661                                         PropertyTokens += "=";
1662                                         PropertyTokens += iter->second;
1663                                 
1664                                 }
1665                                 
1666                         }
1667                 
1668                         if (PropertyTokens.size() > 0){
1669                                 NewAlarmData.SummaryTokens = PropertyTokens;
1670                         }
1671                 
1672                         NewAlarmData.SummaryData = DataReceived.begin()->second;
1673                         AlarmSummaryFound = true;
1674                 
1675                 }
1676                 
1677                 // Process data from DURATION.
1678                 
1679                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "DURATION");
1680                 
1681                 if (DataReceived.begin() != DataReceived.end()){
1682         
1683                         try {
1684                                 NewAlarmData.DurationTokens = DataReceived.begin()->first.substr(9);
1685                         }
1686                 
1687                         catch(const out_of_range &oor){
1688                                 // Do nothing as there is no data.
1689                         }               
1690                 
1691                         NewAlarmData.DurationData = DataReceived.begin()->second;
1692                         AlarmDurationFound = true;
1693                 
1694                 }
1695                 
1696                 // Process data from REPEAT.
1697                 
1698                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "REPEAT");
1699                 
1700                 if (DataReceived.begin() != DataReceived.end() && AlarmDurationFound == true){
1701         
1702                         try {
1703                                 NewAlarmData.RepeatTokens = DataReceived.begin()->first.substr(7);
1704                         }
1705                 
1706                         catch(const out_of_range &oor){
1707                                 // Do nothing as there is no data.
1708                         }               
1709                 
1710                         NewAlarmData.RepeatData = DataReceived.begin()->second;
1711                 
1712                 } else {
1713                         
1714                         NewAlarmData.DurationData.clear();
1715                         NewAlarmData.DurationTokens.clear();
1716                         
1717                 }
1718                 
1719                 // Process data from ATTENDEE.
1720                 
1721                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], true, "ATTENDEE");
1722         
1723                 ObjectSeekCount = 0;
1724         
1725                 for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1726                         iter != DataReceived.end(); 
1727                         ++iter){
1728                         
1729                         NewAlarmData.AttendeeListMember.push_back("");
1730                         NewAlarmData.AttendeeListDelegatedFrom.push_back("");
1731                         NewAlarmData.AttendeeListDelegatedTo.push_back("");
1732                         NewAlarmData.AttendeeListRole.push_back("");
1733                         NewAlarmData.AttendeeListRSVP.push_back("");
1734                         NewAlarmData.AttendeeListDirectoryEntry.push_back("");
1735                         NewAlarmData.AttendeeListSentBy.push_back("");
1736                         NewAlarmData.AttendeeListCommonName.push_back("");
1737                         NewAlarmData.AttendeeListCalendarUserType.push_back("");
1738                         NewAlarmData.AttendeeListParticipationStatus.push_back("");
1739                         NewAlarmData.AttendeeListLanguage.push_back("");
1740                         NewAlarmData.AttendeeListTokens.push_back("");
1741                         NewAlarmData.AttendeeList.push_back("");
1742                         
1743                         bool TokenData = false;
1744                         string PropertyTokens;
1745                 
1746                         PropertyNameData = (string*)&iter->first;
1747                 
1748                         PropertyData = SplitValues(*PropertyNameData);
1749                         
1750                         for(map<string,string>::iterator dataiter = PropertyData.begin();
1751                                 dataiter != PropertyData.end(); dataiter++){
1752                         
1753                                 if (dataiter->first == "CUTYPE"){
1754                                 
1755                                         NewAlarmData.AttendeeListCalendarUserType[ObjectSeekCount] = dataiter->second;
1756                                 
1757                                 } else if (dataiter->first == "MEMBER"){
1758                                 
1759                                         NewAlarmData.AttendeeListMember[ObjectSeekCount] = dataiter->second;
1760                                 
1761                                 } else if (dataiter->first == "ROLE"){
1762                                 
1763                                         NewAlarmData.AttendeeListRole[ObjectSeekCount] = dataiter->second;
1764                                 
1765                                 } else if (dataiter->first == "PARTSTAT"){
1766                                 
1767                                         NewAlarmData.AttendeeListParticipationStatus[ObjectSeekCount] = dataiter->second;
1768                                 
1769                                 } else if (dataiter->first == "RSVP"){
1770                                 
1771                                         NewAlarmData.AttendeeListRSVP[ObjectSeekCount] = dataiter->second;
1772                                 
1773                                 } else if (dataiter->first == "DELEGATED-TO"){
1774                                 
1775                                         NewAlarmData.AttendeeListDelegatedTo[ObjectSeekCount] = dataiter->second;
1776                                 
1777                                 } else if (dataiter->first == "DELEGATED-FROM"){
1778                                 
1779                                         NewAlarmData.AttendeeListDelegatedFrom[ObjectSeekCount] = dataiter->second;
1780                                 
1781                                 } else if (dataiter->first == "SENT-BY"){
1782                                 
1783                                         NewAlarmData.AttendeeListSentBy[ObjectSeekCount] = dataiter->second;
1784                                 
1785                                 } else if (dataiter->first == "CN"){
1786                                 
1787                                         NewAlarmData.AttendeeListCommonName[ObjectSeekCount] = dataiter->second;
1788                                 
1789                                 } else if (dataiter->first == "DIR"){
1790                                 
1791                                         NewAlarmData.AttendeeListDirectoryEntry[ObjectSeekCount] = dataiter->second;
1792                                 
1793                                 } else if (dataiter->first == "LANGUAGE"){
1794                                 
1795                                         NewAlarmData.AttendeeListLanguage[ObjectSeekCount] = dataiter->second;
1796                                 
1797                                 } else {
1798                                 
1799                                         if (TokenData == false){
1800                                                 TokenData = true;
1801                                         } else {
1802                                                 PropertyTokens += ";";
1803                                         }
1804                                 
1805                                         PropertyTokens += dataiter->first;
1806                                         PropertyTokens += "=";
1807                                         PropertyTokens += dataiter->second;
1808                                 
1809                                 }
1810                                 
1811                         }
1812                 
1813                         if (PropertyTokens.size() > 0){
1814                                 NewAlarmData.AttendeeListTokens[ObjectSeekCount] = PropertyTokens;
1815                         }
1816                         
1817                         NewAlarmData.AttendeeList[ObjectSeekCount] = iter->second;
1818                 
1819                         ObjectSeekCount++;
1820                 
1821                 }
1822                 
1823                 // Process data from ATTACH.
1824                 
1825                 DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], true, "ATTACH");
1826         
1827                 ObjectSeekCount = 0;
1828                 
1829                 for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1830                         iter != DataReceived.end();
1831                         ++iter){
1832                 
1833                         NewAlarmData.AttachListEncoding.push_back("");
1834                         NewAlarmData.AttachListValue.push_back("");
1835                         NewAlarmData.AttachListFormatType.push_back("");
1836                         NewAlarmData.AttachListTokens.push_back("");
1837                         NewAlarmData.AttachList.push_back("");
1838                         
1839                         bool TokenData = false;
1840                         string PropertyTokens;
1841                 
1842                         PropertyNameData = (string*)&iter->first;
1843                 
1844                         PropertyData = SplitValues(*PropertyNameData);
1845                         
1846                         for(map<string,string>::iterator dataiter = PropertyData.begin();
1847                                 dataiter != PropertyData.end(); dataiter++){
1848                         
1849                                 if (dataiter->first == "ENCODING"){
1850                                 
1851                                         NewAlarmData.AttachListEncoding[ObjectSeekCount] = dataiter->second;
1852                                 
1853                                 } else if (dataiter->first == "VALUE"){
1854                                 
1855                                         NewAlarmData.AttachListValue[ObjectSeekCount] = dataiter->second;
1856                                 
1857                                 } else if (dataiter->first == "FMTTYPE"){
1858                                 
1859                                         NewAlarmData.AttachListFormatType[ObjectSeekCount] = dataiter->second;
1860                                 
1861                                 } else {
1862                                 
1863                                         if (TokenData == false){
1864                                                 TokenData = true;
1865                                         } else {
1866                                                 PropertyTokens += ";";
1867                                         }
1868                                 
1869                                         PropertyTokens += dataiter->first;
1870                                         PropertyTokens += "=";
1871                                         PropertyTokens += dataiter->second;
1872                                 
1873                                 }
1874                                 
1875                         }
1876                 
1877                         if (PropertyTokens.size() > 0){
1878                                 NewAlarmData.AttachListTokens[ObjectSeekCount] = PropertyTokens;
1879                         }
1880                         
1881                         NewAlarmData.AttachList[ObjectSeekCount] = iter->second;
1882                 
1883                         ObjectSeekCount++;
1884                 
1885                 }
1886                 
1887                 // Process data from X-*
1888                 
1889                 AlarmObjectCount = 0;
1890                 
1891                 for(vector<string>::iterator xtokeniter = EventAlarmName[SeekCount].begin(); 
1892                         xtokeniter != EventAlarmName[SeekCount].end(); ++xtokeniter){
1893                         
1894                         bool TokenData = false;
1895                         string PropertyTokens;
1896                 
1897                         if (xtokeniter->substr(0,2) == "X-" &&
1898                                 xtokeniter->size() > 2){
1899                         
1900                                 NewAlarmData.XTokensData.push_back(EventAlarmData[SeekCount][AlarmObjectCount]);
1901                                 NewAlarmData.XTokensDataTokens.push_back(EventAlarmName[SeekCount][AlarmObjectCount]);
1902                                 
1903                         }
1904                 
1905                         AlarmObjectCount++;
1906                 
1907                 }
1908                 
1909                 if (NewAlarmData.AlarmType == CALENDARALARM_AUDIO &&
1910                         AlarmActionFound == true &&
1911                         AlarmTriggerFound == true){
1912                 
1913                         CalendarAlarmData.push_back(NewAlarmData);
1914                         
1915                 } else if (NewAlarmData.AlarmType == CALENDARALARM_DISPLAY &&
1916                         AlarmActionFound == true &&
1917                         AlarmTriggerFound == true &&
1918                         AlarmDescriptionFound == true){
1920                         CalendarAlarmData.push_back(NewAlarmData);
1921                                 
1922                 } else if (NewAlarmData.AlarmType == CALENDARALARM_EMAIL &&
1923                         AlarmActionFound == true &&
1924                         AlarmTriggerFound == true &&
1925                         AlarmDescriptionFound == true &&
1926                         AlarmSummaryFound == true){
1927                 
1928                         CalendarAlarmData.push_back(NewAlarmData);
1929                                 
1930                 }
1931                         
1932                 SeekCount++;
1933                         
1934         }
1935         
1936         ObjectSeekCount = 0;
1937         
1938         // Process data from X-*
1939         
1940         for(vector<string>::iterator iter = ObjectName.begin(); 
1941                 iter != ObjectName.end(); ++iter){
1942                         
1943                 bool TokenData = false;
1944                 string PropertyTokens;
1945                 
1946                 if (iter->substr(0,2) == "X-" &&
1947                         iter->size() > 2){
1948                         
1949                         XTokensData.push_back(ObjectData[ObjectSeekCount]);
1950                         XTokensDataTokens.push_back(ObjectName[ObjectSeekCount]);
1951                                 
1952                 }
1953                 
1954                 ObjectSeekCount++;
1955                 
1956         }
1957         
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