Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replaced unit tests for LOCATION with ORGANIZER for ContactJournalObject.
[xestiacalendar/.git] / source / objects / calendartask / CalendarTask.cpp
1 #include "CalendarTask.h"
3 using namespace std;
5 CalendarObjectValidResult CalendarTaskObject::ValidObject(){
7         bool ValidBegin = false;
8         bool ValidEnd = false;
9         bool ValidDateTimeStamp = false;
10         bool ValidUniqueID = false;
11         int SeekCount = 0;
12         string PropertyName;
13         
14         // Look for BEGIN:VTODO.
15         
16         for (vector<string>::iterator iter = ObjectName.begin();
17                 iter != ObjectName.end(); iter++){
18         
19                 if (ObjectName[SeekCount] == "BEGIN" &&
20                         ObjectData[SeekCount] == "VTODO"){
21                         
22                         if (ValidBegin == false){
23                                 ValidBegin = true;
24                         } else {
25                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
26                         }
27                                 
28                 }
29                 
30                 if (ObjectName[SeekCount] == "END" &&
31                         ObjectData[SeekCount] == "VTODO" &&
32                         ValidBegin == false){
33                 
34                         return CALENDAROBJECTVALID_INVALIDFORMAT;
35                                 
36                 }
37                 
38                 SeekCount++;
39                         
40         }
41         
42         SeekCount = 0;
43         
44         // Look for DTSTAMP.
45         
46         for (vector<string>::iterator iter = ObjectName.begin();
47                 iter != ObjectName.end(); iter++){
48                         
49                 try{
50                         PropertyName = ObjectName[SeekCount].substr(0,7);
51                 }
52                         
53                 catch(const out_of_range& oor){
54                         continue;
55                 }
56                 
57                 if (PropertyName == "DTSTAMP"){
58                         
59                         if (ValidDateTimeStamp == false){
60                                 ValidDateTimeStamp = true;
61                         } else {
62                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
63                         }
64                                 
65                 }
66                         
67                 SeekCount++;
69         }
70         
71         SeekCount = 0;
72         
73         // Look for UID.
74         
75         for (vector<string>::iterator iter = ObjectName.begin();
76                 iter != ObjectName.end(); iter++){
77         
78                 try{
79                         PropertyName = ObjectName[SeekCount].substr(0,3);
80                 }
81                 
82                 catch(const out_of_range& oor){
83                         continue;
84                 }
85                         
86                 if (PropertyName == "UID"){
87                         
88                         if (ValidUniqueID == false){
89                                 ValidUniqueID = true;
90                         } else {
91                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
92                         }
93                                 
94                 }
95                         
96                 SeekCount++;
97                         
98         }
99         
100         SeekCount = 0;
101                 
102         // Look for END:VTODO.
103         
104         for (vector<string>::iterator iter = ObjectName.begin();
105                 iter != ObjectName.end(); iter++){
106         
107                 if (ObjectName[SeekCount] == "END" &&
108                         ObjectData[SeekCount] == "VTODO"){
109                         
110                         if (ValidEnd == false){
111                                 ValidEnd = true;
112                         } else {
113                                 return CALENDAROBJECTVALID_INVALIDFORMAT;
114                         }
115                                 
116                 }
117                         
118                 SeekCount++;
119                         
120         }
121         
122         // Check if the VTODO is valid.
123         
124         if (ValidBegin == true && 
125                 ValidEnd == true && 
126                 ValidDateTimeStamp == true &&
127                 ValidUniqueID == true){
128                         
129                 return CALENDAROBJECTVALID_OK;
130                         
131         } else {
132                 
133                 return CALENDAROBJECTVALID_INVALIDFORMAT;
134                 
135         }
136         
139 void CalendarTaskObject::ProcessData(){
141         // Process the data.
142         
143         multimap<string,string> DataReceived;
144         map<string,string> PropertyData;
145         string *PropertyNameData = nullptr;
146         int ObjectSeekCount = 0;
147         
148         // Get the Date Time Stamp (DTSTAMP).
149         
150         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTAMP");
151         
152         // Process the data from DTSTAMP.
153         
154         if (DataReceived.begin() != DataReceived.end()){
155         
156                 try {
157                         DateTimeStampTokens = DataReceived.begin()->first.substr(8);
158                 }
159                 
160                 catch(const out_of_range &oor){
161                         // Do nothing as there is no data.
162                 }               
163                 
164                 DateTimeStampData = DataReceived.begin()->second;
165                 
166         }
167         
168         // Get the Unique ID (UID).
169         
170         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "UID");
171         
172         // Process the data from UID.
173         
174         if (DataReceived.begin() != DataReceived.end()){
175         
176                 try {
177                         UniqueIDTokens = DataReceived.begin()->first.substr(4);
178                 }
179                 
180                 catch(const out_of_range &oor){
181                         // Do nothing as there is no data.
182                 }               
183                 
184                 UniqueID = DataReceived.begin()->second;
185                 
186         }
187         
188         // Process the data from CLASS.
189         
190         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CLASS");
191         
192         if (DataReceived.begin() != DataReceived.end()){
193         
194                 try {
195                         ClassDataTokens = DataReceived.begin()->first.substr(6);
196                 }
197                 
198                 catch(const out_of_range &oor){
199                         // Do nothing as there is no data.
200                 }               
201                 
202                 ClassData = DataReceived.begin()->second;
203                 
204         }
205         
206         // Process the data from COMPLETED.
207         
208         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "COMPLETED");
209         
210         if (DataReceived.begin() != DataReceived.end()){
211         
212                 try {
213                         CompletedDataTokens = DataReceived.begin()->first.substr(10);
214                 }
215                 
216                 catch(const out_of_range &oor){
217                         // Do nothing as there is no data.
218                 }               
219                 
220                 CompletedData = DataReceived.begin()->second;
221                 
222         }
223         
224         // Process the data from CREATED.
225         
226         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "CREATED");
227         
228         if (DataReceived.begin() != DataReceived.end()){
229         
230                 try {
231                         DateTimeCreatedTokens = DataReceived.begin()->first.substr(8);
232                 }
233                 
234                 catch(const out_of_range &oor){
235                         // Do nothing as there is no data.
236                 }               
237                 
238                 DateTimeCreatedData = DataReceived.begin()->second;
239                 
240         }
241         
242         // Process the data from DESCRIPTION.
243         
244         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DESCRIPTION");
245         
246         if (DataReceived.begin() != DataReceived.end()){
247         
248                 bool TokenData = false;
249                 string PropertyTokens;
250                 
251                 PropertyNameData = (string*)&DataReceived.begin()->first;
252                 
253                 PropertyData = SplitValues(*PropertyNameData);
254                 
255                 for(map<string,string>::iterator iter = PropertyData.begin();
256                         iter != PropertyData.end(); iter++){
257                         
258                         if (iter->first == "ALTREP"){
259                                 
260                                 DescriptionListAltRep.clear();
261                                 DescriptionListAltRep.push_back(iter->second);
262                                 
263                         } else if (iter->first == "LANGUAGE"){
264                                 
265                                 DescriptionListLanguage.clear();
266                                 DescriptionListLanguage.push_back(iter->second);
267                                 
268                         } else {
269                                 
270                                 if (TokenData == false){
271                                         TokenData = true;
272                                 } else {
273                                         PropertyTokens += ";";
274                                 }
275                                 
276                                 PropertyTokens += iter->first;
277                                 PropertyTokens += "=";
278                                 PropertyTokens += iter->second;
279                                 
280                         }
281                                 
282                 }
283                 
284                 if (PropertyTokens.size() > 0){
285                         DescriptionListTokens.clear();
286                         DescriptionListTokens.push_back(PropertyTokens);
287                 }
288                 
289                 DescriptionList.clear();
290                 DescriptionList.push_back(DataReceived.begin()->second);
291                 
292         }
293         
294         // Get the Date Time Start value.
295         
296         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTART");
297         
298         // Process the data from DTSTART.
299         
300         if (DataReceived.begin() != DataReceived.end()){
301         
302                 bool TokenData = false;
303                 string PropertyTokens;
304                 
305                 PropertyNameData = (string*)&DataReceived.begin()->first;
306                 
307                 PropertyData = SplitValues(*PropertyNameData);
308                 
309                 for(map<string,string>::iterator iter = PropertyData.begin();
310                         iter != PropertyData.end(); iter++){
311                         
312                         if (iter->first == "VALUE"){
313                                 
314                                 DateTimeStartDataValue = iter->second;
315                                 
316                         } else if (iter->first == "TZID"){
317                                 
318                                 DateTimeStartDataTimeZoneID = iter->second;
319                                 
320                         } else {
321                                 
322                                 if (TokenData == false){
323                                         TokenData = true;
324                                 } else {
325                                         PropertyTokens += ";";
326                                 }
327                                 
328                                 PropertyTokens += iter->first;
329                                 PropertyTokens += "=";
330                                 PropertyTokens += iter->second;
331                                 
332                         }
333                                 
334                 }
335                 
336                 if (PropertyTokens.size() > 0){
337                         DateTimeStartDataTokens = PropertyTokens;
338                 }
339                 
340                 DateTimeStartData = DataReceived.begin()->second;
341                 
342         }
343         
344         // Process the data from GEO.
345         
346         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "GEO");
347         
348         if (DataReceived.begin() != DataReceived.end()){
349         
350                 try {
351                         GeographicTokens = DataReceived.begin()->first.substr(4);
352                 }
353                 
354                 catch(const out_of_range &oor){
355                         // Do nothing as there is no data.
356                 }               
357                 
358                 GeographicData = DataReceived.begin()->second;
359                 
360         }
361         
362         // Process the data from LAST-MODIFIED.
363         
364         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LAST-MODIFIED");
365         
366         if (DataReceived.begin() != DataReceived.end()){
367         
368                 try {
369                         LastModifiedTokens = DataReceived.begin()->first.substr(14);
370                 }
371                 
372                 catch(const out_of_range &oor){
373                         // Do nothing as there is no data.
374                 }               
375                 
376                 LastModifiedData = DataReceived.begin()->second;
377                 
378         }
379         
380         // Process the data from LOCATION.
381         
382         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LOCATION");
383         
384         if (DataReceived.begin() != DataReceived.end()){
385         
386                 bool TokenData = false;
387                 string PropertyTokens;
388                 
389                 PropertyNameData = (string*)&DataReceived.begin()->first;
390                 
391                 PropertyData = SplitValues(*PropertyNameData);
392                 
393                 for(map<string,string>::iterator iter = PropertyData.begin();
394                         iter != PropertyData.end(); iter++){
395                         
396                         if (iter->first == "ALTREP"){
397                                 
398                                 LocationDataAltRep = iter->second;
399                                 
400                         } else if (iter->first == "LANGUAGE"){
401                                 
402                                 LocationDataLanguage = iter->second;
403                                 
404                         } else {
405                                 
406                                 if (TokenData == false){
407                                         TokenData = true;
408                                 } else {
409                                         PropertyTokens += ";";
410                                 }
411                                 
412                                 PropertyTokens += iter->first;
413                                 PropertyTokens += "=";
414                                 PropertyTokens += iter->second;
415                                 
416                         }
417                                 
418                 }
419                 
420                 if (PropertyTokens.size() > 0){
421                         
422                         LocationDataTokens = PropertyTokens;
423                         
424                 }
425                 
426                 LocationData = DataReceived.begin()->second;
427                 
428         }
429         
430         // Process the data from ORGANIZER.
431         
432         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "ORGANIZER");
433         
434         if (DataReceived.begin() != DataReceived.end()){
435         
436                 bool TokenData = false;
437                 string PropertyTokens;
438                 
439                 PropertyNameData = (string*)&DataReceived.begin()->first;
440                 
441                 PropertyData = SplitValues(*PropertyNameData);
442                 
443                 for(map<string,string>::iterator iter = PropertyData.begin();
444                         iter != PropertyData.end(); iter++){
445                         
446                         if (iter->first == "CN"){
447                                 
448                                 OrganiserDataCommonName = iter->second;
449                                 
450                         } else if (iter->first == "DIR"){
451                                 
452                                 OrganiserDataDirectoryEntry = iter->second;
453                                 
454                         } else if (iter->first == "SENT-BY"){
455                                 
456                                 OrganiserDataSentByParam = iter->second;
457                                 
458                         } else if (iter->first == "LANGUAGE"){
459                                 
460                                 OrganiserDataLanguage = iter->second;
461                                 
462                         } else {
463                                 
464                                 if (TokenData == false){
465                                         TokenData = true;
466                                 } else {
467                                         PropertyTokens += ";";
468                                 }
469                                 
470                                 PropertyTokens += iter->first;
471                                 PropertyTokens += "=";
472                                 PropertyTokens += iter->second;
473                                 
474                         }
475                                 
476                 }
477                 
478                 if (PropertyTokens.size() > 0){
479                         
480                         OrganiserDataTokens = PropertyTokens;
481                         
482                 }
483                 
484                 OrganiserData = DataReceived.begin()->second;
485                 
486         }
487         
488         // Process the data from PERCENT-COMPLETE.
489         
490         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "PERCENT-COMPLETE");
491         
492         if (DataReceived.begin() != DataReceived.end()){
493         
494                 try {
495                         PercentCompleteTokens = DataReceived.begin()->first.substr(17);
496                 }
497                 
498                 catch(const out_of_range &oor){
499                         // Do nothing as there is no data.
500                 }
501                 
502                 PercentCompleteData = DataReceived.begin()->second;
503                 
504         }
505         
506         // Process the data from PRIORITY.
507         
508         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "PRIORITY");
509         
510         if (DataReceived.begin() != DataReceived.end()){
511         
512                 try {
513                         PriorityTokens = DataReceived.begin()->first.substr(9);
514                 }
515                 
516                 catch(const out_of_range &oor){
517                         // Do nothing as there is no data.
518                 }               
519                 
520                 try {
521                         PriorityData = stoi(DataReceived.begin()->second);
522                 }
523                 
524                 catch(const invalid_argument &oor){
525                         PriorityTokens.clear();
526                 }
527                 
528         }
529         
530         // Process the data from RECURRENCE-ID.
531         
532         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RECURRENCE-ID");
533         
534         if (DataReceived.begin() != DataReceived.end()){
535         
536                 bool TokenData = false;
537                 string PropertyTokens;
538                 
539                 PropertyNameData = (string*)&DataReceived.begin()->first;
540                 
541                 PropertyData = SplitValues(*PropertyNameData);
542                 
543                 for(map<string,string>::iterator iter = PropertyData.begin();
544                         iter != PropertyData.end(); iter++){
545                         
546                         if (iter->first == "TZID"){
547                                 
548                                 RecurranceIDDataTimeZoneParam = iter->second;
549                                 
550                         } else if (iter->first == "VALUE"){
551                                 
552                                 RecurranceIDDataValue = iter->second;
553                                 
554                         } else if (iter->first == "RANGE"){
555                                 
556                                 RecurranceIDDataRangeParam = iter->second;
557                                 
558                         } else {
559                                 
560                                 if (TokenData == false){
561                                         TokenData = true;
562                                 } else {
563                                         PropertyTokens += ";";
564                                 }
565                                 
566                                 PropertyTokens += iter->first;
567                                 PropertyTokens += "=";
568                                 PropertyTokens += iter->second;
569                                 
570                         }
571                                 
572                 }
573                 
574                 if (PropertyTokens.size() > 0){
575                         
576                         RecurranceIDDataTokens = PropertyTokens;
577                         
578                 }
579                 
580                 RecurranceIDData = DataReceived.begin()->second;
581                 
582         }
583         
584         // Process the data from SEQUENCE.
585         
586         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SEQUENCE");
587         
588         if (DataReceived.begin() != DataReceived.end()){
589         
590                 try {
591                         SequenceTokens = DataReceived.begin()->first.substr(9);
592                 }
593                 
594                 catch(const out_of_range &oor){
595                         // Do nothing as there is no data.
596                 }               
597                 
598                 try {
599                         SequenceData = stoi(DataReceived.begin()->second);
600                 }
601                 
602                 catch(const invalid_argument &oor){
603                         SequenceTokens.clear();
604                 }
605                 
606         }
607         
608         // Process the data from STATUS.
609         
610         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "STATUS");
611         
612         if (DataReceived.begin() != DataReceived.end()){
613         
614                 bool TokenData = false;
615                 string PropertyTokens;
616                 
617                 PropertyNameData = (string*)&DataReceived.begin()->first;
618                 
619                 PropertyData = SplitValues(*PropertyNameData);
620                 
621                 for(map<string,string>::iterator iter = PropertyData.begin();
622                         iter != PropertyData.end(); iter++){
623                         
624                         if (iter->first == "LANGUAGE"){
625                                 
626                                 StatusLanguage = iter->second;
627                                 
628                         } else {
629                                 
630                                 if (TokenData == false){
631                                         TokenData = true;
632                                 } else {
633                                         PropertyTokens += ";";
634                                 }
635                                 
636                                 PropertyTokens += iter->first;
637                                 PropertyTokens += "=";
638                                 PropertyTokens += iter->second;
639                                 
640                         }
641                                 
642                 }
643                 
644                 if (PropertyTokens.size() > 0){
645                         
646                         StatusTokens = PropertyTokens;
647                         
648                 }
649                 
650                 StatusData = DataReceived.begin()->second;
651                 
652         }
653         
654         // Process the data from SUMMARY.
655         
656         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SUMMARY");
657         
658         if (DataReceived.begin() != DataReceived.end()){
659         
660                 bool TokenData = false;
661                 string PropertyTokens;
662                 
663                 PropertyNameData = (string*)&DataReceived.begin()->first;
664                 
665                 PropertyData = SplitValues(*PropertyNameData);
666                 
667                 for(map<string,string>::iterator iter = PropertyData.begin();
668                         iter != PropertyData.end(); iter++){
669                         
670                         if (iter->first == "ALTREP"){
671                                 
672                                 SummaryDataAltRep = iter->second;
673                                 
674                         } else if (iter->first == "LANGUAGE"){
675                                 
676                                 SummaryDataLanguage = iter->second;
677                                 
678                         } else {
679                                 
680                                 if (TokenData == false){
681                                         TokenData = true;
682                                 } else {
683                                         PropertyTokens += ";";
684                                 }
685                                 
686                                 PropertyTokens += iter->first;
687                                 PropertyTokens += "=";
688                                 PropertyTokens += iter->second;
689                                 
690                         }
691                                 
692                 }
693                 
694                 if (PropertyTokens.size() > 0){
695                         
696                         SummaryDataTokens = PropertyTokens;
697                         
698                 }
699                 
700                 SummaryData = DataReceived.begin()->second;
701                 
702         }
703         
704         // Process the data from URL.
705         
706         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "URL");
707         
708         if (DataReceived.begin() != DataReceived.end()){
709         
710                 try {
711                         URLDataTokens = DataReceived.begin()->first.substr(4);
712                 }
713                 
714                 catch(const out_of_range &oor){
715                         // Do nothing as there is no data.
716                 }               
717                 
718                 URLData = DataReceived.begin()->second;
719                 
720         }
721         
722         // Process the data from RRULE.
723         
724         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RRULE");
725         
726         if (DataReceived.begin() != DataReceived.end()){
727         
728                 try {
729                         RecurranceRuleDataTokens = DataReceived.begin()->first.substr(6);
730                 }
731                 
732                 catch(const out_of_range &oor){
733                         // Do nothing as there is no data.
734                 }               
735                 
736                 RecurranceRuleData = DataReceived.begin()->second;
737                 
738         }
739         
740         bool DueProcessed = false;
741         
742         // Process the data from DUE.
743         
744         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DUE");
745         
746         if (DataReceived.begin() != DataReceived.end()){
747         
748                 bool TokenData = false;
749                 string PropertyTokens;
750                 
751                 PropertyNameData = (string*)&DataReceived.begin()->first;
752                 
753                 PropertyData = SplitValues(*PropertyNameData);
754                 
755                 for(map<string,string>::iterator iter = PropertyData.begin();
756                         iter != PropertyData.end(); iter++){
757                         
758                         if (iter->first == "TZID"){
759                                 
760                                 DueDataTimeZoneID = iter->second;
761                                 
762                         } else if (iter->first == "VALUE"){
763                                 
764                                 DueDataValue = iter->second;
765                                 
766                         } else {
767                                 
768                                 if (TokenData == false){
769                                         TokenData = true;
770                                 } else {
771                                         PropertyTokens += ";";
772                                 }
773                                 
774                                 PropertyTokens += iter->first;
775                                 PropertyTokens += "=";
776                                 PropertyTokens += iter->second;
777                                 
778                         }
779                                 
780                 }
781                 
782                 if (PropertyTokens.size() > 0){
783                         
784                         DueDataTokens = PropertyTokens;
785                         
786                 }
787                 
788                 DueData = DataReceived.begin()->second;
789                 DueProcessed = true;
790                 
791         }
792         
793         // If there is no DUE, then check for DURATION.
794         
795         if (DueProcessed == false){
797                 DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DURATION");
798         
799                 if (DataReceived.begin() != DataReceived.end()){
800         
801                         try {
802                                 DurationDataTokens = DataReceived.begin()->first.substr(9);
803                         }
804                 
805                         catch(const out_of_range &oor){
806                                 // Do nothing as there is no data.
807                         }               
808                 
809                         DurationData = DataReceived.begin()->second;
810                 
811                 }
812                 
813         }
815         // Process the data from ATTACH.
816         
817         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTACH");
818         
819         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
820                 iter != DataReceived.end(); 
821                 ++iter){
822                 
823                 AttachListEncoding.push_back("");
824                 AttachListValue.push_back("");
825                 AttachListFormatType.push_back("");
826                 AttachListTokens.push_back("");
827                 AttachList.push_back("");
828                         
829                 bool TokenData = false;
830                 string PropertyTokens;
831                 
832                 PropertyNameData = (string*)&iter->first;
833                 
834                 PropertyData = SplitValues(*PropertyNameData);
835                         
836                 for(map<string,string>::iterator dataiter = PropertyData.begin();
837                         dataiter != PropertyData.end(); dataiter++){
838                         
839                         if (dataiter->first == "ENCODING"){
840                                 
841                                 AttachListEncoding[ObjectSeekCount] = dataiter->second;
842                                 
843                         } else if (dataiter->first == "VALUE"){
844                                 
845                                 AttachListValue[ObjectSeekCount] = dataiter->second;
846                                 
847                         } else if (dataiter->first == "FMTTYPE"){
848                                 
849                                 AttachListFormatType[ObjectSeekCount] = dataiter->second;
850                                 
851                         } else {
852                                 
853                                 if (TokenData == false){
854                                         TokenData = true;
855                                 } else {
856                                         PropertyTokens += ";";
857                                 }
858                                 
859                                 PropertyTokens += dataiter->first;
860                                 PropertyTokens += "=";
861                                 PropertyTokens += dataiter->second;
862                                 
863                         }
864                                 
865                 }
866                 
867                 if (PropertyTokens.size() > 0){
868                         AttachListTokens[ObjectSeekCount] = PropertyTokens;
869                 }
870                         
871                 AttachList[ObjectSeekCount] = iter->second;
872                 
873                 ObjectSeekCount++;
874                 
875         }
876         
877         // Process the data from ATTENDEE.
878         
879         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTENDEE");
880         
881         ObjectSeekCount = 0;
882         
883         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
884                 iter != DataReceived.end(); 
885                 ++iter){
886                         
887                 AttendeeListMember.push_back("");
888                 AttendeeListDelegatedFrom.push_back("");
889                 AttendeeListDelegatedTo.push_back("");
890                 AttendeeListRole.push_back("");
891                 AttendeeListRSVP.push_back("");
892                 AttendeeListDirectoryEntry.push_back("");
893                 AttendeeListSentBy.push_back("");
894                 AttendeeListCommonName.push_back("");
895                 AttendeeListCalendarUserType.push_back("");
896                 AttendeeListParticipationStatus.push_back("");
897                 AttendeeListLanguage.push_back("");
898                 AttendeeListTokens.push_back("");
899                 AttendeeList.push_back("");
900                         
901                 bool TokenData = false;
902                 string PropertyTokens;
903                 
904                 PropertyNameData = (string*)&iter->first;
905                 
906                 PropertyData = SplitValues(*PropertyNameData);
907                         
908                 for(map<string,string>::iterator dataiter = PropertyData.begin();
909                         dataiter != PropertyData.end(); dataiter++){
910                         
911                         if (dataiter->first == "CUTYPE"){
912                                 
913                                 AttendeeListCalendarUserType[ObjectSeekCount] = dataiter->second;
914                                 
915                         } else if (dataiter->first == "MEMBER"){
916                                 
917                                 AttendeeListMember[ObjectSeekCount] = dataiter->second;
918                                 
919                         } else if (dataiter->first == "ROLE"){
920                                 
921                                 AttendeeListRole[ObjectSeekCount] = dataiter->second;
922                                 
923                         } else if (dataiter->first == "PARTSTAT"){
924                                 
925                                 AttendeeListParticipationStatus[ObjectSeekCount] = dataiter->second;
926                                 
927                         } else if (dataiter->first == "RSVP"){
928                                 
929                                 AttendeeListRSVP[ObjectSeekCount] = dataiter->second;
930                                 
931                         } else if (dataiter->first == "DELEGATED-TO"){
932                                 
933                                 AttendeeListDelegatedTo[ObjectSeekCount] = dataiter->second;
934                                 
935                         } else if (dataiter->first == "DELEGATED-FROM"){
936                                 
937                                 AttendeeListDelegatedFrom[ObjectSeekCount] = dataiter->second;
938                                 
939                         } else if (dataiter->first == "SENT-BY"){
940                                 
941                                 AttendeeListSentBy[ObjectSeekCount] = dataiter->second;
942                                 
943                         } else if (dataiter->first == "CN"){
944                                 
945                                 AttendeeListCommonName[ObjectSeekCount] = dataiter->second;
946                                 
947                         } else if (dataiter->first == "DIR"){
948                                 
949                                 AttendeeListDirectoryEntry[ObjectSeekCount] = dataiter->second;
950                                 
951                         } else if (dataiter->first == "LANGUAGE"){
952                                 
953                                 AttendeeListLanguage[ObjectSeekCount] = dataiter->second;
954                                 
955                         } else {
956                                 
957                                 if (TokenData == false){
958                                         TokenData = true;
959                                 } else {
960                                         PropertyTokens += ";";
961                                 }
962                                 
963                                 PropertyTokens += dataiter->first;
964                                 PropertyTokens += "=";
965                                 PropertyTokens += dataiter->second;
966                                 
967                         }
968                                 
969                 }
970                 
971                 if (PropertyTokens.size() > 0){
972                         AttendeeListTokens[ObjectSeekCount] = PropertyTokens;
973                 }
974                         
975                 AttendeeList[ObjectSeekCount] = iter->second;
976                 
977                 ObjectSeekCount++;
978                 
979         }
981         // Process the data from CATEGORIES.
982         
983         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CATEGORIES");
984         
985         ObjectSeekCount = 0;
986         
987         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
988                 iter != DataReceived.end(); 
989                 ++iter){
990                 
991                 CategoriesListTokens.push_back("");
992                 CategoriesListLanguage.push_back("");
993                 CategoriesList.push_back("");
994                         
995                 bool TokenData = false;
996                 string PropertyTokens;
997                 
998                 PropertyNameData = (string*)&iter->first;
999                 
1000                 PropertyData = SplitValues(*PropertyNameData);
1001                         
1002                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1003                         dataiter != PropertyData.end(); dataiter++){
1004                         
1005                         if (dataiter->first == "LANGUAGE"){
1006                                 
1007                                 CategoriesListLanguage[ObjectSeekCount] = dataiter->second;
1008                                 
1009                         } else {
1010                                 
1011                                 if (TokenData == false){
1012                                         TokenData = true;
1013                                 } else {
1014                                         PropertyTokens += ";";
1015                                 }
1016                                 
1017                                 PropertyTokens += dataiter->first;
1018                                 PropertyTokens += "=";
1019                                 PropertyTokens += dataiter->second;
1020                                 
1021                         }
1022                                 
1023                 }
1024                 
1025                 if (PropertyTokens.size() > 0){
1026                         CategoriesListTokens[ObjectSeekCount] = PropertyTokens;
1027                 }
1028                         
1029                 CategoriesList[ObjectSeekCount] = iter->second;
1030                 
1031                 ObjectSeekCount++;
1032                 
1033         }
1034         
1035         // Process the data from COMMENT.
1036         
1037         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "COMMENT");
1039         ObjectSeekCount = 0;
1040         
1041         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1042                 iter != DataReceived.end(); 
1043                 ++iter){
1044                 
1045                 CommentListTokens.push_back("");
1046                 CommentListAltRep.push_back("");
1047                 CommentListLanguage.push_back("");
1048                 CommentList.push_back("");
1049                         
1050                 bool TokenData = false;
1051                 string PropertyTokens;
1052                 
1053                 PropertyNameData = (string*)&iter->first;
1054                 
1055                 PropertyData = SplitValues(*PropertyNameData);
1056                         
1057                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1058                         dataiter != PropertyData.end(); dataiter++){
1059                         
1060                         if (dataiter->first == "ALTREP"){
1061                                 
1062                                 CommentListAltRep[ObjectSeekCount] = dataiter->second;
1063                                 
1064                         } else if (dataiter->first == "LANGUAGE"){
1065                                 
1066                                 CommentListLanguage[ObjectSeekCount] = dataiter->second;
1067                                 
1068                         } else {
1069                                 
1070                                 if (TokenData == false){
1071                                         TokenData = true;
1072                                 } else {
1073                                         PropertyTokens += ";";
1074                                 }
1075                                 
1076                                 PropertyTokens += dataiter->first;
1077                                 PropertyTokens += "=";
1078                                 PropertyTokens += dataiter->second;
1079                                 
1080                         }
1081                                 
1082                 }
1083                 
1084                 if (PropertyTokens.size() > 0){
1085                         CommentListTokens[ObjectSeekCount] = PropertyTokens;
1086                 }
1087                         
1088                 CommentList[ObjectSeekCount] = iter->second;
1089                 
1090                 ObjectSeekCount++;
1091                 
1092         }
1094         // Process the data from CONTACT.
1095         
1096         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CONTACT");
1098         ObjectSeekCount = 0;
1099         
1100         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1101                 iter != DataReceived.end(); 
1102                 ++iter){
1103                 
1104                 ContactListTokens.push_back("");
1105                 ContactListAltRep.push_back("");
1106                 ContactListLanguage.push_back("");
1107                 ContactList.push_back("");
1108                         
1109                 bool TokenData = false;
1110                 string PropertyTokens;
1111                 
1112                 PropertyNameData = (string*)&iter->first;
1113                 
1114                 PropertyData = SplitValues(*PropertyNameData);
1115                         
1116                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1117                         dataiter != PropertyData.end(); dataiter++){
1118                         
1119                         if (dataiter->first == "ALTREP"){
1120                                 
1121                                 ContactListAltRep[ObjectSeekCount] = dataiter->second;
1122                                 
1123                         } else if (dataiter->first == "LANGUAGE"){
1124                                 
1125                                 ContactListLanguage[ObjectSeekCount] = dataiter->second;
1126                                 
1127                         } else {
1128                                 
1129                                 if (TokenData == false){
1130                                         TokenData = true;
1131                                 } else {
1132                                         PropertyTokens += ";";
1133                                 }
1134                                 
1135                                 PropertyTokens += dataiter->first;
1136                                 PropertyTokens += "=";
1137                                 PropertyTokens += dataiter->second;
1138                                 
1139                         }
1140                                 
1141                 }
1142                 
1143                 if (PropertyTokens.size() > 0){
1144                         ContactListTokens[ObjectSeekCount] = PropertyTokens;
1145                 }
1146                         
1147                 ContactList[ObjectSeekCount] = iter->second;
1148                 
1149                 ObjectSeekCount++;
1150                 
1151         }
1152         
1153         // Process the data from EXDATE.
1154         
1155         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "EXDATE");
1157         ObjectSeekCount = 0;
1158         
1159         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1160                 iter != DataReceived.end(); 
1161                 ++iter){
1162                 
1163                 ExcludeDateDataTokens.push_back("");
1164                 ExcludeDateDataValue.push_back("");
1165                 ExcludeDateDataTimeZoneParam.push_back("");
1166                 ExcludeDateData.push_back("");
1167                         
1168                 bool TokenData = false;
1169                 string PropertyTokens;
1170                 
1171                 PropertyNameData = (string*)&iter->first;
1172                 
1173                 PropertyData = SplitValues(*PropertyNameData);
1174                         
1175                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1176                         dataiter != PropertyData.end(); dataiter++){
1177                         
1178                         if (dataiter->first == "VALUE"){
1179                                 
1180                                 ExcludeDateDataValue[ObjectSeekCount] = dataiter->second;
1181                                 
1182                         } else if (dataiter->first == "TZID"){
1183                                 
1184                                 ExcludeDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
1185                                 
1186                         } else {
1187                                 
1188                                 if (TokenData == false){
1189                                         TokenData = true;
1190                                 } else {
1191                                         PropertyTokens += ";";
1192                                 }
1193                                 
1194                                 PropertyTokens += dataiter->first;
1195                                 PropertyTokens += "=";
1196                                 PropertyTokens += dataiter->second;
1197                                 
1198                         }
1199                                 
1200                 }
1201                 
1202                 if (PropertyTokens.size() > 0){
1203                         ExcludeDateDataTokens[ObjectSeekCount] = PropertyTokens;
1204                 }
1205                         
1206                 ExcludeDateData[ObjectSeekCount] = iter->second;
1207                 
1208                 ObjectSeekCount++;
1209                 
1210         }
1212         // Process the data from REQUEST-STATUS.
1213         
1214         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "REQUEST-STATUS");
1216         ObjectSeekCount = 0;
1217         
1218         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1219                 iter != DataReceived.end(); 
1220                 ++iter){
1221                 
1222                 RequestStatusTokens.push_back("");
1223                 RequestStatusLanguage.push_back("");
1224                 RequestStatusData.push_back("");
1225                         
1226                 bool TokenData = false;
1227                 string PropertyTokens;
1228                 
1229                 PropertyNameData = (string*)&iter->first;
1230                 
1231                 PropertyData = SplitValues(*PropertyNameData);
1232                         
1233                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1234                         dataiter != PropertyData.end(); dataiter++){
1235                         
1236                         if (dataiter->first == "LANGUAGE"){
1237                                 
1238                                 RequestStatusLanguage[ObjectSeekCount] = dataiter->second;
1239                                 
1240                         } else {
1241                                 
1242                                 if (TokenData == false){
1243                                         TokenData = true;
1244                                 } else {
1245                                         PropertyTokens += ";";
1246                                 }
1247                                 
1248                                 PropertyTokens += dataiter->first;
1249                                 PropertyTokens += "=";
1250                                 PropertyTokens += dataiter->second;
1251                                 
1252                         }
1253                                 
1254                 }
1255                 
1256                 if (PropertyTokens.size() > 0){
1257                         RequestStatusTokens[ObjectSeekCount] = PropertyTokens;
1258                 }
1259                         
1260                 RequestStatusData[ObjectSeekCount] = iter->second;
1261                 
1262                 ObjectSeekCount++;
1263                 
1264         }
1265         
1266         // Process the data from RELATED-TO.
1267         
1268         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RELATED-TO");
1270         ObjectSeekCount = 0;
1271         
1272         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1273                 iter != DataReceived.end(); 
1274                 ++iter){
1275                 
1276                 RelatedToDataTokens.push_back("");
1277                 RelatedToDataRelationType.push_back("");
1278                 RelatedToData.push_back("");
1279                         
1280                 bool TokenData = false;
1281                 string PropertyTokens;
1282                 
1283                 PropertyNameData = (string*)&iter->first;
1284                 
1285                 PropertyData = SplitValues(*PropertyNameData);
1286                         
1287                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1288                         dataiter != PropertyData.end(); dataiter++){
1289                         
1290                         if (dataiter->first == "RELTYPE"){
1291                                 
1292                                 RelatedToDataRelationType[ObjectSeekCount] = dataiter->second;
1293                                 
1294                         } else {
1295                                 
1296                                 if (TokenData == false){
1297                                         TokenData = true;
1298                                 } else {
1299                                         PropertyTokens += ";";
1300                                 }
1301                                 
1302                                 PropertyTokens += dataiter->first;
1303                                 PropertyTokens += "=";
1304                                 PropertyTokens += dataiter->second;
1305                                 
1306                         }
1307                                 
1308                 }
1309                 
1310                 if (PropertyTokens.size() > 0){
1311                         RelatedToDataTokens[ObjectSeekCount] = PropertyTokens;
1312                 }
1313                         
1314                 RelatedToData[ObjectSeekCount] = iter->second;
1315                 
1316                 ObjectSeekCount++;
1317                 
1318         }
1319         
1320         // Process the data from RESOURCES.
1321         
1322         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RESOURCES");
1324         ObjectSeekCount = 0;
1325         
1326         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1327                 iter != DataReceived.end(); 
1328                 ++iter){
1329                 
1330                 ResourcesDataTokens.push_back("");
1331                 ResourcesDataAltRep.push_back("");
1332                 ResourcesDataLanguage.push_back("");
1333                 ResourcesData.push_back("");
1334                         
1335                 bool TokenData = false;
1336                 string PropertyTokens;
1337                 
1338                 PropertyNameData = (string*)&iter->first;
1339                 
1340                 PropertyData = SplitValues(*PropertyNameData);
1341                         
1342                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1343                         dataiter != PropertyData.end(); dataiter++){
1344                         
1345                         if (dataiter->first == "ALTREP"){
1346                                 
1347                                 ResourcesDataAltRep[ObjectSeekCount] = dataiter->second;
1348                                 
1349                         } else if (dataiter->first == "LANGUAGE"){
1350                                 
1351                                 ResourcesDataLanguage[ObjectSeekCount] = dataiter->second;
1352                                 
1353                         } else {
1354                                 
1355                                 if (TokenData == false){
1356                                         TokenData = true;
1357                                 } else {
1358                                         PropertyTokens += ";";
1359                                 }
1360                                 
1361                                 PropertyTokens += dataiter->first;
1362                                 PropertyTokens += "=";
1363                                 PropertyTokens += dataiter->second;
1364                                 
1365                         }
1366                                 
1367                 }
1368                 
1369                 if (PropertyTokens.size() > 0){
1370                         ResourcesDataTokens[ObjectSeekCount] = PropertyTokens;
1371                 }
1372                         
1373                 ResourcesData[ObjectSeekCount] = iter->second;
1374                 
1375                 ObjectSeekCount++;
1376                 
1377         }
1378         
1379         // Process the data from RDATE.
1380         
1381         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RDATE");
1383         ObjectSeekCount = 0;
1384         
1385         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1386                 iter != DataReceived.end(); 
1387                 ++iter){
1388                 
1389                 RecurranceDateDataTokens.push_back("");
1390                 RecurranceDateDataValue.push_back("");
1391                 RecurranceDateDataTimeZoneParam.push_back("");
1392                 RecurranceDateData.push_back("");
1393                         
1394                 bool TokenData = false;
1395                 string PropertyTokens;
1396                 
1397                 PropertyNameData = (string*)&iter->first;
1398                 
1399                 PropertyData = SplitValues(*PropertyNameData);
1400                         
1401                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1402                         dataiter != PropertyData.end(); dataiter++){
1403                         
1404                         if (dataiter->first == "VALUE"){
1405                                 
1406                                 RecurranceDateDataValue[ObjectSeekCount] = dataiter->second;
1407                                 
1408                         } else if (dataiter->first == "TZID"){
1409                                 
1410                                 RecurranceDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
1411                                 
1412                         } else {
1413                                 
1414                                 if (TokenData == false){
1415                                         TokenData = true;
1416                                 } else {
1417                                         PropertyTokens += ";";
1418                                 }
1419                                 
1420                                 PropertyTokens += dataiter->first;
1421                                 PropertyTokens += "=";
1422                                 PropertyTokens += dataiter->second;
1423                                 
1424                         }
1425                                 
1426                 }
1427                 
1428                 if (PropertyTokens.size() > 0){
1429                         RecurranceDateDataTokens[ObjectSeekCount] = PropertyTokens;
1430                 }
1431                         
1432                 RecurranceDateData[ObjectSeekCount] = iter->second;
1433                 
1434                 ObjectSeekCount++;
1435                 
1436         }
1437         
1438         ObjectSeekCount = 0;
1439         
1440         // Process data from X-*
1441         
1442         for(vector<string>::iterator iter = ObjectName.begin(); 
1443                 iter != ObjectName.end(); ++iter){
1444                 
1445                 RequestStatusTokens.push_back("");
1446                 RequestStatusLanguage.push_back("");
1447                 RequestStatusData.push_back("");
1448                         
1449                 bool TokenData = false;
1450                 string PropertyTokens;
1451                 
1452                 if (iter->substr(0,2) == "X-" &&
1453                         iter->size() > 2){
1454                         
1455                         XTokensData.push_back(ObjectData[ObjectSeekCount]);
1456                         XTokensDataTokens.push_back(ObjectName[ObjectSeekCount]);
1457                                 
1458                 }
1459                 
1460                 ObjectSeekCount++;
1461                 
1462         }
1463         
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