1 // vcard34conv.cpp - vCard34Conv Object
3 // (c) 2012-2015 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include "vcard34conv.h"
21 #include "../version.h"
22 #include "../common/textprocessing.h"
28 #include <wx/tokenzr.h>
29 #include <wx/datetime.h>
32 // vcard.cpp - Deals with vCard 4.0 formatted files meeting the
33 // RFC 6350 specification.
35 vCard34Conv::vCard34Conv(){
37 // Setup the vCard34Conv object.
47 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
48 wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr,
49 wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut,
50 wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
51 std::map<wxString,wxString> *PropertyDataMap,
52 std::map<wxString,bool> *PropertyLockMap,
53 bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
55 // Convert and format data to vCard 4.0 specifications.
58 wxString wxSPropertySeg1Chopped;
59 size_t intPropertyLen;
61 if (ProcessItemData == TRUE){
63 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
65 wxSPropertySplit.GetNextToken();
66 wxSProperty = wxSPropertySplit.GetNextToken();
68 // Look for . in wxSPropertySeg1Ptr and remove all data before
71 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
72 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
77 wxSProperty = *wxSPropertyName;
82 // Go through each of the vCard 3.0 properties.
86 if (wxSProperty == wxT("EMAIL")){
88 if (ProcessItemData == TRUE){
90 intPropertyLen = wxSPropertySeg1Chopped.Len();
94 intPropertyLen = wxSPropertySeg1Ptr->Len();
98 std::map<int, int> SplitPoints;
99 std::map<int, int> SplitLength;
100 std::map<int, int>::iterator SLiter;
101 wxString PropertyData;
102 wxString PropertyName;
103 wxString PropertyValue;
104 wxString PropertyTokens;
105 bool FirstToken = TRUE;
106 int intPrevValue = 7;
108 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
109 *wxSPropertyDataNameOut = wxT("EMAIL");
110 *VCardV3Value = TRUE;
112 if (ProcessItemData == TRUE){
114 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
118 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
122 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
123 intiter != SplitPoints.end(); ++intiter){
125 SLiter = SplitLength.find(intiter->first);
127 if (ProcessItemData == TRUE){
129 if (FirstToken == TRUE){
131 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
136 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
142 if (FirstToken == TRUE){
144 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
149 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
155 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
156 PropertyName = PropertyElement.GetNextToken();
157 PropertyValue = PropertyElement.GetNextToken();
159 //ProcessCaptureStrings(&PropertyValue);
161 intPrevValue = intiter->second;
163 if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
169 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
171 if (ProcessItemData == FALSE){
173 PropertyName = wxT("PREF");
174 PropertyValue = wxT("50");
184 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
186 PropertyValue = wxT("home");
190 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
192 PropertyValue = wxT("work");
196 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
198 PropertyName = wxT("X-TYPE");
199 PropertyValue = wxT("other");
203 // Process properties.
205 if (PropertyName.IsEmpty()){
211 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
213 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
214 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
218 PropertyDataMap->erase(PropertyName);
219 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
220 PropertyLockMap->erase(PropertyName);
221 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
231 if (wxSProperty == wxT("ADR")){
233 if (ProcessItemData == TRUE){
235 intPropertyLen = wxSPropertySeg1Chopped.Len();
239 intPropertyLen = wxSPropertySeg1Ptr->Len();
243 std::map<int, int> SplitPoints;
244 std::map<int, int> SplitLength;
245 std::map<int, int>::iterator SLiter;
246 wxString PropertyData;
247 wxString PropertyName;
248 wxString PropertyValue;
249 wxString PropertyTokens;
250 bool FirstToken = TRUE;
251 int intPrevValue = 5;
253 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
254 *wxSPropertyDataNameOut = wxT("ADR");
255 *VCardV3Value = TRUE;
257 if (ProcessItemData == TRUE){
259 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
263 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
267 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
268 intiter != SplitPoints.end(); ++intiter){
270 SLiter = SplitLength.find(intiter->first);
272 if (ProcessItemData == TRUE){
274 if (FirstToken == TRUE){
276 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
281 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
287 if (FirstToken == TRUE){
289 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
294 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
300 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
301 PropertyName = PropertyElement.GetNextToken();
302 PropertyValue = PropertyElement.GetNextToken();
304 intPrevValue = intiter->second;
306 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
308 if (ProcessItemData == FALSE){
310 PropertyName = wxT("PREF");
311 PropertyValue = wxT("50");
321 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
323 PropertyValue = wxT("home");
327 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
329 PropertyValue = wxT("work");
333 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
335 PropertyName = wxT("X-TYPE");
336 PropertyValue = wxT("other");
340 // Process properties.
342 if (PropertyName.IsEmpty()){
348 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
350 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
351 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
355 PropertyDataMap->erase(PropertyName);
356 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
357 PropertyLockMap->erase(PropertyName);
358 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
368 if (wxSProperty == wxT("LABEL")){
370 if (ProcessItemData == TRUE){
372 intPropertyLen = wxSPropertySeg1Chopped.Len();
376 intPropertyLen = wxSPropertySeg1Ptr->Len();
380 std::map<int, int> SplitPoints;
381 std::map<int, int> SplitLength;
382 std::map<int, int>::iterator SLiter;
383 wxString PropertyData;
384 wxString PropertyName;
385 wxString PropertyValue;
386 wxString PropertyTokens;
387 bool FirstToken = TRUE;
388 int intPrevValue = 7;
390 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
391 *wxSPropertyDataNameOut = wxT("ADR");
392 *VCardV3Value = TRUE;
394 if (ProcessItemData == TRUE){
396 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
400 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
404 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
405 intiter != SplitPoints.end(); ++intiter){
407 SLiter = SplitLength.find(intiter->first);
409 if (ProcessItemData == TRUE){
411 if (FirstToken == TRUE){
413 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
418 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
424 if (FirstToken == TRUE){
426 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
431 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
437 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
438 PropertyName = PropertyElement.GetNextToken();
439 PropertyValue = PropertyElement.GetNextToken();
441 intPrevValue = intiter->second;
443 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
449 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
451 PropertyValue = wxT("home");
455 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
457 PropertyValue = wxT("work");
461 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
463 PropertyName = wxT("X-TYPE");
464 PropertyValue = wxT("other");
468 // Process properties.
470 if (PropertyName.IsEmpty()){
476 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
478 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
479 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
483 PropertyDataMap->erase(PropertyName);
484 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
485 PropertyLockMap->erase(PropertyName);
486 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
492 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
498 if (wxSProperty == wxT("IMPP")){
500 if (ProcessItemData == TRUE){
502 intPropertyLen = wxSPropertySeg1Chopped.Len();
506 intPropertyLen = wxSPropertySeg1Ptr->Len();
510 std::map<int, int> SplitPoints;
511 std::map<int, int> SplitLength;
512 std::map<int, int>::iterator SLiter;
513 wxString PropertyData;
514 wxString PropertyName;
515 wxString PropertyValue;
516 wxString PropertyTokens;
517 bool FirstToken = TRUE;
518 int intPrevValue = 6;
520 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
524 IMPPType = IMPPSplit.GetNextToken();
526 if (IMPPSplit.HasMoreTokens()){
528 IMPPData = IMPPSplit.GetNextToken();
530 if (IMPPType == wxT("ymsgr")){
532 IMPPType = wxT("yahoo");
536 *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
540 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
541 *wxSPropertyDataNameOut = wxT("IMPP");
542 *VCardV3Value = TRUE;
544 if (ProcessItemData == TRUE){
546 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
550 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
554 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
555 intiter != SplitPoints.end(); ++intiter){
557 SLiter = SplitLength.find(intiter->first);
559 if (ProcessItemData == TRUE){
561 if (FirstToken == TRUE){
563 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
568 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
574 if (FirstToken == TRUE){
576 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
581 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
587 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
588 PropertyName = PropertyElement.GetNextToken();
589 PropertyValue = PropertyElement.GetNextToken();
591 intPrevValue = intiter->second;
593 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
599 if (PropertyName == wxT("X-SERVICE-TYPE")){
605 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
607 PropertyValue = wxT("home");
611 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
613 PropertyValue = wxT("work");
617 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
619 PropertyName = wxT("X-TYPE");
620 PropertyValue = wxT("other");
624 // Process properties.
626 if (PropertyName.IsEmpty()){
632 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
634 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
635 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
639 PropertyDataMap->erase(PropertyName);
640 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
641 PropertyLockMap->erase(PropertyName);
642 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
652 if (wxSProperty == wxT("TEL")){
654 if (ProcessItemData == TRUE){
656 intPropertyLen = wxSPropertySeg1Chopped.Len();
660 intPropertyLen = wxSPropertySeg1Ptr->Len();
664 std::map<int, int> SplitPoints;
665 std::map<int, int> SplitLength;
666 std::map<int, int>::iterator SLiter;
667 std::map<wxString, wxString> TelType;
668 wxString PropertyData;
669 wxString PropertyName;
670 wxString PropertyValue;
671 wxString PropertyTokens;
672 bool FirstToken = TRUE;
673 int intPrevValue = 5;
675 wxSPropertyDataOut->Append(wxT("tel:"));
676 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
677 *wxSPropertyDataNameOut = wxT("TEL");
678 *VCardV3Value = TRUE;
680 if (ProcessItemData == TRUE){
682 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
686 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
690 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
691 intiter != SplitPoints.end(); ++intiter){
693 SLiter = SplitLength.find(intiter->first);
695 if (ProcessItemData == TRUE){
697 if (FirstToken == TRUE){
699 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
704 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
710 if (FirstToken == TRUE){
712 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
717 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
723 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
724 PropertyName = PropertyElement.GetNextToken();
725 PropertyValue = PropertyElement.GetNextToken();
727 intPrevValue = intiter->second;
729 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
735 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
737 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
742 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
744 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
749 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
751 PropertyName = wxT("X-TYPE");
752 PropertyValue = wxT("other");
756 // Process the telephone type options.
760 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
762 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
769 if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
771 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
778 if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
780 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
787 if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
789 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
796 if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
798 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
805 if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
807 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
814 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
816 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
821 if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
823 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
824 wxString TypeSplitData;
825 while (TypeSplit.HasMoreTokens()){
827 TypeSplitData = TypeSplit.GetNextToken();
828 TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
829 TypeSplitData.clear();
835 // Process properties.
837 if (PropertyName.IsEmpty()){
843 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
845 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
846 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
850 PropertyDataMap->erase(PropertyName);
851 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
852 PropertyLockMap->erase(PropertyName);
853 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
859 wxString TelFinalString;
860 bool TelFirstToken = TRUE;
862 for (std::map<wxString, wxString>::iterator intiter = TelType.begin();
863 intiter != TelType.end(); ++intiter){
865 // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
867 if (TelFirstToken == TRUE){
869 TelFinalString.Append(wxT("\""));
870 TelFinalString.Append(intiter->first);
871 TelFirstToken = FALSE;
875 TelFinalString.Append(wxT(","));
876 TelFinalString.Append(intiter->first);
882 if (TelFirstToken == FALSE){
884 TelFinalString.Append(wxT("\""));
888 if (!TelFinalString.IsEmpty()){
890 if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
892 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
893 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
897 PropertyDataMap->erase(PropertyName);
898 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
899 PropertyLockMap->erase(PropertyName);
900 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
910 if (wxSProperty == wxT("X-ABRELATEDNAMES")){
912 if (ProcessItemData == TRUE){
914 intPropertyLen = wxSPropertySeg1Chopped.Len();
918 intPropertyLen = wxSPropertySeg1Ptr->Len();
922 std::map<int, int> SplitPoints;
923 std::map<int, int> SplitLength;
924 std::map<int, int>::iterator SLiter;
925 wxString PropertyData;
926 wxString PropertyName;
927 wxString PropertyValue;
928 wxString PropertyTokens;
929 bool FirstToken = TRUE;
930 int intPrevValue = 18;
932 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
933 *wxSPropertyDataNameOut = wxT("RELATED");
934 *VCardV3Value = TRUE;
936 if (ProcessItemData == TRUE){
938 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
942 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
946 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
947 intiter != SplitPoints.end(); ++intiter){
949 SLiter = SplitLength.find(intiter->first);
951 if (ProcessItemData == TRUE){
953 if (FirstToken == TRUE){
955 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
960 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
966 if (FirstToken == TRUE){
968 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
973 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
979 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
980 PropertyName = PropertyElement.GetNextToken();
981 PropertyValue = PropertyElement.GetNextToken();
983 //ProcessCaptureStrings(&PropertyValue);
985 intPrevValue = intiter->second;
987 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
993 // Process properties.
995 if (PropertyName.IsEmpty()){
1001 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1003 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1004 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1008 PropertyDataMap->erase(PropertyName);
1009 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1010 PropertyLockMap->erase(PropertyName);
1011 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1021 if (wxSProperty == wxT("URL")){
1023 if (ProcessItemData == TRUE){
1025 intPropertyLen = wxSPropertySeg1Chopped.Len();
1029 intPropertyLen = wxSPropertySeg1Ptr->Len();
1033 std::map<int, int> SplitPoints;
1034 std::map<int, int> SplitLength;
1035 std::map<int, int>::iterator SLiter;
1036 wxString PropertyData;
1037 wxString PropertyName;
1038 wxString PropertyValue;
1039 wxString PropertyTokens;
1040 bool FirstToken = TRUE;
1041 int intPrevValue = 5;
1043 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1044 *wxSPropertyDataNameOut = wxT("URL");
1045 *VCardV3Value = TRUE;
1047 if (ProcessItemData == TRUE){
1049 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1053 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1057 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1058 intiter != SplitPoints.end(); ++intiter){
1060 SLiter = SplitLength.find(intiter->first);
1062 if (ProcessItemData == TRUE){
1064 if (FirstToken == TRUE){
1066 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1071 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1077 if (FirstToken == TRUE){
1079 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1084 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1090 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1091 PropertyName = PropertyElement.GetNextToken();
1092 PropertyValue = PropertyElement.GetNextToken();
1094 intPrevValue = intiter->second;
1096 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
1102 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
1104 PropertyValue = wxT("home");
1108 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
1110 PropertyValue = wxT("work");
1114 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
1116 PropertyName = wxT("X-TYPE");
1117 PropertyValue = wxT("other");
1121 // Process properties.
1123 if (PropertyName.IsEmpty()){
1129 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1131 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1132 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1136 PropertyDataMap->erase(PropertyName);
1137 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1138 PropertyLockMap->erase(PropertyName);
1139 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1149 if (wxSProperty == wxT("TITLE")){
1151 if (ProcessItemData == TRUE){
1153 intPropertyLen = wxSPropertySeg1Chopped.Len();
1157 intPropertyLen = wxSPropertySeg1Ptr->Len();
1161 std::map<int, int> SplitPoints;
1162 std::map<int, int> SplitLength;
1163 std::map<int, int>::iterator SLiter;
1164 wxString PropertyData;
1165 wxString PropertyName;
1166 wxString PropertyValue;
1167 wxString PropertyTokens;
1168 bool FirstToken = TRUE;
1169 int intPrevValue = 7;
1171 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1172 *wxSPropertyDataNameOut = wxT("TITLE");
1173 *VCardV3Value = TRUE;
1175 if (ProcessItemData == TRUE){
1177 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1181 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1185 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1186 intiter != SplitPoints.end(); ++intiter){
1188 SLiter = SplitLength.find(intiter->first);
1190 if (ProcessItemData == TRUE){
1192 if (FirstToken == TRUE){
1194 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1199 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1205 if (FirstToken == TRUE){
1207 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1212 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1218 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1219 PropertyName = PropertyElement.GetNextToken();
1220 PropertyValue = PropertyElement.GetNextToken();
1222 intPrevValue = intiter->second;
1224 // Process properties.
1226 if (PropertyName.IsEmpty()){
1232 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1234 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1235 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1239 PropertyDataMap->erase(PropertyName);
1240 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1241 PropertyLockMap->erase(PropertyName);
1242 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1252 if (wxSProperty == wxT("FN")){
1254 if (ProcessItemData == TRUE){
1256 intPropertyLen = wxSPropertySeg1Chopped.Len();
1260 intPropertyLen = wxSPropertySeg1Ptr->Len();
1264 std::map<int, int> SplitPoints;
1265 std::map<int, int> SplitLength;
1266 std::map<int, int>::iterator SLiter;
1267 wxString PropertyData;
1268 wxString PropertyName;
1269 wxString PropertyValue;
1270 wxString PropertyTokens;
1271 bool FirstToken = TRUE;
1272 int intPrevValue = 4;
1274 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1275 *wxSPropertyDataNameOut = wxT("FN");
1276 *VCardV3Value = TRUE;
1278 if (ProcessItemData == TRUE){
1280 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1284 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1288 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1289 intiter != SplitPoints.end(); ++intiter){
1291 SLiter = SplitLength.find(intiter->first);
1293 if (ProcessItemData == TRUE){
1295 if (FirstToken == TRUE){
1297 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1302 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1308 if (FirstToken == TRUE){
1310 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1315 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1321 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1322 PropertyName = PropertyElement.GetNextToken();
1323 PropertyValue = PropertyElement.GetNextToken();
1325 intPrevValue = intiter->second;
1327 // Process properties.
1329 if (PropertyName.IsEmpty()){
1335 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1337 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1338 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1342 PropertyDataMap->erase(PropertyName);
1343 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1344 PropertyLockMap->erase(PropertyName);
1345 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1355 if (wxSProperty == wxT("N")){
1357 if (ProcessItemData == TRUE){
1359 intPropertyLen = wxSPropertySeg1Chopped.Len();
1363 intPropertyLen = wxSPropertySeg1Ptr->Len();
1367 std::map<int, int> SplitPoints;
1368 std::map<int, int> SplitLength;
1369 std::map<int, int>::iterator SLiter;
1370 wxString PropertyData;
1371 wxString PropertyName;
1372 wxString PropertyValue;
1373 wxString PropertyTokens;
1374 bool FirstToken = TRUE;
1375 int intPrevValue = 3;
1377 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1378 *wxSPropertyDataNameOut = wxT("N");
1379 *VCardV3Value = TRUE;
1381 if (ProcessItemData == TRUE){
1383 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1387 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1391 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1392 intiter != SplitPoints.end(); ++intiter){
1394 SLiter = SplitLength.find(intiter->first);
1396 if (ProcessItemData == TRUE){
1398 if (FirstToken == TRUE){
1400 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1405 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1411 if (FirstToken == TRUE){
1413 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1418 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1424 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1425 PropertyName = PropertyElement.GetNextToken();
1426 PropertyValue = PropertyElement.GetNextToken();
1428 intPrevValue = intiter->second;
1430 // Process properties.
1432 if (PropertyName.IsEmpty()){
1438 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1440 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1441 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1445 PropertyDataMap->erase(PropertyName);
1446 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1447 PropertyLockMap->erase(PropertyName);
1448 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1458 if (wxSProperty == wxT("UID")){
1460 if (ProcessItemData == TRUE){
1462 intPropertyLen = wxSPropertySeg1Chopped.Len();
1466 intPropertyLen = wxSPropertySeg1Ptr->Len();
1470 std::map<int, int> SplitPoints;
1471 std::map<int, int> SplitLength;
1472 std::map<int, int>::iterator SLiter;
1473 wxString PropertyData;
1474 wxString PropertyName;
1475 wxString PropertyValue;
1476 wxString PropertyTokens;
1477 bool FirstToken = TRUE;
1478 int intPrevValue = 5;
1480 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1481 *wxSPropertyDataNameOut = wxT("UID");
1482 *VCardV3Value = TRUE;
1484 if (ProcessItemData == TRUE){
1486 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1490 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1494 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1495 intiter != SplitPoints.end(); ++intiter){
1497 SLiter = SplitLength.find(intiter->first);
1499 if (ProcessItemData == TRUE){
1501 if (FirstToken == TRUE){
1503 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1508 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1514 if (FirstToken == TRUE){
1516 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1521 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1527 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1528 PropertyName = PropertyElement.GetNextToken();
1529 PropertyValue = PropertyElement.GetNextToken();
1531 intPrevValue = intiter->second;
1533 // Process properties.
1535 if (PropertyName.IsEmpty()){
1541 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1543 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1544 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1548 PropertyDataMap->erase(PropertyName);
1549 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1550 PropertyLockMap->erase(PropertyName);
1551 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1561 if (wxSProperty == wxT("NICKNAME")){
1563 if (ProcessItemData == TRUE){
1565 intPropertyLen = wxSPropertySeg1Chopped.Len();
1569 intPropertyLen = wxSPropertySeg1Ptr->Len();
1573 std::map<int, int> SplitPoints;
1574 std::map<int, int> SplitLength;
1575 std::map<int, int>::iterator SLiter;
1576 wxString PropertyData;
1577 wxString PropertyName;
1578 wxString PropertyValue;
1579 wxString PropertyTokens;
1580 bool FirstToken = TRUE;
1581 int intPrevValue = 10;
1583 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1584 *wxSPropertyDataNameOut = wxT("NICKNAME");
1585 *VCardV3Value = TRUE;
1587 if (ProcessItemData == TRUE){
1589 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1593 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1597 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1598 intiter != SplitPoints.end(); ++intiter){
1600 SLiter = SplitLength.find(intiter->first);
1602 if (ProcessItemData == TRUE){
1604 if (FirstToken == TRUE){
1606 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1611 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1617 if (FirstToken == TRUE){
1619 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1624 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1630 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1631 PropertyName = PropertyElement.GetNextToken();
1632 PropertyValue = PropertyElement.GetNextToken();
1634 intPrevValue = intiter->second;
1636 // Process properties.
1638 if (PropertyName.IsEmpty()){
1644 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1646 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1647 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1651 PropertyDataMap->erase(PropertyName);
1652 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1653 PropertyLockMap->erase(PropertyName);
1654 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1664 if (wxSProperty == wxT("GENDER")){
1666 if (ProcessItemData == TRUE){
1668 intPropertyLen = wxSPropertySeg1Chopped.Len();
1672 intPropertyLen = wxSPropertySeg1Ptr->Len();
1676 std::map<int, int> SplitPoints;
1677 std::map<int, int> SplitLength;
1678 std::map<int, int>::iterator SLiter;
1679 wxString PropertyData;
1680 wxString PropertyName;
1681 wxString PropertyValue;
1682 wxString PropertyTokens;
1683 bool FirstToken = TRUE;
1684 int intPrevValue = 8;
1686 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1687 *wxSPropertyDataNameOut = wxT("GENDER");
1688 *VCardV3Value = TRUE;
1690 if (ProcessItemData == TRUE){
1692 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1696 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1700 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1701 intiter != SplitPoints.end(); ++intiter){
1703 SLiter = SplitLength.find(intiter->first);
1705 if (ProcessItemData == TRUE){
1707 if (FirstToken == TRUE){
1709 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1714 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1720 if (FirstToken == TRUE){
1722 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1727 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1733 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1734 PropertyName = PropertyElement.GetNextToken();
1735 PropertyValue = PropertyElement.GetNextToken();
1737 intPrevValue = intiter->second;
1739 // Process properties.
1741 if (PropertyName.IsEmpty()){
1747 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1749 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1750 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1754 PropertyDataMap->erase(PropertyName);
1755 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1756 PropertyLockMap->erase(PropertyName);
1757 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1767 if (wxSProperty == wxT("BDAY")){
1769 if (ProcessItemData == TRUE){
1771 intPropertyLen = wxSPropertySeg1Chopped.Len();
1775 intPropertyLen = wxSPropertySeg1Ptr->Len();
1779 std::map<int, int> SplitPoints;
1780 std::map<int, int> SplitLength;
1781 std::map<int, int>::iterator SLiter;
1782 wxString PropertyData;
1783 wxString PropertyName;
1784 wxString PropertyValue;
1785 wxString PropertyTokens;
1786 wxString PropertyXOmitYear;
1787 bool FirstToken = TRUE;
1788 int intPrevValue = 6;
1790 *wxSPropertyDataNameOut = wxT("BDAY");
1791 *VCardV3Value = TRUE;
1793 if (ProcessItemData == TRUE){
1795 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1799 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1803 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1804 intiter != SplitPoints.end(); ++intiter){
1806 SLiter = SplitLength.find(intiter->first);
1808 if (ProcessItemData == TRUE){
1810 if (FirstToken == TRUE){
1812 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1817 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1823 if (FirstToken == TRUE){
1825 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1830 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1836 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1837 PropertyName = PropertyElement.GetNextToken();
1838 PropertyValue = PropertyElement.GetNextToken();
1840 intPrevValue = intiter->second;
1842 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1843 PropertyXOmitYear = PropertyValue;
1846 // Process properties.
1848 if (PropertyName.IsEmpty()){
1854 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1856 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1857 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1861 PropertyDataMap->erase(PropertyName);
1862 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1863 PropertyLockMap->erase(PropertyName);
1864 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1870 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1871 // year matches the X-APPLE-OMIT-YEAR value.
1873 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1878 DateProc = DateSplit.GetNextToken();
1880 if (DateProc == PropertyXOmitYear){
1882 FinalDate.Append(wxT("--"));
1886 FinalDate.Append(DateProc);
1891 DateProc = DateSplit.GetNextToken();
1893 FinalDate.Append(DateProc);
1896 DateProc = DateSplit.GetNextToken();
1898 FinalDate.Append(DateProc);
1900 wxSPropertyDataOut->Append(FinalDate);
1906 if (wxSProperty == wxT("ANNIVERSARY")){
1908 if (ProcessItemData == TRUE){
1910 intPropertyLen = wxSPropertySeg1Chopped.Len();
1914 intPropertyLen = wxSPropertySeg1Ptr->Len();
1918 std::map<int, int> SplitPoints;
1919 std::map<int, int> SplitLength;
1920 std::map<int, int>::iterator SLiter;
1921 wxString PropertyData;
1922 wxString PropertyName;
1923 wxString PropertyValue;
1924 wxString PropertyTokens;
1925 wxString PropertyXOmitYear;
1926 bool FirstToken = TRUE;
1927 int intPrevValue = 13;
1929 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
1930 *VCardV3Value = TRUE;
1932 if (ProcessItemData == TRUE){
1934 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1938 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1942 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1943 intiter != SplitPoints.end(); ++intiter){
1945 SLiter = SplitLength.find(intiter->first);
1947 if (ProcessItemData == TRUE){
1949 if (FirstToken == TRUE){
1951 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1956 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1962 if (FirstToken == TRUE){
1964 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1969 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1975 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1976 PropertyName = PropertyElement.GetNextToken();
1977 PropertyValue = PropertyElement.GetNextToken();
1979 intPrevValue = intiter->second;
1981 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1982 PropertyXOmitYear = PropertyValue;
1985 // Process properties.
1987 if (PropertyName.IsEmpty()){
1993 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1995 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1996 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2000 PropertyDataMap->erase(PropertyName);
2001 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2002 PropertyLockMap->erase(PropertyName);
2003 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2009 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
2010 // year matches the X-APPLE-OMIT-YEAR value.
2012 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
2017 DateProc = DateSplit.GetNextToken();
2019 if (DateProc == PropertyXOmitYear){
2021 FinalDate.Append(wxT("--"));
2025 FinalDate.Append(DateProc);
2030 DateProc = DateSplit.GetNextToken();
2032 FinalDate.Append(DateProc);
2035 DateProc = DateSplit.GetNextToken();
2037 FinalDate.Append(DateProc);
2039 wxSPropertyDataOut->Append(FinalDate);
2043 // TZ - Not sure how to process this correctly. So data
2044 // is kept as X-VCARD3-TZ for the time being.
2046 if (wxSProperty == wxT("TZ")){
2048 if (ProcessItemData == TRUE){
2050 intPropertyLen = wxSPropertySeg1Chopped.Len();
2054 intPropertyLen = wxSPropertySeg1Ptr->Len();
2058 std::map<int, int> SplitPoints;
2059 std::map<int, int> SplitLength;
2060 std::map<int, int>::iterator SLiter;
2061 wxString PropertyData;
2062 wxString PropertyName;
2063 wxString PropertyValue;
2064 wxString PropertyTokens;
2065 wxString PropertyXOmitYear;
2066 bool FirstToken = TRUE;
2067 int intPrevValue = 4;
2069 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2070 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
2071 *VCardV3Value = TRUE;
2073 if (ProcessItemData == TRUE){
2075 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2079 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2083 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2084 intiter != SplitPoints.end(); ++intiter){
2086 SLiter = SplitLength.find(intiter->first);
2088 if (ProcessItemData == TRUE){
2090 if (FirstToken == TRUE){
2092 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2097 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2103 if (FirstToken == TRUE){
2105 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2110 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2116 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2117 PropertyName = PropertyElement.GetNextToken();
2118 PropertyValue = PropertyElement.GetNextToken();
2120 intPrevValue = intiter->second;
2122 // Process properties.
2124 if (PropertyName.IsEmpty()){
2130 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2132 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2133 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2137 PropertyDataMap->erase(PropertyName);
2138 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2139 PropertyLockMap->erase(PropertyName);
2140 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2150 if (wxSProperty == wxT("ROLE")){
2152 if (ProcessItemData == TRUE){
2154 intPropertyLen = wxSPropertySeg1Chopped.Len();
2158 intPropertyLen = wxSPropertySeg1Ptr->Len();
2162 std::map<int, int> SplitPoints;
2163 std::map<int, int> SplitLength;
2164 std::map<int, int>::iterator SLiter;
2165 wxString PropertyData;
2166 wxString PropertyName;
2167 wxString PropertyValue;
2168 wxString PropertyTokens;
2169 wxString PropertyXOmitYear;
2170 bool FirstToken = TRUE;
2171 int intPrevValue = 6;
2173 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2174 *wxSPropertyDataNameOut = wxT("ROLE");
2175 *VCardV3Value = TRUE;
2177 if (ProcessItemData == TRUE){
2179 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2183 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2187 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2188 intiter != SplitPoints.end(); ++intiter){
2190 SLiter = SplitLength.find(intiter->first);
2192 if (ProcessItemData == TRUE){
2194 if (FirstToken == TRUE){
2196 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2201 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2207 if (FirstToken == TRUE){
2209 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2214 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2220 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2221 PropertyName = PropertyElement.GetNextToken();
2222 PropertyValue = PropertyElement.GetNextToken();
2224 intPrevValue = intiter->second;
2226 // Process properties.
2228 if (PropertyName.IsEmpty()){
2234 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2236 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2237 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2241 PropertyDataMap->erase(PropertyName);
2242 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2243 PropertyLockMap->erase(PropertyName);
2244 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2254 if (wxSProperty == wxT("ORG")){
2256 if (ProcessItemData == TRUE){
2258 intPropertyLen = wxSPropertySeg1Chopped.Len();
2262 intPropertyLen = wxSPropertySeg1Ptr->Len();
2266 std::map<int, int> SplitPoints;
2267 std::map<int, int> SplitLength;
2268 std::map<int, int>::iterator SLiter;
2269 wxString PropertyData;
2270 wxString PropertyName;
2271 wxString PropertyValue;
2272 wxString PropertyTokens;
2273 wxString PropertyXOmitYear;
2274 bool FirstToken = TRUE;
2275 int intPrevValue = 5;
2277 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2278 *wxSPropertyDataNameOut = wxT("ORG");
2279 *VCardV3Value = TRUE;
2281 if (ProcessItemData == TRUE){
2283 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2287 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2291 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2292 intiter != SplitPoints.end(); ++intiter){
2294 SLiter = SplitLength.find(intiter->first);
2296 if (ProcessItemData == TRUE){
2298 if (FirstToken == TRUE){
2300 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2305 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2311 if (FirstToken == TRUE){
2313 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2318 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2324 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2325 PropertyName = PropertyElement.GetNextToken();
2326 PropertyValue = PropertyElement.GetNextToken();
2328 intPrevValue = intiter->second;
2330 // Process properties.
2332 if (PropertyName.IsEmpty()){
2338 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2340 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2341 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2345 PropertyDataMap->erase(PropertyName);
2346 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2347 PropertyLockMap->erase(PropertyName);
2348 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2358 if (wxSProperty == wxT("NOTE")){
2360 if (ProcessItemData == TRUE){
2362 intPropertyLen = wxSPropertySeg1Chopped.Len();
2366 intPropertyLen = wxSPropertySeg1Ptr->Len();
2370 std::map<int, int> SplitPoints;
2371 std::map<int, int> SplitLength;
2372 std::map<int, int>::iterator SLiter;
2373 wxString PropertyData;
2374 wxString PropertyName;
2375 wxString PropertyValue;
2376 wxString PropertyTokens;
2377 wxString PropertyXOmitYear;
2378 bool FirstToken = TRUE;
2379 int intPrevValue = 6;
2381 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2382 *wxSPropertyDataNameOut = wxT("NOTE");
2383 *VCardV3Value = TRUE;
2385 if (ProcessItemData == TRUE){
2387 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2391 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2395 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2396 intiter != SplitPoints.end(); ++intiter){
2398 SLiter = SplitLength.find(intiter->first);
2400 if (ProcessItemData == TRUE){
2402 if (FirstToken == TRUE){
2404 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2409 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2415 if (FirstToken == TRUE){
2417 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2422 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2428 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2429 PropertyName = PropertyElement.GetNextToken();
2430 PropertyValue = PropertyElement.GetNextToken();
2432 intPrevValue = intiter->second;
2434 // Process properties.
2436 if (PropertyName.IsEmpty()){
2442 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2444 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2445 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2449 PropertyDataMap->erase(PropertyName);
2450 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2451 PropertyLockMap->erase(PropertyName);
2452 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2462 if (wxSProperty == wxT("PHOTO")){
2464 if (ProcessItemData == TRUE){
2466 intPropertyLen = wxSPropertySeg1Chopped.Len();
2470 intPropertyLen = wxSPropertySeg1Ptr->Len();
2474 std::map<int, int> SplitPoints;
2475 std::map<int, int> SplitLength;
2476 std::map<int, int>::iterator SLiter;
2477 std::map<wxString, wxString> SplitData;
2478 wxString PropertyData;
2479 wxString PropertyName;
2480 wxString PropertyValue;
2481 wxString PropertyTokens;
2482 wxString PropertyXOmitYear;
2483 int intPrevValue = 7;
2485 *wxSPropertyDataNameOut = wxT("PHOTO");
2486 *VCardV3Value = TRUE;
2488 if (ProcessItemData == TRUE){
2490 SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2494 SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2498 wxString wxSMIMEType;
2499 wxString wxSEncType;
2501 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
2502 intiter != SplitData.end(); ++intiter){
2504 PropertyName = intiter->first;
2505 PropertyValue = intiter->second;
2507 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2508 wxSEncType = wxT("base64");
2512 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
2513 wxSMIMEType = wxT("image/png");
2515 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
2516 wxSMIMEType = wxT("image/jpeg");
2518 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
2519 wxSMIMEType = wxT("image/gif");
2521 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
2522 wxSMIMEType = wxT("image/bmp");
2524 } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
2525 wxSMIMEType = wxT("image/unknown");
2529 // Process properties.
2531 if (PropertyName.IsEmpty()){
2537 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2539 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2540 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2544 PropertyDataMap->erase(PropertyName);
2545 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2546 PropertyLockMap->erase(PropertyName);
2547 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2553 wxSPropertyDataOut->Append(wxT("data:"));
2554 wxSPropertyDataOut->Append(wxSMIMEType);
2555 wxSPropertyDataOut->Append(wxT(";"));
2556 wxSPropertyDataOut->Append(wxSEncType);
2557 wxSPropertyDataOut->Append(wxT(","));
2558 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2564 if (wxSProperty == wxT("SOUND")){
2566 if (ProcessItemData == TRUE){
2568 intPropertyLen = wxSPropertySeg1Chopped.Len();
2572 intPropertyLen = wxSPropertySeg1Ptr->Len();
2576 std::map<int, int> SplitPoints;
2577 std::map<int, int> SplitLength;
2578 std::map<int, int>::iterator SLiter;
2579 wxString PropertyData;
2580 wxString PropertyName;
2581 wxString PropertyValue;
2582 wxString PropertyTokens;
2583 wxString PropertyXOmitYear;
2584 bool FirstToken = TRUE;
2585 int intPrevValue = 7;
2587 *wxSPropertyDataNameOut = wxT("SOUND");
2588 *VCardV3Value = TRUE;
2590 if (ProcessItemData == TRUE){
2592 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2596 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2600 wxString wxSMIMEType;
2601 wxString wxSEncType;
2603 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2604 intiter != SplitPoints.end(); ++intiter){
2606 SLiter = SplitLength.find(intiter->first);
2608 if (ProcessItemData == TRUE){
2610 if (FirstToken == TRUE){
2612 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2617 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2623 if (FirstToken == TRUE){
2625 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2630 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2636 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2637 PropertyName = PropertyElement.GetNextToken();
2638 PropertyValue = PropertyElement.GetNextToken();
2640 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2641 wxSEncType = wxT("base64");
2645 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
2646 wxSMIMEType = PropertyValue;
2650 intPrevValue = intiter->second;
2652 // Process properties.
2654 if (PropertyName.IsEmpty()){
2660 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2662 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2663 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2667 PropertyDataMap->erase(PropertyName);
2668 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2669 PropertyLockMap->erase(PropertyName);
2670 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2676 wxSPropertyDataOut->Append(wxT("data:"));
2677 wxSPropertyDataOut->Append(wxSMIMEType);
2678 wxSPropertyDataOut->Append(wxT(";"));
2679 wxSPropertyDataOut->Append(wxSEncType);
2680 wxSPropertyDataOut->Append(wxT(","));
2681 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2685 // Look for backward compatability vCard 4.0 properties.
2689 if (wxSProperty == wxT("X-VCARD4-FN")){
2691 if (ProcessItemData == TRUE){
2693 intPropertyLen = wxSPropertySeg1Chopped.Len();
2697 intPropertyLen = wxSPropertySeg1Ptr->Len();
2698 *wxSPropertyDataNameOut = wxT("FN");
2702 std::map<int, int> SplitPoints;
2703 std::map<int, int> SplitLength;
2704 std::map<int, int>::iterator SLiter;
2705 std::map<wxString, bool>::iterator BIter;;
2706 wxString PropertyData;
2707 wxString PropertyName;
2708 wxString PropertyValue;
2709 wxString PropertyTokens;
2710 bool FirstToken = TRUE;
2711 int intPrevValue = 13;
2713 if (ProcessItemData == TRUE){
2715 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2719 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2723 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2724 intiter != SplitPoints.end(); ++intiter){
2726 SLiter = SplitLength.find(intiter->first);
2728 if (ProcessItemData == TRUE){
2730 if (FirstToken == TRUE){
2732 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2737 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2743 if (FirstToken == TRUE){
2745 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2750 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2756 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2757 PropertyName = PropertyElement.GetNextToken();
2758 PropertyValue = PropertyElement.GetNextToken();
2760 intPrevValue = intiter->second;
2762 // Process properties.
2764 // Check if there is a lock on the property value. If there is a lock then
2765 // the property value cannot be changed.
2767 if (PropertyName.IsEmpty()){
2773 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2775 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2777 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2781 PropertyDataMap->erase(PropertyName);
2782 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2790 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2791 *XVCardV4Value = TRUE;
2797 if (wxSProperty == wxT("X-VCARD4-N")){
2799 if (ProcessItemData == TRUE){
2801 intPropertyLen = wxSPropertySeg1Chopped.Len();
2805 intPropertyLen = wxSPropertySeg1Ptr->Len();
2809 std::map<int, int> SplitPoints;
2810 std::map<int, int> SplitLength;
2811 std::map<int, int>::iterator SLiter;
2812 std::map<wxString, bool>::iterator BIter;;
2813 wxString PropertyData;
2814 wxString PropertyName;
2815 wxString PropertyValue;
2816 wxString PropertyTokens;
2817 bool FirstToken = TRUE;
2818 int intPrevValue = 12;
2820 if (ProcessItemData == TRUE){
2822 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2826 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2827 *wxSPropertyDataNameOut = wxT("N");
2831 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2832 intiter != SplitPoints.end(); ++intiter){
2834 SLiter = SplitLength.find(intiter->first);
2836 if (ProcessItemData == TRUE){
2838 if (FirstToken == TRUE){
2840 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2845 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2851 if (FirstToken == TRUE){
2853 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2858 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2864 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2865 PropertyName = PropertyElement.GetNextToken();
2866 PropertyValue = PropertyElement.GetNextToken();
2868 intPrevValue = intiter->second;
2870 // Process properties.
2872 // Check if there is a lock on the property value. If there is a lock then
2873 // the property value cannot be changed.
2875 if (PropertyName.IsEmpty()){
2881 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2883 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2885 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2889 PropertyDataMap->erase(PropertyName);
2890 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2898 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2899 *XVCardV4Value = TRUE;
2903 // X-VCARD4-NICKNAME
2905 if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
2907 if (ProcessItemData == TRUE){
2909 intPropertyLen = wxSPropertySeg1Chopped.Len();
2913 intPropertyLen = wxSPropertySeg1Ptr->Len();
2917 std::map<int, int> SplitPoints;
2918 std::map<int, int> SplitLength;
2919 std::map<int, int>::iterator SLiter;
2920 std::map<wxString, bool>::iterator BIter;;
2921 wxString PropertyData;
2922 wxString PropertyName;
2923 wxString PropertyValue;
2924 wxString PropertyTokens;
2925 bool FirstToken = TRUE;
2926 int intPrevValue = 19;
2928 if (ProcessItemData == TRUE){
2930 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2934 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2935 *wxSPropertyDataNameOut = wxT("NICKNAME");
2939 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2940 intiter != SplitPoints.end(); ++intiter){
2942 SLiter = SplitLength.find(intiter->first);
2944 if (ProcessItemData == TRUE){
2946 if (FirstToken == TRUE){
2948 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2953 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2959 if (FirstToken == TRUE){
2961 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2966 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2972 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2973 PropertyName = PropertyElement.GetNextToken();
2974 PropertyValue = PropertyElement.GetNextToken();
2976 intPrevValue = intiter->second;
2978 // Process properties.
2980 // Check if there is a lock on the property value. If there is a lock then
2981 // the property value cannot be changed.
2983 if (PropertyName.IsEmpty()){
2989 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2991 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2993 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2997 PropertyDataMap->erase(PropertyName);
2998 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3006 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3007 *XVCardV4Value = TRUE;
3013 if (wxSProperty == wxT("X-VCARD4-GENDER")){
3015 if (ProcessItemData == TRUE){
3017 intPropertyLen = wxSPropertySeg1Chopped.Len();
3021 intPropertyLen = wxSPropertySeg1Ptr->Len();
3025 std::map<int, int> SplitPoints;
3026 std::map<int, int> SplitLength;
3027 std::map<int, int>::iterator SLiter;
3028 std::map<wxString, bool>::iterator BIter;;
3029 wxString PropertyData;
3030 wxString PropertyName;
3031 wxString PropertyValue;
3032 wxString PropertyTokens;
3033 bool FirstToken = TRUE;
3034 int intPrevValue = 17;
3036 if (ProcessItemData == TRUE){
3038 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3042 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3043 *wxSPropertyDataNameOut = wxT("GENDER");
3047 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3048 intiter != SplitPoints.end(); ++intiter){
3050 SLiter = SplitLength.find(intiter->first);
3052 if (ProcessItemData == TRUE){
3054 if (FirstToken == TRUE){
3056 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3061 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3067 if (FirstToken == TRUE){
3069 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3074 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3080 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3081 PropertyName = PropertyElement.GetNextToken();
3082 PropertyValue = PropertyElement.GetNextToken();
3084 //ProcessCaptureStrings(&PropertyValue);
3086 intPrevValue = intiter->second;
3088 // Process properties.
3090 // Check if there is a lock on the property value. If there is a lock then
3091 // the property value cannot be changed.
3093 if (PropertyName.IsEmpty()){
3099 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3101 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3103 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3107 PropertyDataMap->erase(PropertyName);
3108 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3116 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3117 *XVCardV4Value = TRUE;
3123 if (wxSProperty == wxT("X-VCARD4-BDAY")){
3125 if (ProcessItemData == TRUE){
3127 intPropertyLen = wxSPropertySeg1Chopped.Len();
3131 intPropertyLen = wxSPropertySeg1Ptr->Len();
3135 std::map<int, int> SplitPoints;
3136 std::map<int, int> SplitLength;
3137 std::map<int, int>::iterator SLiter;
3138 std::map<wxString, bool>::iterator BIter;;
3139 wxString PropertyData;
3140 wxString PropertyName;
3141 wxString PropertyValue;
3142 wxString PropertyTokens;
3143 bool FirstToken = TRUE;
3144 int intPrevValue = 15;
3146 if (ProcessItemData == TRUE){
3148 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3152 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3153 *wxSPropertyDataNameOut = wxT("BDAY");
3157 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3158 intiter != SplitPoints.end(); ++intiter){
3160 SLiter = SplitLength.find(intiter->first);
3162 if (ProcessItemData == TRUE){
3164 if (FirstToken == TRUE){
3166 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3171 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3177 if (FirstToken == TRUE){
3179 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3184 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3190 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3191 PropertyName = PropertyElement.GetNextToken();
3192 PropertyValue = PropertyElement.GetNextToken();
3194 intPrevValue = intiter->second;
3196 // Process properties.
3198 // Check if there is a lock on the property value. If there is a lock then
3199 // the property value cannot be changed.
3201 if (PropertyName.IsEmpty()){
3207 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3209 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3211 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3215 PropertyDataMap->erase(PropertyName);
3216 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3224 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3225 *XVCardV4Value = TRUE;
3229 // X-VCARD4-ANNIVERSARY
3231 if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
3233 if (ProcessItemData == TRUE){
3235 intPropertyLen = wxSPropertySeg1Chopped.Len();
3239 intPropertyLen = wxSPropertySeg1Ptr->Len();
3243 std::map<int, int> SplitPoints;
3244 std::map<int, int> SplitLength;
3245 std::map<int, int>::iterator SLiter;
3246 std::map<wxString, bool>::iterator BIter;;
3247 wxString PropertyData;
3248 wxString PropertyName;
3249 wxString PropertyValue;
3250 wxString PropertyTokens;
3251 bool FirstToken = TRUE;
3252 int intPrevValue = 22;
3254 if (ProcessItemData == TRUE){
3256 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3260 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3261 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
3265 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3266 intiter != SplitPoints.end(); ++intiter){
3268 SLiter = SplitLength.find(intiter->first);
3270 if (ProcessItemData == TRUE){
3272 if (FirstToken == TRUE){
3274 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3279 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3285 if (FirstToken == TRUE){
3287 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3292 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3298 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3299 PropertyName = PropertyElement.GetNextToken();
3300 PropertyValue = PropertyElement.GetNextToken();
3302 intPrevValue = intiter->second;
3304 // Process properties.
3306 // Check if there is a lock on the property value. If there is a lock then
3307 // the property value cannot be changed.
3309 if (PropertyName.IsEmpty()){
3315 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3317 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3319 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3323 PropertyDataMap->erase(PropertyName);
3324 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3332 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3333 *XVCardV4Value = TRUE;
3339 if (wxSProperty == wxT("X-VCARD4-TZ")){
3341 if (ProcessItemData == TRUE){
3343 intPropertyLen = wxSPropertySeg1Chopped.Len();
3347 intPropertyLen = wxSPropertySeg1Ptr->Len();
3351 std::map<int, int> SplitPoints;
3352 std::map<int, int> SplitLength;
3353 std::map<int, int>::iterator SLiter;
3354 std::map<wxString, bool>::iterator BIter;;
3355 wxString PropertyData;
3356 wxString PropertyName;
3357 wxString PropertyValue;
3358 wxString PropertyTokens;
3359 bool FirstToken = TRUE;
3360 int intPrevValue = 13;
3362 if (ProcessItemData == TRUE){
3364 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3368 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3369 *wxSPropertyDataNameOut = wxT("TZ");
3373 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3374 intiter != SplitPoints.end(); ++intiter){
3376 SLiter = SplitLength.find(intiter->first);
3378 if (ProcessItemData == TRUE){
3380 if (FirstToken == TRUE){
3382 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3387 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3393 if (FirstToken == TRUE){
3395 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3400 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3406 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3407 PropertyName = PropertyElement.GetNextToken();
3408 PropertyValue = PropertyElement.GetNextToken();
3410 intPrevValue = intiter->second;
3412 // Process properties.
3414 // Check if there is a lock on the property value. If there is a lock then
3415 // the property value cannot be changed.
3417 if (PropertyName.IsEmpty()){
3423 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3425 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3427 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3431 PropertyDataMap->erase(PropertyName);
3432 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3440 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3441 *XVCardV4Value = TRUE;
3447 if (wxSProperty == wxT("X-VCARD4-ADR")){
3449 if (ProcessItemData == TRUE){
3451 intPropertyLen = wxSPropertySeg1Chopped.Len();
3455 intPropertyLen = wxSPropertySeg1Ptr->Len();
3459 std::map<int, int> SplitPoints;
3460 std::map<int, int> SplitLength;
3461 std::map<int, int>::iterator SLiter;
3462 std::map<wxString, bool>::iterator BIter;;
3463 wxString PropertyData;
3464 wxString PropertyName;
3465 wxString PropertyValue;
3466 wxString PropertyTokens;
3467 bool FirstToken = TRUE;
3468 int intPrevValue = 14;
3470 if (ProcessItemData == TRUE){
3472 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3476 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3477 *wxSPropertyDataNameOut = wxT("ADR");
3481 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3482 intiter != SplitPoints.end(); ++intiter){
3484 SLiter = SplitLength.find(intiter->first);
3486 if (ProcessItemData == TRUE){
3488 if (FirstToken == TRUE){
3490 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3495 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3501 if (FirstToken == TRUE){
3503 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3508 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3514 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3515 PropertyName = PropertyElement.GetNextToken();
3516 PropertyValue = PropertyElement.GetNextToken();
3518 intPrevValue = intiter->second;
3520 // Process properties.
3522 // Check if there is a lock on the property value. If there is a lock then
3523 // the property value cannot be changed.
3525 if (PropertyName.IsEmpty()){
3531 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3533 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3535 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3539 PropertyDataMap->erase(PropertyName);
3540 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3548 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3549 *XVCardV4Value = TRUE;
3555 if (wxSProperty == wxT("X-VCARD4-EMAIL")){
3557 if (ProcessItemData == TRUE){
3559 intPropertyLen = wxSPropertySeg1Chopped.Len();
3563 intPropertyLen = wxSPropertySeg1Ptr->Len();
3567 std::map<int, int> SplitPoints;
3568 std::map<int, int> SplitLength;
3569 std::map<int, int>::iterator SLiter;
3570 std::map<wxString, bool>::iterator BIter;;
3571 wxString PropertyData;
3572 wxString PropertyName;
3573 wxString PropertyValue;
3574 wxString PropertyTokens;
3575 bool FirstToken = TRUE;
3576 int intPrevValue = 16;
3578 if (ProcessItemData == TRUE){
3580 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3584 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3585 *wxSPropertyDataNameOut = wxT("EMAIL");
3589 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3590 intiter != SplitPoints.end(); ++intiter){
3592 SLiter = SplitLength.find(intiter->first);
3594 if (ProcessItemData == TRUE){
3596 if (FirstToken == TRUE){
3598 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3603 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3609 if (FirstToken == TRUE){
3611 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3616 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3622 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3623 PropertyName = PropertyElement.GetNextToken();
3624 PropertyValue = PropertyElement.GetNextToken();
3626 intPrevValue = intiter->second;
3628 // Process properties.
3630 // Check if there is a lock on the property value. If there is a lock then
3631 // the property value cannot be changed.
3633 if (PropertyName.IsEmpty()){
3639 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3641 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3643 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3647 PropertyDataMap->erase(PropertyName);
3648 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3656 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3657 *XVCardV4Value = TRUE;
3663 if (wxSProperty == wxT("X-VCARD4-IMPP")){
3665 if (ProcessItemData == TRUE){
3667 intPropertyLen = wxSPropertySeg1Chopped.Len();
3671 intPropertyLen = wxSPropertySeg1Ptr->Len();
3675 std::map<int, int> SplitPoints;
3676 std::map<int, int> SplitLength;
3677 std::map<int, int>::iterator SLiter;
3678 std::map<wxString, bool>::iterator BIter;;
3679 wxString PropertyData;
3680 wxString PropertyName;
3681 wxString PropertyValue;
3682 wxString PropertyTokens;
3683 bool FirstToken = TRUE;
3684 int intPrevValue = 15;
3686 if (ProcessItemData == TRUE){
3688 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3692 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3693 *wxSPropertyDataNameOut = wxT("IMPP");
3697 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3698 intiter != SplitPoints.end(); ++intiter){
3700 SLiter = SplitLength.find(intiter->first);
3702 if (ProcessItemData == TRUE){
3704 if (FirstToken == TRUE){
3706 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3711 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3717 if (FirstToken == TRUE){
3719 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3724 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3730 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3731 PropertyName = PropertyElement.GetNextToken();
3732 PropertyValue = PropertyElement.GetNextToken();
3734 intPrevValue = intiter->second;
3736 // Process properties.
3738 // Check if there is a lock on the property value. If there is a lock then
3739 // the property value cannot be changed.
3741 if (PropertyName.IsEmpty()){
3747 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3749 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3751 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3755 PropertyDataMap->erase(PropertyName);
3756 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3764 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3765 *XVCardV4Value = TRUE;
3771 if (wxSProperty == wxT("X-VCARD4-TEL")){
3773 if (ProcessItemData == TRUE){
3775 intPropertyLen = wxSPropertySeg1Chopped.Len();
3779 intPropertyLen = wxSPropertySeg1Ptr->Len();
3783 std::map<int, int> SplitPoints;
3784 std::map<int, int> SplitLength;
3785 std::map<int, int>::iterator SLiter;
3786 std::map<wxString, bool>::iterator BIter;;
3787 wxString PropertyData;
3788 wxString PropertyName;
3789 wxString PropertyValue;
3790 wxString PropertyTokens;
3791 bool FirstToken = TRUE;
3792 int intPrevValue = 14;
3794 if (ProcessItemData == TRUE){
3796 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3800 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3801 *wxSPropertyDataNameOut = wxT("TEL");
3805 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3806 intiter != SplitPoints.end(); ++intiter){
3808 SLiter = SplitLength.find(intiter->first);
3810 if (ProcessItemData == TRUE){
3812 if (FirstToken == TRUE){
3814 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3819 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3825 if (FirstToken == TRUE){
3827 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3832 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3838 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3839 PropertyName = PropertyElement.GetNextToken();
3840 PropertyValue = PropertyElement.GetNextToken();
3842 intPrevValue = intiter->second;
3844 // Process properties.
3846 // Check if there is a lock on the property value. If there is a lock then
3847 // the property value cannot be changed.
3849 if (PropertyName.IsEmpty()){
3855 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3857 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3859 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3863 PropertyDataMap->erase(PropertyName);
3864 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3872 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3873 *XVCardV4Value = TRUE;
3879 if (wxSProperty == wxT("X-VCARD4-LANG")){
3881 if (ProcessItemData == TRUE){
3883 intPropertyLen = wxSPropertySeg1Chopped.Len();
3887 intPropertyLen = wxSPropertySeg1Ptr->Len();
3891 std::map<int, int> SplitPoints;
3892 std::map<int, int> SplitLength;
3893 std::map<int, int>::iterator SLiter;
3894 std::map<wxString, bool>::iterator BIter;;
3895 wxString PropertyData;
3896 wxString PropertyName;
3897 wxString PropertyValue;
3898 wxString PropertyTokens;
3899 bool FirstToken = TRUE;
3900 int intPrevValue = 15;
3902 if (ProcessItemData == TRUE){
3904 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3908 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3909 *wxSPropertyDataNameOut = wxT("LANG");
3913 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3914 intiter != SplitPoints.end(); ++intiter){
3916 SLiter = SplitLength.find(intiter->first);
3918 if (ProcessItemData == TRUE){
3920 if (FirstToken == TRUE){
3922 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3927 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3933 if (FirstToken == TRUE){
3935 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3940 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3946 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3947 PropertyName = PropertyElement.GetNextToken();
3948 PropertyValue = PropertyElement.GetNextToken();
3950 intPrevValue = intiter->second;
3952 // Process properties.
3954 // Check if there is a lock on the property value. If there is a lock then
3955 // the property value cannot be changed.
3957 if (PropertyName.IsEmpty()){
3963 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3965 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3967 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3971 PropertyDataMap->erase(PropertyName);
3972 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3980 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3981 *XVCardV4Value = TRUE;
3987 if (wxSProperty == wxT("X-VCARD4-GEO")){
3989 if (ProcessItemData == TRUE){
3991 intPropertyLen = wxSPropertySeg1Chopped.Len();
3995 intPropertyLen = wxSPropertySeg1Ptr->Len();
3999 std::map<int, int> SplitPoints;
4000 std::map<int, int> SplitLength;
4001 std::map<int, int>::iterator SLiter;
4002 std::map<wxString, bool>::iterator BIter;;
4003 wxString PropertyData;
4004 wxString PropertyName;
4005 wxString PropertyValue;
4006 wxString PropertyTokens;
4007 bool FirstToken = TRUE;
4008 int intPrevValue = 14;
4010 if (ProcessItemData == TRUE){
4012 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4016 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4017 *wxSPropertyDataNameOut = wxT("GEO");
4021 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4022 intiter != SplitPoints.end(); ++intiter){
4024 SLiter = SplitLength.find(intiter->first);
4026 if (ProcessItemData == TRUE){
4028 if (FirstToken == TRUE){
4030 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4035 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4041 if (FirstToken == TRUE){
4043 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4048 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4054 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4055 PropertyName = PropertyElement.GetNextToken();
4056 PropertyValue = PropertyElement.GetNextToken();
4058 intPrevValue = intiter->second;
4060 // Process properties.
4062 // Check if there is a lock on the property value. If there is a lock then
4063 // the property value cannot be changed.
4065 if (PropertyName.IsEmpty()){
4071 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4073 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4075 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4079 PropertyDataMap->erase(PropertyName);
4080 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4088 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4089 *XVCardV4Value = TRUE;
4095 if (wxSProperty == wxT("X-VCARD4-RELATED")){
4097 if (ProcessItemData == TRUE){
4099 intPropertyLen = wxSPropertySeg1Chopped.Len();
4103 intPropertyLen = wxSPropertySeg1Ptr->Len();
4107 std::map<int, int> SplitPoints;
4108 std::map<int, int> SplitLength;
4109 std::map<int, int>::iterator SLiter;
4110 std::map<wxString, bool>::iterator BIter;;
4111 wxString PropertyData;
4112 wxString PropertyName;
4113 wxString PropertyValue;
4114 wxString PropertyTokens;
4115 bool FirstToken = TRUE;
4116 int intPrevValue = 18;
4118 if (ProcessItemData == TRUE){
4120 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4124 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4125 *wxSPropertyDataNameOut = wxT("RELATED");
4129 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4130 intiter != SplitPoints.end(); ++intiter){
4132 SLiter = SplitLength.find(intiter->first);
4134 if (ProcessItemData == TRUE){
4136 if (FirstToken == TRUE){
4138 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4143 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4149 if (FirstToken == TRUE){
4151 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4156 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4162 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4163 PropertyName = PropertyElement.GetNextToken();
4164 PropertyValue = PropertyElement.GetNextToken();
4166 intPrevValue = intiter->second;
4168 // Process properties.
4170 // Check if there is a lock on the property value. If there is a lock then
4171 // the property value cannot be changed.
4173 if (PropertyName.IsEmpty()){
4179 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4181 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4183 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4187 PropertyDataMap->erase(PropertyName);
4188 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4196 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4197 *XVCardV4Value = TRUE;
4203 if (wxSProperty == wxT("X-VCARD4-URL")){
4205 if (ProcessItemData == TRUE){
4207 intPropertyLen = wxSPropertySeg1Chopped.Len();
4211 intPropertyLen = wxSPropertySeg1Ptr->Len();
4215 std::map<int, int> SplitPoints;
4216 std::map<int, int> SplitLength;
4217 std::map<int, int>::iterator SLiter;
4218 std::map<wxString, bool>::iterator BIter;;
4219 wxString PropertyData;
4220 wxString PropertyName;
4221 wxString PropertyValue;
4222 wxString PropertyTokens;
4223 bool FirstToken = TRUE;
4224 int intPrevValue = 14;
4226 if (ProcessItemData == TRUE){
4228 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4232 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4233 *wxSPropertyDataNameOut = wxT("URL");
4237 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4238 intiter != SplitPoints.end(); ++intiter){
4240 SLiter = SplitLength.find(intiter->first);
4242 if (ProcessItemData == TRUE){
4244 if (FirstToken == TRUE){
4246 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4251 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4257 if (FirstToken == TRUE){
4259 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4264 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4270 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4271 PropertyName = PropertyElement.GetNextToken();
4272 PropertyValue = PropertyElement.GetNextToken();
4274 intPrevValue = intiter->second;
4276 // Process properties.
4278 // Check if there is a lock on the property value. If there is a lock then
4279 // the property value cannot be changed.
4281 if (PropertyName.IsEmpty()){
4287 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4289 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4291 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4295 PropertyDataMap->erase(PropertyName);
4296 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4304 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4305 *XVCardV4Value = TRUE;
4311 if (wxSProperty == wxT("X-VCARD4-TITLE")){
4313 if (ProcessItemData == TRUE){
4315 intPropertyLen = wxSPropertySeg1Chopped.Len();
4319 intPropertyLen = wxSPropertySeg1Ptr->Len();
4323 std::map<int, int> SplitPoints;
4324 std::map<int, int> SplitLength;
4325 std::map<int, int>::iterator SLiter;
4326 std::map<wxString, bool>::iterator BIter;;
4327 wxString PropertyData;
4328 wxString PropertyName;
4329 wxString PropertyValue;
4330 wxString PropertyTokens;
4331 bool FirstToken = TRUE;
4332 int intPrevValue = 16;
4334 if (ProcessItemData == TRUE){
4336 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4340 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4341 *wxSPropertyDataNameOut = wxT("TITLE");
4345 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4346 intiter != SplitPoints.end(); ++intiter){
4348 SLiter = SplitLength.find(intiter->first);
4350 if (ProcessItemData == TRUE){
4352 if (FirstToken == TRUE){
4354 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4359 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4365 if (FirstToken == TRUE){
4367 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4372 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4378 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4379 PropertyName = PropertyElement.GetNextToken();
4380 PropertyValue = PropertyElement.GetNextToken();
4382 intPrevValue = intiter->second;
4384 // Process properties.
4386 // Check if there is a lock on the property value. If there is a lock then
4387 // the property value cannot be changed.
4389 if (PropertyName.IsEmpty()){
4395 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4397 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4399 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4403 PropertyDataMap->erase(PropertyName);
4404 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4412 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4413 *XVCardV4Value = TRUE;
4419 if (wxSProperty == wxT("X-VCARD4-ROLE")){
4421 if (ProcessItemData == TRUE){
4423 intPropertyLen = wxSPropertySeg1Chopped.Len();
4427 intPropertyLen = wxSPropertySeg1Ptr->Len();
4431 std::map<int, int> SplitPoints;
4432 std::map<int, int> SplitLength;
4433 std::map<int, int>::iterator SLiter;
4434 std::map<wxString, bool>::iterator BIter;;
4435 wxString PropertyData;
4436 wxString PropertyName;
4437 wxString PropertyValue;
4438 wxString PropertyTokens;
4439 bool FirstToken = TRUE;
4440 int intPrevValue = 15;
4442 if (ProcessItemData == TRUE){
4444 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4448 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4449 *wxSPropertyDataNameOut = wxT("ROLE");
4453 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4454 intiter != SplitPoints.end(); ++intiter){
4456 SLiter = SplitLength.find(intiter->first);
4458 if (ProcessItemData == TRUE){
4460 if (FirstToken == TRUE){
4462 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4467 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4473 if (FirstToken == TRUE){
4475 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4480 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4486 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4487 PropertyName = PropertyElement.GetNextToken();
4488 PropertyValue = PropertyElement.GetNextToken();
4490 intPrevValue = intiter->second;
4492 // Process properties.
4494 // Check if there is a lock on the property value. If there is a lock then
4495 // the property value cannot be changed.
4497 if (PropertyName.IsEmpty()){
4503 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4505 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4507 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4511 PropertyDataMap->erase(PropertyName);
4512 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4520 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4521 *XVCardV4Value = TRUE;
4527 if (wxSProperty == wxT("X-VCARD4-ORG")){
4529 if (ProcessItemData == TRUE){
4531 intPropertyLen = wxSPropertySeg1Chopped.Len();
4535 intPropertyLen = wxSPropertySeg1Ptr->Len();
4539 std::map<int, int> SplitPoints;
4540 std::map<int, int> SplitLength;
4541 std::map<int, int>::iterator SLiter;
4542 std::map<wxString, bool>::iterator BIter;;
4543 wxString PropertyData;
4544 wxString PropertyName;
4545 wxString PropertyValue;
4546 wxString PropertyTokens;
4547 bool FirstToken = TRUE;
4548 int intPrevValue = 14;
4550 if (ProcessItemData == TRUE){
4552 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4556 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4557 *wxSPropertyDataNameOut = wxT("ORG");
4561 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4562 intiter != SplitPoints.end(); ++intiter){
4564 SLiter = SplitLength.find(intiter->first);
4566 if (ProcessItemData == TRUE){
4568 if (FirstToken == TRUE){
4570 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4575 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4581 if (FirstToken == TRUE){
4583 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4588 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4594 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4595 PropertyName = PropertyElement.GetNextToken();
4596 PropertyValue = PropertyElement.GetNextToken();
4598 intPrevValue = intiter->second;
4600 // Process properties.
4602 // Check if there is a lock on the property value. If there is a lock then
4603 // the property value cannot be changed.
4605 if (PropertyName.IsEmpty()){
4611 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4613 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4615 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4619 PropertyDataMap->erase(PropertyName);
4620 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4628 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4629 *XVCardV4Value = TRUE;
4635 if (wxSProperty == wxT("X-VCARD4-NOTE")){
4637 if (ProcessItemData == TRUE){
4639 intPropertyLen = wxSPropertySeg1Chopped.Len();
4643 intPropertyLen = wxSPropertySeg1Ptr->Len();
4647 std::map<int, int> SplitPoints;
4648 std::map<int, int> SplitLength;
4649 std::map<int, int>::iterator SLiter;
4650 std::map<wxString, bool>::iterator BIter;;
4651 wxString PropertyData;
4652 wxString PropertyName;
4653 wxString PropertyValue;
4654 wxString PropertyTokens;
4655 bool FirstToken = TRUE;
4656 int intPrevValue = 15;
4658 if (ProcessItemData == TRUE){
4660 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4664 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4665 *wxSPropertyDataNameOut = wxT("NOTE");
4669 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4670 intiter != SplitPoints.end(); ++intiter){
4672 SLiter = SplitLength.find(intiter->first);
4674 if (ProcessItemData == TRUE){
4676 if (FirstToken == TRUE){
4678 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4683 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4689 if (FirstToken == TRUE){
4691 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4696 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4702 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4703 PropertyName = PropertyElement.GetNextToken();
4704 PropertyValue = PropertyElement.GetNextToken();
4706 intPrevValue = intiter->second;
4708 // Process properties.
4710 // Check if there is a lock on the property value. If there is a lock then
4711 // the property value cannot be changed.
4713 if (PropertyName.IsEmpty()){
4719 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4721 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4723 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4727 PropertyDataMap->erase(PropertyName);
4728 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4736 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4737 *XVCardV4Value = TRUE;
4741 // X-VCARD4-CATEGORIES
4743 if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
4745 if (ProcessItemData == TRUE){
4747 intPropertyLen = wxSPropertySeg1Chopped.Len();
4751 intPropertyLen = wxSPropertySeg1Ptr->Len();
4755 std::map<int, int> SplitPoints;
4756 std::map<int, int> SplitLength;
4757 std::map<int, int>::iterator SLiter;
4758 std::map<wxString, bool>::iterator BIter;;
4759 wxString PropertyData;
4760 wxString PropertyName;
4761 wxString PropertyValue;
4762 wxString PropertyTokens;
4763 bool FirstToken = TRUE;
4764 int intPrevValue = 21;
4766 if (ProcessItemData == TRUE){
4768 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4772 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4773 *wxSPropertyDataNameOut = wxT("CATEGORIES");
4777 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4778 intiter != SplitPoints.end(); ++intiter){
4780 SLiter = SplitLength.find(intiter->first);
4782 if (ProcessItemData == TRUE){
4784 if (FirstToken == TRUE){
4786 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4791 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4797 if (FirstToken == TRUE){
4799 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4804 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4810 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4811 PropertyName = PropertyElement.GetNextToken();
4812 PropertyValue = PropertyElement.GetNextToken();
4814 intPrevValue = intiter->second;
4816 // Process properties.
4818 // Check if there is a lock on the property value. If there is a lock then
4819 // the property value cannot be changed.
4821 if (PropertyName.IsEmpty()){
4827 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4829 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4831 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4835 PropertyDataMap->erase(PropertyName);
4836 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4844 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4845 *XVCardV4Value = TRUE;
4851 if (wxSProperty == wxT("X-VCARD4-PHOTO")){
4853 if (ProcessItemData == TRUE){
4855 intPropertyLen = wxSPropertySeg1Chopped.Len();
4859 intPropertyLen = wxSPropertySeg1Ptr->Len();
4863 std::map<int, int> SplitPoints;
4864 std::map<int, int> SplitLength;
4865 std::map<int, int>::iterator SLiter;
4866 std::map<wxString, bool>::iterator BIter;;
4867 wxString PropertyData;
4868 wxString PropertyName;
4869 wxString PropertyValue;
4870 wxString PropertyTokens;
4871 bool FirstToken = TRUE;
4872 int intPrevValue = 16;
4874 if (ProcessItemData == TRUE){
4876 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4880 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4881 *wxSPropertyDataNameOut = wxT("PHOTO");
4885 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4886 intiter != SplitPoints.end(); ++intiter){
4888 SLiter = SplitLength.find(intiter->first);
4890 if (ProcessItemData == TRUE){
4892 if (FirstToken == TRUE){
4894 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4899 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4905 if (FirstToken == TRUE){
4907 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4912 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4918 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4919 PropertyName = PropertyElement.GetNextToken();
4920 PropertyValue = PropertyElement.GetNextToken();
4922 intPrevValue = intiter->second;
4924 // Process properties.
4926 // Check if there is a lock on the property value. If there is a lock then
4927 // the property value cannot be changed.
4929 if (PropertyName.IsEmpty()){
4935 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4937 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4939 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4943 PropertyDataMap->erase(PropertyName);
4944 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4952 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4953 *XVCardV4Value = TRUE;
4959 if (wxSProperty == wxT("X-VCARD4-LOGO")){
4961 if (ProcessItemData == TRUE){
4963 intPropertyLen = wxSPropertySeg1Chopped.Len();
4967 intPropertyLen = wxSPropertySeg1Ptr->Len();
4971 std::map<int, int> SplitPoints;
4972 std::map<int, int> SplitLength;
4973 std::map<int, int>::iterator SLiter;
4974 std::map<wxString, bool>::iterator BIter;;
4975 wxString PropertyData;
4976 wxString PropertyName;
4977 wxString PropertyValue;
4978 wxString PropertyTokens;
4979 bool FirstToken = TRUE;
4980 int intPrevValue = 15;
4982 if (ProcessItemData == TRUE){
4984 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4988 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4989 *wxSPropertyDataNameOut = wxT("LOGO");
4993 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4994 intiter != SplitPoints.end(); ++intiter){
4996 SLiter = SplitLength.find(intiter->first);
4998 if (ProcessItemData == TRUE){
5000 if (FirstToken == TRUE){
5002 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5007 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5013 if (FirstToken == TRUE){
5015 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5020 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5026 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5027 PropertyName = PropertyElement.GetNextToken();
5028 PropertyValue = PropertyElement.GetNextToken();
5030 intPrevValue = intiter->second;
5032 // Process properties.
5034 // Check if there is a lock on the property value. If there is a lock then
5035 // the property value cannot be changed.
5037 if (PropertyName.IsEmpty()){
5043 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5045 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5047 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5051 PropertyDataMap->erase(PropertyName);
5052 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5060 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5061 *XVCardV4Value = TRUE;
5067 if (wxSProperty == wxT("X-VCARD4-SOUND")){
5069 if (ProcessItemData == TRUE){
5071 intPropertyLen = wxSPropertySeg1Chopped.Len();
5075 intPropertyLen = wxSPropertySeg1Ptr->Len();
5079 std::map<int, int> SplitPoints;
5080 std::map<int, int> SplitLength;
5081 std::map<int, int>::iterator SLiter;
5082 std::map<wxString, bool>::iterator BIter;;
5083 wxString PropertyData;
5084 wxString PropertyName;
5085 wxString PropertyValue;
5086 wxString PropertyTokens;
5087 bool FirstToken = TRUE;
5088 int intPrevValue = 16;
5090 if (ProcessItemData == TRUE){
5092 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5096 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5097 *wxSPropertyDataNameOut = wxT("SOUND");
5101 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5102 intiter != SplitPoints.end(); ++intiter){
5104 SLiter = SplitLength.find(intiter->first);
5106 if (ProcessItemData == TRUE){
5108 if (FirstToken == TRUE){
5110 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5115 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5121 if (FirstToken == TRUE){
5123 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5128 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5134 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5135 PropertyName = PropertyElement.GetNextToken();
5136 PropertyValue = PropertyElement.GetNextToken();
5138 intPrevValue = intiter->second;
5140 // Process properties.
5142 // Check if there is a lock on the property value. If there is a lock then
5143 // the property value cannot be changed.
5145 if (PropertyName.IsEmpty()){
5151 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5153 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5155 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5159 PropertyDataMap->erase(PropertyName);
5160 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5168 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5169 *XVCardV4Value = TRUE;
5175 if (wxSProperty == wxT("X-VCARD4-CALURI")){
5177 if (ProcessItemData == TRUE){
5179 intPropertyLen = wxSPropertySeg1Chopped.Len();
5183 intPropertyLen = wxSPropertySeg1Ptr->Len();
5187 std::map<int, int> SplitPoints;
5188 std::map<int, int> SplitLength;
5189 std::map<int, int>::iterator SLiter;
5190 std::map<wxString, bool>::iterator BIter;;
5191 wxString PropertyData;
5192 wxString PropertyName;
5193 wxString PropertyValue;
5194 wxString PropertyTokens;
5195 bool FirstToken = TRUE;
5196 int intPrevValue = 17;
5198 if (ProcessItemData == TRUE){
5200 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5204 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5205 *wxSPropertyDataNameOut = wxT("CALURI");
5209 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5210 intiter != SplitPoints.end(); ++intiter){
5212 SLiter = SplitLength.find(intiter->first);
5214 if (ProcessItemData == TRUE){
5216 if (FirstToken == TRUE){
5218 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5223 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5229 if (FirstToken == TRUE){
5231 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5236 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5242 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5243 PropertyName = PropertyElement.GetNextToken();
5244 PropertyValue = PropertyElement.GetNextToken();
5246 intPrevValue = intiter->second;
5248 // Process properties.
5250 // Check if there is a lock on the property value. If there is a lock then
5251 // the property value cannot be changed.
5253 if (PropertyName.IsEmpty()){
5259 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5261 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5263 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5267 PropertyDataMap->erase(PropertyName);
5268 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5276 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5277 *XVCardV4Value = TRUE;
5281 // X-VCARD4-CALADRURI
5283 if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
5285 if (ProcessItemData == TRUE){
5287 intPropertyLen = wxSPropertySeg1Chopped.Len();
5291 intPropertyLen = wxSPropertySeg1Ptr->Len();
5295 std::map<int, int> SplitPoints;
5296 std::map<int, int> SplitLength;
5297 std::map<int, int>::iterator SLiter;
5298 std::map<wxString, bool>::iterator BIter;;
5299 wxString PropertyData;
5300 wxString PropertyName;
5301 wxString PropertyValue;
5302 wxString PropertyTokens;
5303 bool FirstToken = TRUE;
5304 int intPrevValue = 20;
5306 if (ProcessItemData == TRUE){
5308 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5312 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5313 *wxSPropertyDataNameOut = wxT("CALADRURI");
5317 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5318 intiter != SplitPoints.end(); ++intiter){
5320 SLiter = SplitLength.find(intiter->first);
5322 if (ProcessItemData == TRUE){
5324 if (FirstToken == TRUE){
5326 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5331 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5337 if (FirstToken == TRUE){
5339 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5344 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5350 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5351 PropertyName = PropertyElement.GetNextToken();
5352 PropertyValue = PropertyElement.GetNextToken();
5354 intPrevValue = intiter->second;
5356 // Process properties.
5358 // Check if there is a lock on the property value. If there is a lock then
5359 // the property value cannot be changed.
5361 if (PropertyName.IsEmpty()){
5367 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5369 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5371 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5375 PropertyDataMap->erase(PropertyName);
5376 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5384 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5385 *XVCardV4Value = TRUE;
5391 if (wxSProperty == wxT("X-VCARD4-FBURL")){
5393 if (ProcessItemData == TRUE){
5395 intPropertyLen = wxSPropertySeg1Chopped.Len();
5399 intPropertyLen = wxSPropertySeg1Ptr->Len();
5403 std::map<int, int> SplitPoints;
5404 std::map<int, int> SplitLength;
5405 std::map<int, int>::iterator SLiter;
5406 std::map<wxString, bool>::iterator BIter;;
5407 wxString PropertyData;
5408 wxString PropertyName;
5409 wxString PropertyValue;
5410 wxString PropertyTokens;
5411 bool FirstToken = TRUE;
5412 int intPrevValue = 16;
5414 if (ProcessItemData == TRUE){
5416 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5420 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5421 *wxSPropertyDataNameOut = wxT("FBURL");
5425 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5426 intiter != SplitPoints.end(); ++intiter){
5428 SLiter = SplitLength.find(intiter->first);
5430 if (ProcessItemData == TRUE){
5432 if (FirstToken == TRUE){
5434 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5439 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5445 if (FirstToken == TRUE){
5447 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5452 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5458 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5459 PropertyName = PropertyElement.GetNextToken();
5460 PropertyValue = PropertyElement.GetNextToken();
5462 intPrevValue = intiter->second;
5464 // Process properties.
5466 // Check if there is a lock on the property value. If there is a lock then
5467 // the property value cannot be changed.
5469 if (PropertyName.IsEmpty()){
5475 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5477 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5479 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5483 PropertyDataMap->erase(PropertyName);
5484 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5492 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5493 *XVCardV4Value = TRUE;
5499 if (wxSProperty == wxT("X-VCARD4-KEY")){
5501 if (ProcessItemData == TRUE){
5503 intPropertyLen = wxSPropertySeg1Chopped.Len();
5507 intPropertyLen = wxSPropertySeg1Ptr->Len();
5511 std::map<int, int> SplitPoints;
5512 std::map<int, int> SplitLength;
5513 std::map<int, int>::iterator SLiter;
5514 std::map<wxString, bool>::iterator BIter;;
5515 wxString PropertyData;
5516 wxString PropertyName;
5517 wxString PropertyValue;
5518 wxString PropertyTokens;
5519 bool FirstToken = TRUE;
5520 int intPrevValue = 14;
5522 if (ProcessItemData == TRUE){
5524 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5528 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5529 *wxSPropertyDataNameOut = wxT("KEY");
5533 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5534 intiter != SplitPoints.end(); ++intiter){
5536 SLiter = SplitLength.find(intiter->first);
5538 if (ProcessItemData == TRUE){
5540 if (FirstToken == TRUE){
5542 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5547 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5553 if (FirstToken == TRUE){
5555 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5560 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5566 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5567 PropertyName = PropertyElement.GetNextToken();
5568 PropertyValue = PropertyElement.GetNextToken();
5570 intPrevValue = intiter->second;
5572 // Process properties.
5574 // Check if there is a lock on the property value. If there is a lock then
5575 // the property value cannot be changed.
5577 if (PropertyName.IsEmpty()){
5583 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5585 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5587 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5591 PropertyDataMap->erase(PropertyName);
5592 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5600 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5601 *XVCardV4Value = TRUE;
5607 if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
5609 if (ProcessItemData == TRUE){
5611 intPropertyLen = wxSPropertySeg1Chopped.Len();
5615 intPropertyLen = wxSPropertySeg1Ptr->Len();
5619 std::map<int, int> SplitPoints;
5620 std::map<int, int> SplitLength;
5621 std::map<int, int>::iterator SLiter;
5622 std::map<wxString, bool>::iterator BIter;;
5623 wxString PropertyData;
5624 wxString PropertyName;
5625 wxString PropertyValue;
5626 wxString PropertyTokens;
5627 bool FirstToken = TRUE;
5628 int intPrevValue = 14;
5630 if (ProcessItemData == TRUE){
5632 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5636 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5637 *wxSPropertyDataNameOut = wxSProperty.Mid(9);
5641 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5642 intiter != SplitPoints.end(); ++intiter){
5644 SLiter = SplitLength.find(intiter->first);
5646 if (ProcessItemData == TRUE){
5648 if (FirstToken == TRUE){
5650 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5655 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5661 if (FirstToken == TRUE){
5663 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5668 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5674 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5675 PropertyName = PropertyElement.GetNextToken();
5676 PropertyValue = PropertyElement.GetNextToken();
5678 intPrevValue = intiter->second;
5680 // Process properties.
5682 // Check if there is a lock on the property value. If there is a lock then
5683 // the property value cannot be changed.
5685 if (PropertyName.IsEmpty()){
5691 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5693 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5695 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5699 PropertyDataMap->erase(PropertyName);
5700 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5708 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5709 *XVCardV4Value = TRUE;
5713 // X-ADDRESSBOOKSERVER-KIND
5715 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
5719 if (ProcessItemData == TRUE){
5721 intPropertyLen = wxSPropertySeg1Chopped.Len();
5725 intPropertyLen = wxSPropertySeg1Ptr->Len();
5729 std::map<int, int> SplitPoints;
5730 std::map<int, int> SplitLength;
5731 std::map<int, int>::iterator SLiter;
5732 std::map<wxString, bool>::iterator BIter;;
5733 wxString PropertyData;
5734 wxString PropertyName;
5735 wxString PropertyValue;
5736 wxString PropertyTokens;
5737 bool FirstToken = TRUE;
5738 int intPrevValue = 26;
5740 if (ProcessItemData == TRUE){
5742 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5746 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5750 *wxSPropertyDataNameOut = wxT("KIND");
5752 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5753 intiter != SplitPoints.end(); ++intiter){
5755 SLiter = SplitLength.find(intiter->first);
5757 if (ProcessItemData == TRUE){
5759 if (FirstToken == TRUE){
5761 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5766 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5772 if (FirstToken == TRUE){
5774 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5779 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5785 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5786 PropertyName = PropertyElement.GetNextToken();
5787 PropertyValue = PropertyElement.GetNextToken();
5789 intPrevValue = intiter->second;
5791 // Process properties.
5793 // Check if there is a lock on the property value. If there is a lock then
5794 // the property value cannot be changed.
5796 if (PropertyName.IsEmpty()){
5802 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5804 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5806 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5810 PropertyDataMap->erase(PropertyName);
5811 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5819 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5820 *XVCardV4Value = TRUE;
5824 // X-ADDRESSBOOKSERVER-MEMBER
5826 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
5830 if (ProcessItemData == TRUE){
5832 intPropertyLen = wxSPropertySeg1Chopped.Len();
5836 intPropertyLen = wxSPropertySeg1Ptr->Len();
5840 std::map<int, int> SplitPoints;
5841 std::map<int, int> SplitLength;
5842 std::map<int, int>::iterator SLiter;
5843 std::map<wxString, bool>::iterator BIter;;
5844 wxString PropertyData;
5845 wxString PropertyName;
5846 wxString PropertyValue;
5847 wxString PropertyTokens;
5848 bool FirstToken = TRUE;
5849 int intPrevValue = 28;
5851 if (ProcessItemData == TRUE){
5853 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5857 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5861 *wxSPropertyDataNameOut = wxT("MEMBER");
5863 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5864 intiter != SplitPoints.end(); ++intiter){
5866 SLiter = SplitLength.find(intiter->first);
5868 if (ProcessItemData == TRUE){
5870 if (FirstToken == TRUE){
5872 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5877 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5883 if (FirstToken == TRUE){
5885 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5890 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5896 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5897 PropertyName = PropertyElement.GetNextToken();
5898 PropertyValue = PropertyElement.GetNextToken();
5900 intPrevValue = intiter->second;
5902 // Process properties.
5904 // Check if there is a lock on the property value. If there is a lock then
5905 // the property value cannot be changed.
5907 if (PropertyName.IsEmpty()){
5913 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5915 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5917 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5921 PropertyDataMap->erase(PropertyName);
5922 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5930 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5931 *XVCardV4Value = TRUE;
5936 // Deal with X-ABLabel specifically.
5938 if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
5940 intPropertyLen = wxSPropertySeg1Ptr->Len();
5941 std::map<int, int> SplitPoints;
5942 std::map<int, int> SplitLength;
5943 std::map<int, int>::iterator SLiter;
5944 wxString PropertyData;
5945 wxString PropertyName;
5946 wxString PropertyValue;
5947 wxString PropertyTokens;
5948 int intPrevValue = 11;
5950 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5952 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
5958 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
5960 // Process code for capturing the strings.
5962 CaptureString(strCapture, FALSE);
5966 void vCard34Conv::SplitValues(wxString *PropertyLine,
5967 std::map<int,int> *SplitPoints,
5968 std::map<int,int> *SplitLength,
5971 // Split the values as required.
5973 size_t intPropertyLen = PropertyLine->Len();
5974 int intSplitsFound = 0;
5975 int intSplitSize = 0;
5976 int intSplitSeek = 0;
5978 for (int i = intSize; i <= intPropertyLen; i++){
5982 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5983 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5985 if (intSplitsFound == 0){
5987 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5991 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5995 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
6005 if (intSplitsFound == 0){
6007 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
6008 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6012 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
6013 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6019 void vCard34Conv::SplitValuesData(wxString *PropertyLine,
6020 std::map<int,int> *SplitPoints,
6021 std::map<int,int> *SplitLength,
6023 std::map<wxString,wxString> *SplitData){
6026 // Split the data values as required.
6029 wxStringTokenizer PropertyElement;
6030 wxString PropertyName;
6031 wxString PropertyValue;
6032 size_t intPropertyLen = PropertyLine->Len();
6033 int intSplitsFound = 0;
6034 int intSplitSize = 0;
6035 int intSplitSeek = (intSize - 1);
6037 for (int i = intSize; i <= intPropertyLen; i++){
6041 if (PropertyLine->Mid(i, 1) == wxT(";") &&
6042 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
6044 if (intSplitsFound == 0){
6046 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
6047 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
6051 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
6052 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
6056 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
6059 intSplitSeek = (i + 1);
6062 if (!DataStr.IsEmpty()){
6064 PropertyElement.SetString(DataStr, wxT("="));
6065 PropertyName = PropertyElement.GetNextToken();
6066 PropertyValue = PropertyElement.GetNextToken();
6067 SplitData->insert(std::make_pair(PropertyName, PropertyValue));
6072 PropertyName.clear();
6073 PropertyValue.clear();
6079 if (intSplitsFound == 0){
6081 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
6083 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
6084 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6088 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
6090 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
6091 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6095 if (!DataStr.IsEmpty()){
6097 PropertyElement.SetString(DataStr, wxT("="));
6098 PropertyName = PropertyElement.GetNextToken();
6099 PropertyValue = PropertyElement.GetNextToken();
6100 SplitData->insert(std::make_pair(PropertyName, PropertyValue));