Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Version 0.08 release
[xestiacalendar/.git] / objects / calendarjournal / CalendarJournal.cpp
1 #include "CalendarJournal.h"
3 using namespace std;
5 CalendarObjectValidResult CalendarJournalObject::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:VJOURNAL.
15         
16         for (vector<string>::iterator iter = ObjectName.begin();
17                 iter != ObjectName.end(); iter++){
18         
19                 if (ObjectName[SeekCount] == "BEGIN" &&
20                         ObjectData[SeekCount] == "VJOURNAL"){
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] == "VJOURNAL" &&
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:VJOURNAL.
103         
104         for (vector<string>::iterator iter = ObjectName.begin();
105                 iter != ObjectName.end(); iter++){
106         
107                 if (ObjectName[SeekCount] == "END" &&
108                         ObjectData[SeekCount] == "VJOURNAL"){
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 VJOURNAL 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 CalendarJournalObject::ProcessData(){
141         // Process the data.
142         
143         multimap<string,string> DataReceived;
144         map<string,string> PropertyData;
145         string *PropertyNameData = nullptr;
146         int ObjectSeekCount = 0;
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         // Get the Date Time Start value.
207         
208         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "DTSTART");
209         
210         // Process the data from DTSTART.
211         
212         if (DataReceived.begin() != DataReceived.end()){
213         
214                 bool TokenData = false;
215                 string PropertyTokens;
216                 
217                 PropertyNameData = (string*)&DataReceived.begin()->first;
218                 
219                 PropertyData = SplitValues(*PropertyNameData);
220                 
221                 for(map<string,string>::iterator iter = PropertyData.begin();
222                         iter != PropertyData.end(); iter++){
223                         
224                         if (iter->first == "VALUE"){
225                                 
226                                 DateTimeStartDataValue = iter->second;
227                                 
228                         } else if (iter->first == "TZID"){
229                                 
230                                 DateTimeStartDataTimeZoneID = iter->second;
231                                 
232                         } else {
233                                 
234                                 if (TokenData == false){
235                                         TokenData = true;
236                                 } else {
237                                         PropertyTokens += ";";
238                                 }
239                                 
240                                 PropertyTokens += iter->first;
241                                 PropertyTokens += "=";
242                                 PropertyTokens += iter->second;
243                                 
244                         }
245                                 
246                 }
247                 
248                 if (PropertyTokens.size() > 0){
249                         DateTimeStartDataTokens = PropertyTokens;
250                 }
251                 
252                 DateTimeStartData = DataReceived.begin()->second;
253                 
254         }
255         
256         // Process the data from LAST-MODIFIED.
257         
258         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "LAST-MODIFIED");
259         
260         if (DataReceived.begin() != DataReceived.end()){
261         
262                 try {
263                         LastModifiedTokens = DataReceived.begin()->first.substr(14);
264                 }
265                 
266                 catch(const out_of_range &oor){
267                         // Do nothing as there is no data.
268                 }               
269                 
270                 LastModifiedData = DataReceived.begin()->second;
271                 
272         }
273         
274         // Process the data from ORGANIZER.
275         
276         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "ORGANIZER");
277         
278         if (DataReceived.begin() != DataReceived.end()){
279         
280                 bool TokenData = false;
281                 string PropertyTokens;
282                 
283                 PropertyNameData = (string*)&DataReceived.begin()->first;
284                 
285                 PropertyData = SplitValues(*PropertyNameData);
286                 
287                 for(map<string,string>::iterator iter = PropertyData.begin();
288                         iter != PropertyData.end(); iter++){
289                         
290                         if (iter->first == "CN"){
291                                 
292                                 OrganiserDataCommonName = iter->second;
293                                 
294                         } else if (iter->first == "DIR"){
295                                 
296                                 OrganiserDataDirectoryEntry = iter->second;
297                                 
298                         } else if (iter->first == "SENT-BY"){
299                                 
300                                 OrganiserDataSentByParam = iter->second;
301                                 
302                         } else if (iter->first == "LANGUAGE"){
303                                 
304                                 OrganiserDataLanguage = iter->second;
305                                 
306                         } else {
307                                 
308                                 if (TokenData == false){
309                                         TokenData = true;
310                                 } else {
311                                         PropertyTokens += ";";
312                                 }
313                                 
314                                 PropertyTokens += iter->first;
315                                 PropertyTokens += "=";
316                                 PropertyTokens += iter->second;
317                                 
318                         }
319                                 
320                 }
321                 
322                 if (PropertyTokens.size() > 0){
323                         
324                         OrganiserDataTokens = PropertyTokens;
325                         
326                 }
327                 
328                 OrganiserData = DataReceived.begin()->second;
329                 
330         }
331         
332         // Process the data from RECURRENCE-ID.
333         
334         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RECURRENCE-ID");
335         
336         if (DataReceived.begin() != DataReceived.end()){
337         
338                 bool TokenData = false;
339                 string PropertyTokens;
340                 
341                 PropertyNameData = (string*)&DataReceived.begin()->first;
342                 
343                 PropertyData = SplitValues(*PropertyNameData);
344                 
345                 for(map<string,string>::iterator iter = PropertyData.begin();
346                         iter != PropertyData.end(); iter++){
347                         
348                         if (iter->first == "TZID"){
349                                 
350                                 RecurranceIDDataTimeZoneParam = iter->second;
351                                 
352                         } else if (iter->first == "VALUE"){
353                                 
354                                 RecurranceIDDataValue = iter->second;
355                                 
356                         } else if (iter->first == "RANGE"){
357                                 
358                                 RecurranceIDDataRangeParam = iter->second;
359                                 
360                         } else {
361                                 
362                                 if (TokenData == false){
363                                         TokenData = true;
364                                 } else {
365                                         PropertyTokens += ";";
366                                 }
367                                 
368                                 PropertyTokens += iter->first;
369                                 PropertyTokens += "=";
370                                 PropertyTokens += iter->second;
371                                 
372                         }
373                                 
374                 }
375                 
376                 if (PropertyTokens.size() > 0){
377                         
378                         RecurranceIDDataTokens = PropertyTokens;
379                         
380                 }
381                 
382                 RecurranceIDData = DataReceived.begin()->second;
383                 
384         }
386         // Process the data from SEQUENCE.
387         
388         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SEQUENCE");
389         
390         if (DataReceived.begin() != DataReceived.end()){
391         
392                 try {
393                         SequenceTokens = DataReceived.begin()->first.substr(9);
394                 }
395                 
396                 catch(const out_of_range &oor){
397                         // Do nothing as there is no data.
398                 }               
399                 
400                 try {
401                         SequenceData = stoi(DataReceived.begin()->second);
402                 }
403                 
404                 catch(const invalid_argument &oor){
405                         SequenceTokens.clear();
406                 }
407                 
408         }
409         
410         // Process the data from STATUS.
411         
412         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "STATUS");
413         
414         if (DataReceived.begin() != DataReceived.end()){
415         
416                 bool TokenData = false;
417                 string PropertyTokens;
418                 
419                 PropertyNameData = (string*)&DataReceived.begin()->first;
420                 
421                 PropertyData = SplitValues(*PropertyNameData);
422                 
423                 for(map<string,string>::iterator iter = PropertyData.begin();
424                         iter != PropertyData.end(); iter++){
425                         
426                         if (iter->first == "LANGUAGE"){
427                                 
428                                 StatusLanguage = iter->second;
429                                 
430                         } else {
431                                 
432                                 if (TokenData == false){
433                                         TokenData = true;
434                                 } else {
435                                         PropertyTokens += ";";
436                                 }
437                                 
438                                 PropertyTokens += iter->first;
439                                 PropertyTokens += "=";
440                                 PropertyTokens += iter->second;
441                                 
442                         }
443                                 
444                 }
445                 
446                 if (PropertyTokens.size() > 0){
447                         
448                         StatusTokens = PropertyTokens;
449                         
450                 }
451                 
452                 StatusData = DataReceived.begin()->second;
453                 
454         }
455         
456         // Process the data from SUMMARY.
457         
458         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "SUMMARY");
459         
460         if (DataReceived.begin() != DataReceived.end()){
461         
462                 bool TokenData = false;
463                 string PropertyTokens;
464                 
465                 PropertyNameData = (string*)&DataReceived.begin()->first;
466                 
467                 PropertyData = SplitValues(*PropertyNameData);
468                 
469                 for(map<string,string>::iterator iter = PropertyData.begin();
470                         iter != PropertyData.end(); iter++){
471                         
472                         if (iter->first == "ALTREP"){
473                                 
474                                 SummaryDataAltRep = iter->second;
475                                 
476                         } else if (iter->first == "LANGUAGE"){
477                                 
478                                 SummaryDataLanguage = iter->second;
479                                 
480                         } else {
481                                 
482                                 if (TokenData == false){
483                                         TokenData = true;
484                                 } else {
485                                         PropertyTokens += ";";
486                                 }
487                                 
488                                 PropertyTokens += iter->first;
489                                 PropertyTokens += "=";
490                                 PropertyTokens += iter->second;
491                                 
492                         }
493                                 
494                 }
495                 
496                 if (PropertyTokens.size() > 0){
497                         
498                         SummaryDataTokens = PropertyTokens;
499                         
500                 }
501                 
502                 SummaryData = DataReceived.begin()->second;
503                 
504         }
505         
506         // Process the data from URL.
507         
508         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "URL");
509         
510         if (DataReceived.begin() != DataReceived.end()){
511         
512                 try {
513                         URLDataTokens = DataReceived.begin()->first.substr(4);
514                 }
515                 
516                 catch(const out_of_range &oor){
517                         // Do nothing as there is no data.
518                 }               
519                 
520                 URLData = DataReceived.begin()->second;
521                 
522         }
523         
524         // Process the data from RRULE.
525         
526         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, false, "RRULE");
527         
528         if (DataReceived.begin() != DataReceived.end()){
529         
530                 try {
531                         RecurranceRuleDataTokens = DataReceived.begin()->first.substr(6);
532                 }
533                 
534                 catch(const out_of_range &oor){
535                         // Do nothing as there is no data.
536                 }               
537                 
538                 RecurranceRuleData = DataReceived.begin()->second;
539                 
540         }
541         
542         // Process the data from ATTACH.
543         
544         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTACH");
545         
546         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
547                 iter != DataReceived.end(); 
548                 ++iter){
549                 
550                 AttachListEncoding.push_back("");
551                 AttachListValue.push_back("");
552                 AttachListFormatType.push_back("");
553                 AttachListTokens.push_back("");
554                 AttachList.push_back("");
555                         
556                 bool TokenData = false;
557                 string PropertyTokens;
558                 
559                 PropertyNameData = (string*)&iter->first;
560                 
561                 PropertyData = SplitValues(*PropertyNameData);
562                         
563                 for(map<string,string>::iterator dataiter = PropertyData.begin();
564                         dataiter != PropertyData.end(); dataiter++){
565                         
566                         if (dataiter->first == "ENCODING"){
567                                 
568                                 AttachListEncoding[ObjectSeekCount] = dataiter->second;
569                                 
570                         } else if (dataiter->first == "VALUE"){
571                                 
572                                 AttachListValue[ObjectSeekCount] = dataiter->second;
573                                 
574                         } else if (dataiter->first == "FMTTYPE"){
575                                 
576                                 AttachListFormatType[ObjectSeekCount] = dataiter->second;
577                                 
578                         } else {
579                                 
580                                 if (TokenData == false){
581                                         TokenData = true;
582                                 } else {
583                                         PropertyTokens += ";";
584                                 }
585                                 
586                                 PropertyTokens += dataiter->first;
587                                 PropertyTokens += "=";
588                                 PropertyTokens += dataiter->second;
589                                 
590                         }
591                                 
592                 }
593                 
594                 if (PropertyTokens.size() > 0){
595                         AttachListTokens[ObjectSeekCount] = PropertyTokens;
596                 }
597                         
598                 AttachList[ObjectSeekCount] = iter->second;
599                 
600                 ObjectSeekCount++;
601                 
602         }
603         
604         // Process the data from ATTENDEE.
605         
606         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "ATTENDEE");
607         
608         ObjectSeekCount = 0;
609         
610         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
611                 iter != DataReceived.end(); 
612                 ++iter){
613                         
614                 AttendeeListMember.push_back("");
615                 AttendeeListDelegatedFrom.push_back("");
616                 AttendeeListDelegatedTo.push_back("");
617                 AttendeeListRole.push_back("");
618                 AttendeeListRSVP.push_back("");
619                 AttendeeListDirectoryEntry.push_back("");
620                 AttendeeListSentBy.push_back("");
621                 AttendeeListCommonName.push_back("");
622                 AttendeeListCalendarUserType.push_back("");
623                 AttendeeListParticipationStatus.push_back("");
624                 AttendeeListLanguage.push_back("");
625                 AttendeeListTokens.push_back("");
626                 AttendeeList.push_back("");
627                         
628                 bool TokenData = false;
629                 string PropertyTokens;
630                 
631                 PropertyNameData = (string*)&iter->first;
632                 
633                 PropertyData = SplitValues(*PropertyNameData);
634                         
635                 for(map<string,string>::iterator dataiter = PropertyData.begin();
636                         dataiter != PropertyData.end(); dataiter++){
637                         
638                         if (dataiter->first == "CUTYPE"){
639                                 
640                                 AttendeeListCalendarUserType[ObjectSeekCount] = dataiter->second;
641                                 
642                         } else if (dataiter->first == "MEMBER"){
643                                 
644                                 AttendeeListMember[ObjectSeekCount] = dataiter->second;
645                                 
646                         } else if (dataiter->first == "ROLE"){
647                                 
648                                 AttendeeListRole[ObjectSeekCount] = dataiter->second;
649                                 
650                         } else if (dataiter->first == "PARTSTAT"){
651                                 
652                                 AttendeeListParticipationStatus[ObjectSeekCount] = dataiter->second;
653                                 
654                         } else if (dataiter->first == "RSVP"){
655                                 
656                                 AttendeeListRSVP[ObjectSeekCount] = dataiter->second;
657                                 
658                         } else if (dataiter->first == "DELEGATED-TO"){
659                                 
660                                 AttendeeListDelegatedTo[ObjectSeekCount] = dataiter->second;
661                                 
662                         } else if (dataiter->first == "DELEGATED-FROM"){
663                                 
664                                 AttendeeListDelegatedFrom[ObjectSeekCount] = dataiter->second;
665                                 
666                         } else if (dataiter->first == "SENT-BY"){
667                                 
668                                 AttendeeListSentBy[ObjectSeekCount] = dataiter->second;
669                                 
670                         } else if (dataiter->first == "CN"){
671                                 
672                                 AttendeeListCommonName[ObjectSeekCount] = dataiter->second;
673                                 
674                         } else if (dataiter->first == "DIR"){
675                                 
676                                 AttendeeListDirectoryEntry[ObjectSeekCount] = dataiter->second;
677                                 
678                         } else if (dataiter->first == "LANGUAGE"){
679                                 
680                                 AttendeeListLanguage[ObjectSeekCount] = dataiter->second;
681                                 
682                         } else {
683                                 
684                                 if (TokenData == false){
685                                         TokenData = true;
686                                 } else {
687                                         PropertyTokens += ";";
688                                 }
689                                 
690                                 PropertyTokens += dataiter->first;
691                                 PropertyTokens += "=";
692                                 PropertyTokens += dataiter->second;
693                                 
694                         }
695                                 
696                 }
697                 
698                 if (PropertyTokens.size() > 0){
699                         AttendeeListTokens[ObjectSeekCount] = PropertyTokens;
700                 }
701                         
702                 AttendeeList[ObjectSeekCount] = iter->second;
703                 
704                 ObjectSeekCount++;
705                 
706         }
707         
708         // Process the data from CATEGORIES.
709         
710         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CATEGORIES");
711         
712         ObjectSeekCount = 0;
713         
714         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
715                 iter != DataReceived.end(); 
716                 ++iter){
717                 
718                 CategoriesListTokens.push_back("");
719                 CategoriesListLanguage.push_back("");
720                 CategoriesList.push_back("");
721                         
722                 bool TokenData = false;
723                 string PropertyTokens;
724                 
725                 PropertyNameData = (string*)&iter->first;
726                 
727                 PropertyData = SplitValues(*PropertyNameData);
728                         
729                 for(map<string,string>::iterator dataiter = PropertyData.begin();
730                         dataiter != PropertyData.end(); dataiter++){
731                         
732                         if (dataiter->first == "LANGUAGE"){
733                                 
734                                 CategoriesListLanguage[ObjectSeekCount] = dataiter->second;
735                                 
736                         } else {
737                                 
738                                 if (TokenData == false){
739                                         TokenData = true;
740                                 } else {
741                                         PropertyTokens += ";";
742                                 }
743                                 
744                                 PropertyTokens += dataiter->first;
745                                 PropertyTokens += "=";
746                                 PropertyTokens += dataiter->second;
747                                 
748                         }
749                                 
750                 }
751                 
752                 if (PropertyTokens.size() > 0){
753                         CategoriesListTokens[ObjectSeekCount] = PropertyTokens;
754                 }
755                         
756                 CategoriesList[ObjectSeekCount] = iter->second;
757                 
758                 ObjectSeekCount++;
759                 
760         }
761         
762         // Process the data from COMMENT.
763         
764         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "COMMENT");
766         ObjectSeekCount = 0;
767         
768         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
769                 iter != DataReceived.end(); 
770                 ++iter){
771                 
772                 CommentListTokens.push_back("");
773                 CommentListAltRep.push_back("");
774                 CommentListLanguage.push_back("");
775                 CommentList.push_back("");
776                         
777                 bool TokenData = false;
778                 string PropertyTokens;
779                 
780                 PropertyNameData = (string*)&iter->first;
781                 
782                 PropertyData = SplitValues(*PropertyNameData);
783                         
784                 for(map<string,string>::iterator dataiter = PropertyData.begin();
785                         dataiter != PropertyData.end(); dataiter++){
786                         
787                         if (dataiter->first == "ALTREP"){
788                                 
789                                 CommentListAltRep[ObjectSeekCount] = dataiter->second;
790                                 
791                         } else if (dataiter->first == "LANGUAGE"){
792                                 
793                                 CommentListLanguage[ObjectSeekCount] = dataiter->second;
794                                 
795                         } else {
796                                 
797                                 if (TokenData == false){
798                                         TokenData = true;
799                                 } else {
800                                         PropertyTokens += ";";
801                                 }
802                                 
803                                 PropertyTokens += dataiter->first;
804                                 PropertyTokens += "=";
805                                 PropertyTokens += dataiter->second;
806                                 
807                         }
808                                 
809                 }
810                 
811                 if (PropertyTokens.size() > 0){
812                         CommentListTokens[ObjectSeekCount] = PropertyTokens;
813                 }
814                         
815                 CommentList[ObjectSeekCount] = iter->second;
816                 
817                 ObjectSeekCount++;
818                 
819         }
820         
821         // Process the data from CONTACT.
822         
823         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "CONTACT");
825         ObjectSeekCount = 0;
826         
827         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
828                 iter != DataReceived.end(); 
829                 ++iter){
830                 
831                 ContactListTokens.push_back("");
832                 ContactListAltRep.push_back("");
833                 ContactListLanguage.push_back("");
834                 ContactList.push_back("");
835                         
836                 bool TokenData = false;
837                 string PropertyTokens;
838                 
839                 PropertyNameData = (string*)&iter->first;
840                 
841                 PropertyData = SplitValues(*PropertyNameData);
842                         
843                 for(map<string,string>::iterator dataiter = PropertyData.begin();
844                         dataiter != PropertyData.end(); dataiter++){
845                         
846                         if (dataiter->first == "ALTREP"){
847                                 
848                                 ContactListAltRep[ObjectSeekCount] = dataiter->second;
849                                 
850                         } else if (dataiter->first == "LANGUAGE"){
851                                 
852                                 ContactListLanguage[ObjectSeekCount] = dataiter->second;
853                                 
854                         } else {
855                                 
856                                 if (TokenData == false){
857                                         TokenData = true;
858                                 } else {
859                                         PropertyTokens += ";";
860                                 }
861                                 
862                                 PropertyTokens += dataiter->first;
863                                 PropertyTokens += "=";
864                                 PropertyTokens += dataiter->second;
865                                 
866                         }
867                                 
868                 }
869                 
870                 if (PropertyTokens.size() > 0){
871                         ContactListTokens[ObjectSeekCount] = PropertyTokens;
872                 }
873                         
874                 ContactList[ObjectSeekCount] = iter->second;
875                 
876                 ObjectSeekCount++;
877                 
878         }
879         
880         // Process the data from Description.
881         
882         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "DESCRIPTION");
884         ObjectSeekCount = 0;
885         
886         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
887                 iter != DataReceived.end(); 
888                 ++iter){
889                 
890                 DescriptionListTokens.push_back("");
891                 DescriptionListAltRep.push_back("");
892                 DescriptionListLanguage.push_back("");
893                 DescriptionList.push_back("");
894                         
895                 bool TokenData = false;
896                 string PropertyTokens;
897                 
898                 PropertyNameData = (string*)&iter->first;
899                 
900                 PropertyData = SplitValues(*PropertyNameData);
901                         
902                 for(map<string,string>::iterator dataiter = PropertyData.begin();
903                         dataiter != PropertyData.end(); dataiter++){
904                         
905                         if (dataiter->first == "ALTREP"){
906                                 
907                                 DescriptionListAltRep[ObjectSeekCount] = dataiter->second;
908                                 
909                         } else if (dataiter->first == "LANGUAGE"){
910                                 
911                                 DescriptionListLanguage[ObjectSeekCount] = dataiter->second;
912                                 
913                         } else {
914                                 
915                                 if (TokenData == false){
916                                         TokenData = true;
917                                 } else {
918                                         PropertyTokens += ";";
919                                 }
920                                 
921                                 PropertyTokens += dataiter->first;
922                                 PropertyTokens += "=";
923                                 PropertyTokens += dataiter->second;
924                                 
925                         }
926                                 
927                 }
928                 
929                 if (PropertyTokens.size() > 0){
930                         DescriptionListTokens[ObjectSeekCount] = PropertyTokens;
931                 }
932                         
933                 DescriptionList[ObjectSeekCount] = iter->second;
934                 
935                 ObjectSeekCount++;
936                 
937         }
938         
939         // Process the data from EXDATE.
940         
941         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "EXDATE");
943         ObjectSeekCount = 0;
944         
945         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
946                 iter != DataReceived.end(); 
947                 ++iter){
948                 
949                 ExcludeDateDataTokens.push_back("");
950                 ExcludeDateDataValue.push_back("");
951                 ExcludeDateDataTimeZoneParam.push_back("");
952                 ExcludeDateData.push_back("");
953                         
954                 bool TokenData = false;
955                 string PropertyTokens;
956                 
957                 PropertyNameData = (string*)&iter->first;
958                 
959                 PropertyData = SplitValues(*PropertyNameData);
960                         
961                 for(map<string,string>::iterator dataiter = PropertyData.begin();
962                         dataiter != PropertyData.end(); dataiter++){
963                         
964                         if (dataiter->first == "VALUE"){
965                                 
966                                 ExcludeDateDataValue[ObjectSeekCount] = dataiter->second;
967                                 
968                         } else if (dataiter->first == "TZID"){
969                                 
970                                 ExcludeDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
971                                 
972                         } else {
973                                 
974                                 if (TokenData == false){
975                                         TokenData = true;
976                                 } else {
977                                         PropertyTokens += ";";
978                                 }
979                                 
980                                 PropertyTokens += dataiter->first;
981                                 PropertyTokens += "=";
982                                 PropertyTokens += dataiter->second;
983                                 
984                         }
985                                 
986                 }
987                 
988                 if (PropertyTokens.size() > 0){
989                         ExcludeDateDataTokens[ObjectSeekCount] = PropertyTokens;
990                 }
991                         
992                 ExcludeDateData[ObjectSeekCount] = iter->second;
993                 
994                 ObjectSeekCount++;
995                 
996         }
997         
998         // Process the data from RELATED-TO.
999         
1000         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RELATED-TO");
1002         ObjectSeekCount = 0;
1003         
1004         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1005                 iter != DataReceived.end(); 
1006                 ++iter){
1007                 
1008                 RelatedToDataTokens.push_back("");
1009                 RelatedToDataRelationType.push_back("");
1010                 RelatedToData.push_back("");
1011                         
1012                 bool TokenData = false;
1013                 string PropertyTokens;
1014                 
1015                 PropertyNameData = (string*)&iter->first;
1016                 
1017                 PropertyData = SplitValues(*PropertyNameData);
1018                         
1019                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1020                         dataiter != PropertyData.end(); dataiter++){
1021                         
1022                         if (dataiter->first == "RELTYPE"){
1023                                 
1024                                 RelatedToDataRelationType[ObjectSeekCount] = dataiter->second;
1025                                 
1026                         } else {
1027                                 
1028                                 if (TokenData == false){
1029                                         TokenData = true;
1030                                 } else {
1031                                         PropertyTokens += ";";
1032                                 }
1033                                 
1034                                 PropertyTokens += dataiter->first;
1035                                 PropertyTokens += "=";
1036                                 PropertyTokens += dataiter->second;
1037                                 
1038                         }
1039                                 
1040                 }
1041                 
1042                 if (PropertyTokens.size() > 0){
1043                         RelatedToDataTokens[ObjectSeekCount] = PropertyTokens;
1044                 }
1045                         
1046                 RelatedToData[ObjectSeekCount] = iter->second;
1047                 
1048                 ObjectSeekCount++;
1049                 
1050         }
1051         
1052         // Process the data from RDATE.
1053         
1054         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "RDATE");
1056         ObjectSeekCount = 0;
1057         
1058         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1059                 iter != DataReceived.end(); 
1060                 ++iter){
1061                 
1062                 RecurranceDateDataTokens.push_back("");
1063                 RecurranceDateDataValue.push_back("");
1064                 RecurranceDateDataTimeZoneParam.push_back("");
1065                 RecurranceDateData.push_back("");
1066                         
1067                 bool TokenData = false;
1068                 string PropertyTokens;
1069                 
1070                 PropertyNameData = (string*)&iter->first;
1071                 
1072                 PropertyData = SplitValues(*PropertyNameData);
1073                         
1074                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1075                         dataiter != PropertyData.end(); dataiter++){
1076                         
1077                         if (dataiter->first == "VALUE"){
1078                                 
1079                                 RecurranceDateDataValue[ObjectSeekCount] = dataiter->second;
1080                                 
1081                         } else if (dataiter->first == "TZID"){
1082                                 
1083                                 RecurranceDateDataTimeZoneParam[ObjectSeekCount] = dataiter->second;
1084                                 
1085                         } else {
1086                                 
1087                                 if (TokenData == false){
1088                                         TokenData = true;
1089                                 } else {
1090                                         PropertyTokens += ";";
1091                                 }
1092                                 
1093                                 PropertyTokens += dataiter->first;
1094                                 PropertyTokens += "=";
1095                                 PropertyTokens += dataiter->second;
1096                                 
1097                         }
1098                                 
1099                 }
1100                 
1101                 if (PropertyTokens.size() > 0){
1102                         RecurranceDateDataTokens[ObjectSeekCount] = PropertyTokens;
1103                 }
1104                         
1105                 RecurranceDateData[ObjectSeekCount] = iter->second;
1106                 
1107                 ObjectSeekCount++;
1108                 
1109         }
1110         
1111         // Process the data from REQUEST-STATUS.
1112         
1113         DataReceived = ProcessTextVectors(&ObjectName, &ObjectData, true, "REQUEST-STATUS");
1115         ObjectSeekCount = 0;
1116         
1117         for(multimap<string,string>::iterator iter = DataReceived.begin(); 
1118                 iter != DataReceived.end(); 
1119                 ++iter){
1120                 
1121                 RequestStatusTokens.push_back("");
1122                 RequestStatusLanguage.push_back("");
1123                 RequestStatusData.push_back("");
1124                         
1125                 bool TokenData = false;
1126                 string PropertyTokens;
1127                 
1128                 PropertyNameData = (string*)&iter->first;
1129                 
1130                 PropertyData = SplitValues(*PropertyNameData);
1131                         
1132                 for(map<string,string>::iterator dataiter = PropertyData.begin();
1133                         dataiter != PropertyData.end(); dataiter++){
1134                         
1135                         if (dataiter->first == "LANGUAGE"){
1136                                 
1137                                 RequestStatusLanguage[ObjectSeekCount] = dataiter->second;
1138                                 
1139                         } else {
1140                                 
1141                                 if (TokenData == false){
1142                                         TokenData = true;
1143                                 } else {
1144                                         PropertyTokens += ";";
1145                                 }
1146                                 
1147                                 PropertyTokens += dataiter->first;
1148                                 PropertyTokens += "=";
1149                                 PropertyTokens += dataiter->second;
1150                                 
1151                         }
1152                                 
1153                 }
1154                 
1155                 if (PropertyTokens.size() > 0){
1156                         RequestStatusTokens[ObjectSeekCount] = PropertyTokens;
1157                 }
1158                         
1159                 RequestStatusData[ObjectSeekCount] = iter->second;
1160                 
1161                 ObjectSeekCount++;
1162                 
1163         }
1164         
1165         ObjectSeekCount = 0;
1166         
1167         // Process data from X-*
1168         
1169         for(vector<string>::iterator iter = ObjectName.begin(); 
1170                 iter != ObjectName.end(); ++iter){
1171                         
1172                 bool TokenData = false;
1173                 string PropertyTokens;
1174                 
1175                 if (iter->substr(0,2) == "X-" &&
1176                         iter->size() > 2){
1177                         
1178                         XTokensData.push_back(ObjectData[ObjectSeekCount]);
1179                         XTokensDataTokens.push_back(ObjectName[ObjectSeekCount]);
1180                                 
1181                 }
1182                 
1183                 ObjectSeekCount++;
1184                 
1185         }
1186         
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