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(){
45 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
46 wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr,
47 wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut,
48 wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
49 std::map<wxString,wxString> *PropertyDataMap,
50 std::map<wxString,bool> *PropertyLockMap,
51 bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
54 wxString wxSPropertySeg1Chopped;
55 size_t intPropertyLen;
57 if (ProcessItemData == TRUE){
59 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
61 wxSPropertySplit.GetNextToken();
62 wxSProperty = wxSPropertySplit.GetNextToken();
64 // Look for . in wxSPropertySeg1Ptr and remove all data before
67 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
68 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
73 wxSProperty = *wxSPropertyName;
78 // Go through each of the vCard 3.0 properties.
82 if (wxSProperty == wxT("EMAIL")){
84 if (ProcessItemData == TRUE){
86 intPropertyLen = wxSPropertySeg1Chopped.Len();
90 intPropertyLen = wxSPropertySeg1Ptr->Len();
94 std::map<int, int> SplitPoints;
95 std::map<int, int> SplitLength;
96 std::map<int, int>::iterator SLiter;
97 wxString PropertyData;
98 wxString PropertyName;
99 wxString PropertyValue;
100 wxString PropertyTokens;
101 bool FirstToken = TRUE;
102 int intPrevValue = 7;
104 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
105 *wxSPropertyDataNameOut = wxT("EMAIL");
106 *VCardV3Value = TRUE;
108 if (ProcessItemData == TRUE){
110 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
114 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
118 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
119 intiter != SplitPoints.end(); ++intiter){
121 SLiter = SplitLength.find(intiter->first);
123 if (ProcessItemData == TRUE){
125 if (FirstToken == TRUE){
127 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
132 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
138 if (FirstToken == TRUE){
140 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
145 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
151 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
152 PropertyName = PropertyElement.GetNextToken();
153 PropertyValue = PropertyElement.GetNextToken();
155 //ProcessCaptureStrings(&PropertyValue);
157 intPrevValue = intiter->second;
159 if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
165 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
167 if (ProcessItemData == FALSE){
169 PropertyName = wxT("PREF");
170 PropertyValue = wxT("50");
180 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
182 PropertyValue = wxT("home");
186 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
188 PropertyValue = wxT("work");
192 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
194 PropertyName = wxT("X-TYPE");
195 PropertyValue = wxT("other");
199 // Process properties.
201 if (PropertyName.IsEmpty()){
207 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
209 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
210 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
214 PropertyDataMap->erase(PropertyName);
215 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
216 PropertyLockMap->erase(PropertyName);
217 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
227 if (wxSProperty == wxT("ADR")){
229 if (ProcessItemData == TRUE){
231 intPropertyLen = wxSPropertySeg1Chopped.Len();
235 intPropertyLen = wxSPropertySeg1Ptr->Len();
239 std::map<int, int> SplitPoints;
240 std::map<int, int> SplitLength;
241 std::map<int, int>::iterator SLiter;
242 wxString PropertyData;
243 wxString PropertyName;
244 wxString PropertyValue;
245 wxString PropertyTokens;
246 bool FirstToken = TRUE;
247 int intPrevValue = 5;
249 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
250 *wxSPropertyDataNameOut = wxT("ADR");
251 *VCardV3Value = TRUE;
253 if (ProcessItemData == TRUE){
255 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
259 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
263 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
264 intiter != SplitPoints.end(); ++intiter){
266 SLiter = SplitLength.find(intiter->first);
268 if (ProcessItemData == TRUE){
270 if (FirstToken == TRUE){
272 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
277 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
283 if (FirstToken == TRUE){
285 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
290 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
296 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
297 PropertyName = PropertyElement.GetNextToken();
298 PropertyValue = PropertyElement.GetNextToken();
300 intPrevValue = intiter->second;
302 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
304 if (ProcessItemData == FALSE){
306 PropertyName = wxT("PREF");
307 PropertyValue = wxT("50");
317 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
319 PropertyValue = wxT("home");
323 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
325 PropertyValue = wxT("work");
329 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
331 PropertyName = wxT("X-TYPE");
332 PropertyValue = wxT("other");
336 // Process properties.
338 if (PropertyName.IsEmpty()){
344 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
346 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
347 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
351 PropertyDataMap->erase(PropertyName);
352 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
353 PropertyLockMap->erase(PropertyName);
354 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
364 if (wxSProperty == wxT("LABEL")){
366 if (ProcessItemData == TRUE){
368 intPropertyLen = wxSPropertySeg1Chopped.Len();
372 intPropertyLen = wxSPropertySeg1Ptr->Len();
376 std::map<int, int> SplitPoints;
377 std::map<int, int> SplitLength;
378 std::map<int, int>::iterator SLiter;
379 wxString PropertyData;
380 wxString PropertyName;
381 wxString PropertyValue;
382 wxString PropertyTokens;
383 bool FirstToken = TRUE;
384 int intPrevValue = 7;
386 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
387 *wxSPropertyDataNameOut = wxT("ADR");
388 *VCardV3Value = TRUE;
390 if (ProcessItemData == TRUE){
392 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
396 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
400 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
401 intiter != SplitPoints.end(); ++intiter){
403 SLiter = SplitLength.find(intiter->first);
405 if (ProcessItemData == TRUE){
407 if (FirstToken == TRUE){
409 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
414 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
420 if (FirstToken == TRUE){
422 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
427 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
433 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
434 PropertyName = PropertyElement.GetNextToken();
435 PropertyValue = PropertyElement.GetNextToken();
437 intPrevValue = intiter->second;
439 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
445 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
447 PropertyValue = wxT("home");
451 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
453 PropertyValue = wxT("work");
457 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
459 PropertyName = wxT("X-TYPE");
460 PropertyValue = wxT("other");
464 // Process properties.
466 if (PropertyName.IsEmpty()){
472 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
474 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
475 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
479 PropertyDataMap->erase(PropertyName);
480 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
481 PropertyLockMap->erase(PropertyName);
482 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
488 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
494 if (wxSProperty == wxT("IMPP")){
496 if (ProcessItemData == TRUE){
498 intPropertyLen = wxSPropertySeg1Chopped.Len();
502 intPropertyLen = wxSPropertySeg1Ptr->Len();
506 std::map<int, int> SplitPoints;
507 std::map<int, int> SplitLength;
508 std::map<int, int>::iterator SLiter;
509 wxString PropertyData;
510 wxString PropertyName;
511 wxString PropertyValue;
512 wxString PropertyTokens;
513 bool FirstToken = TRUE;
514 int intPrevValue = 6;
516 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
520 IMPPType = IMPPSplit.GetNextToken();
522 if (IMPPSplit.HasMoreTokens()){
524 IMPPData = IMPPSplit.GetNextToken();
526 if (IMPPType == wxT("ymsgr")){
528 IMPPType = wxT("yahoo");
532 *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
536 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
537 *wxSPropertyDataNameOut = wxT("IMPP");
538 *VCardV3Value = TRUE;
540 if (ProcessItemData == TRUE){
542 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
546 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
550 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
551 intiter != SplitPoints.end(); ++intiter){
553 SLiter = SplitLength.find(intiter->first);
555 if (ProcessItemData == TRUE){
557 if (FirstToken == TRUE){
559 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
564 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
570 if (FirstToken == TRUE){
572 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
577 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
583 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
584 PropertyName = PropertyElement.GetNextToken();
585 PropertyValue = PropertyElement.GetNextToken();
587 intPrevValue = intiter->second;
589 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
595 if (PropertyName == wxT("X-SERVICE-TYPE")){
601 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
603 PropertyValue = wxT("home");
607 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
609 PropertyValue = wxT("work");
613 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
615 PropertyName = wxT("X-TYPE");
616 PropertyValue = wxT("other");
620 // Process properties.
622 if (PropertyName.IsEmpty()){
628 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
630 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
631 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
635 PropertyDataMap->erase(PropertyName);
636 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
637 PropertyLockMap->erase(PropertyName);
638 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
648 if (wxSProperty == wxT("TEL")){
650 if (ProcessItemData == TRUE){
652 intPropertyLen = wxSPropertySeg1Chopped.Len();
656 intPropertyLen = wxSPropertySeg1Ptr->Len();
660 std::map<int, int> SplitPoints;
661 std::map<int, int> SplitLength;
662 std::map<int, int>::iterator SLiter;
663 std::map<wxString, wxString> TelType;
664 wxString PropertyData;
665 wxString PropertyName;
666 wxString PropertyValue;
667 wxString PropertyTokens;
668 bool FirstToken = TRUE;
669 int intPrevValue = 5;
671 wxSPropertyDataOut->Append(wxT("tel:"));
672 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
673 *wxSPropertyDataNameOut = wxT("TEL");
674 *VCardV3Value = TRUE;
676 if (ProcessItemData == TRUE){
678 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
682 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
686 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
687 intiter != SplitPoints.end(); ++intiter){
689 SLiter = SplitLength.find(intiter->first);
691 if (ProcessItemData == TRUE){
693 if (FirstToken == TRUE){
695 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
700 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
706 if (FirstToken == TRUE){
708 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
713 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
719 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
720 PropertyName = PropertyElement.GetNextToken();
721 PropertyValue = PropertyElement.GetNextToken();
723 intPrevValue = intiter->second;
725 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
731 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
733 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
738 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
740 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
745 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
747 PropertyName = wxT("X-TYPE");
748 PropertyValue = wxT("other");
752 // Process the telephone type options.
756 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
758 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
765 if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
767 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
774 if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
776 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
783 if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
785 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
792 if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
794 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
801 if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
803 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
810 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
812 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
817 if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
819 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
820 wxString TypeSplitData;
821 while (TypeSplit.HasMoreTokens()){
823 TypeSplitData = TypeSplit.GetNextToken();
824 TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
825 TypeSplitData.clear();
831 // Process properties.
833 if (PropertyName.IsEmpty()){
839 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
841 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
842 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
846 PropertyDataMap->erase(PropertyName);
847 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
848 PropertyLockMap->erase(PropertyName);
849 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
855 wxString TelFinalString;
856 bool TelFirstToken = TRUE;
858 for (std::map<wxString, wxString>::iterator intiter = TelType.begin();
859 intiter != TelType.end(); ++intiter){
861 // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
863 if (TelFirstToken == TRUE){
865 TelFinalString.Append(wxT("\""));
866 TelFinalString.Append(intiter->first);
867 TelFirstToken = FALSE;
871 TelFinalString.Append(wxT(","));
872 TelFinalString.Append(intiter->first);
878 if (TelFirstToken == FALSE){
880 TelFinalString.Append(wxT("\""));
884 if (!TelFinalString.IsEmpty()){
886 if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
888 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
889 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
893 PropertyDataMap->erase(PropertyName);
894 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
895 PropertyLockMap->erase(PropertyName);
896 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
906 if (wxSProperty == wxT("X-ABRELATEDNAMES")){
908 if (ProcessItemData == TRUE){
910 intPropertyLen = wxSPropertySeg1Chopped.Len();
914 intPropertyLen = wxSPropertySeg1Ptr->Len();
918 std::map<int, int> SplitPoints;
919 std::map<int, int> SplitLength;
920 std::map<int, int>::iterator SLiter;
921 wxString PropertyData;
922 wxString PropertyName;
923 wxString PropertyValue;
924 wxString PropertyTokens;
925 bool FirstToken = TRUE;
926 int intPrevValue = 18;
928 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
929 *wxSPropertyDataNameOut = wxT("RELATED");
930 *VCardV3Value = TRUE;
932 if (ProcessItemData == TRUE){
934 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
938 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
942 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
943 intiter != SplitPoints.end(); ++intiter){
945 SLiter = SplitLength.find(intiter->first);
947 if (ProcessItemData == TRUE){
949 if (FirstToken == TRUE){
951 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
956 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
962 if (FirstToken == TRUE){
964 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
969 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
975 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
976 PropertyName = PropertyElement.GetNextToken();
977 PropertyValue = PropertyElement.GetNextToken();
979 //ProcessCaptureStrings(&PropertyValue);
981 intPrevValue = intiter->second;
983 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
989 // Process properties.
991 if (PropertyName.IsEmpty()){
997 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
999 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1000 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1004 PropertyDataMap->erase(PropertyName);
1005 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1006 PropertyLockMap->erase(PropertyName);
1007 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1017 if (wxSProperty == wxT("URL")){
1019 if (ProcessItemData == TRUE){
1021 intPropertyLen = wxSPropertySeg1Chopped.Len();
1025 intPropertyLen = wxSPropertySeg1Ptr->Len();
1029 std::map<int, int> SplitPoints;
1030 std::map<int, int> SplitLength;
1031 std::map<int, int>::iterator SLiter;
1032 wxString PropertyData;
1033 wxString PropertyName;
1034 wxString PropertyValue;
1035 wxString PropertyTokens;
1036 bool FirstToken = TRUE;
1037 int intPrevValue = 5;
1039 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1040 *wxSPropertyDataNameOut = wxT("URL");
1041 *VCardV3Value = TRUE;
1043 if (ProcessItemData == TRUE){
1045 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1049 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1053 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1054 intiter != SplitPoints.end(); ++intiter){
1056 SLiter = SplitLength.find(intiter->first);
1058 if (ProcessItemData == TRUE){
1060 if (FirstToken == TRUE){
1062 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1067 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1073 if (FirstToken == TRUE){
1075 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1080 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1086 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1087 PropertyName = PropertyElement.GetNextToken();
1088 PropertyValue = PropertyElement.GetNextToken();
1090 intPrevValue = intiter->second;
1092 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
1098 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
1100 PropertyValue = wxT("home");
1104 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
1106 PropertyValue = wxT("work");
1110 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
1112 PropertyName = wxT("X-TYPE");
1113 PropertyValue = wxT("other");
1117 // Process properties.
1119 if (PropertyName.IsEmpty()){
1125 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1127 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1128 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1132 PropertyDataMap->erase(PropertyName);
1133 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1134 PropertyLockMap->erase(PropertyName);
1135 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1145 if (wxSProperty == wxT("TITLE")){
1147 if (ProcessItemData == TRUE){
1149 intPropertyLen = wxSPropertySeg1Chopped.Len();
1153 intPropertyLen = wxSPropertySeg1Ptr->Len();
1157 std::map<int, int> SplitPoints;
1158 std::map<int, int> SplitLength;
1159 std::map<int, int>::iterator SLiter;
1160 wxString PropertyData;
1161 wxString PropertyName;
1162 wxString PropertyValue;
1163 wxString PropertyTokens;
1164 bool FirstToken = TRUE;
1165 int intPrevValue = 7;
1167 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1168 *wxSPropertyDataNameOut = wxT("TITLE");
1169 *VCardV3Value = TRUE;
1171 if (ProcessItemData == TRUE){
1173 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1177 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1181 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1182 intiter != SplitPoints.end(); ++intiter){
1184 SLiter = SplitLength.find(intiter->first);
1186 if (ProcessItemData == TRUE){
1188 if (FirstToken == TRUE){
1190 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1195 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1201 if (FirstToken == TRUE){
1203 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1208 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1214 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1215 PropertyName = PropertyElement.GetNextToken();
1216 PropertyValue = PropertyElement.GetNextToken();
1218 intPrevValue = intiter->second;
1220 // Process properties.
1222 if (PropertyName.IsEmpty()){
1228 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1230 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1231 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1235 PropertyDataMap->erase(PropertyName);
1236 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1237 PropertyLockMap->erase(PropertyName);
1238 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1248 if (wxSProperty == wxT("FN")){
1250 if (ProcessItemData == TRUE){
1252 intPropertyLen = wxSPropertySeg1Chopped.Len();
1256 intPropertyLen = wxSPropertySeg1Ptr->Len();
1260 std::map<int, int> SplitPoints;
1261 std::map<int, int> SplitLength;
1262 std::map<int, int>::iterator SLiter;
1263 wxString PropertyData;
1264 wxString PropertyName;
1265 wxString PropertyValue;
1266 wxString PropertyTokens;
1267 bool FirstToken = TRUE;
1268 int intPrevValue = 4;
1270 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1271 *wxSPropertyDataNameOut = wxT("FN");
1272 *VCardV3Value = TRUE;
1274 if (ProcessItemData == TRUE){
1276 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1280 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1284 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1285 intiter != SplitPoints.end(); ++intiter){
1287 SLiter = SplitLength.find(intiter->first);
1289 if (ProcessItemData == TRUE){
1291 if (FirstToken == TRUE){
1293 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1298 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1304 if (FirstToken == TRUE){
1306 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1311 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1317 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1318 PropertyName = PropertyElement.GetNextToken();
1319 PropertyValue = PropertyElement.GetNextToken();
1321 intPrevValue = intiter->second;
1323 // Process properties.
1325 if (PropertyName.IsEmpty()){
1331 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1333 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1334 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1338 PropertyDataMap->erase(PropertyName);
1339 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1340 PropertyLockMap->erase(PropertyName);
1341 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1351 if (wxSProperty == wxT("N")){
1353 if (ProcessItemData == TRUE){
1355 intPropertyLen = wxSPropertySeg1Chopped.Len();
1359 intPropertyLen = wxSPropertySeg1Ptr->Len();
1363 std::map<int, int> SplitPoints;
1364 std::map<int, int> SplitLength;
1365 std::map<int, int>::iterator SLiter;
1366 wxString PropertyData;
1367 wxString PropertyName;
1368 wxString PropertyValue;
1369 wxString PropertyTokens;
1370 bool FirstToken = TRUE;
1371 int intPrevValue = 3;
1373 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1374 *wxSPropertyDataNameOut = wxT("N");
1375 *VCardV3Value = TRUE;
1377 if (ProcessItemData == TRUE){
1379 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1383 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1387 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1388 intiter != SplitPoints.end(); ++intiter){
1390 SLiter = SplitLength.find(intiter->first);
1392 if (ProcessItemData == TRUE){
1394 if (FirstToken == TRUE){
1396 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1401 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1407 if (FirstToken == TRUE){
1409 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1414 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1420 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1421 PropertyName = PropertyElement.GetNextToken();
1422 PropertyValue = PropertyElement.GetNextToken();
1424 intPrevValue = intiter->second;
1426 // Process properties.
1428 if (PropertyName.IsEmpty()){
1434 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1436 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1437 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1441 PropertyDataMap->erase(PropertyName);
1442 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1443 PropertyLockMap->erase(PropertyName);
1444 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1454 if (wxSProperty == wxT("UID")){
1456 if (ProcessItemData == TRUE){
1458 intPropertyLen = wxSPropertySeg1Chopped.Len();
1462 intPropertyLen = wxSPropertySeg1Ptr->Len();
1466 std::map<int, int> SplitPoints;
1467 std::map<int, int> SplitLength;
1468 std::map<int, int>::iterator SLiter;
1469 wxString PropertyData;
1470 wxString PropertyName;
1471 wxString PropertyValue;
1472 wxString PropertyTokens;
1473 bool FirstToken = TRUE;
1474 int intPrevValue = 5;
1476 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1477 *wxSPropertyDataNameOut = wxT("UID");
1478 *VCardV3Value = TRUE;
1480 if (ProcessItemData == TRUE){
1482 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1486 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1490 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1491 intiter != SplitPoints.end(); ++intiter){
1493 SLiter = SplitLength.find(intiter->first);
1495 if (ProcessItemData == TRUE){
1497 if (FirstToken == TRUE){
1499 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1504 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1510 if (FirstToken == TRUE){
1512 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1517 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1523 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1524 PropertyName = PropertyElement.GetNextToken();
1525 PropertyValue = PropertyElement.GetNextToken();
1527 intPrevValue = intiter->second;
1529 // Process properties.
1531 if (PropertyName.IsEmpty()){
1537 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1539 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1540 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1544 PropertyDataMap->erase(PropertyName);
1545 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1546 PropertyLockMap->erase(PropertyName);
1547 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1557 if (wxSProperty == wxT("NICKNAME")){
1559 if (ProcessItemData == TRUE){
1561 intPropertyLen = wxSPropertySeg1Chopped.Len();
1565 intPropertyLen = wxSPropertySeg1Ptr->Len();
1569 std::map<int, int> SplitPoints;
1570 std::map<int, int> SplitLength;
1571 std::map<int, int>::iterator SLiter;
1572 wxString PropertyData;
1573 wxString PropertyName;
1574 wxString PropertyValue;
1575 wxString PropertyTokens;
1576 bool FirstToken = TRUE;
1577 int intPrevValue = 10;
1579 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1580 *wxSPropertyDataNameOut = wxT("NICKNAME");
1581 *VCardV3Value = TRUE;
1583 if (ProcessItemData == TRUE){
1585 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1589 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1593 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1594 intiter != SplitPoints.end(); ++intiter){
1596 SLiter = SplitLength.find(intiter->first);
1598 if (ProcessItemData == TRUE){
1600 if (FirstToken == TRUE){
1602 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1607 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1613 if (FirstToken == TRUE){
1615 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1620 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1626 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1627 PropertyName = PropertyElement.GetNextToken();
1628 PropertyValue = PropertyElement.GetNextToken();
1630 intPrevValue = intiter->second;
1632 // Process properties.
1634 if (PropertyName.IsEmpty()){
1640 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1642 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1643 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1647 PropertyDataMap->erase(PropertyName);
1648 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1649 PropertyLockMap->erase(PropertyName);
1650 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1660 if (wxSProperty == wxT("GENDER")){
1662 if (ProcessItemData == TRUE){
1664 intPropertyLen = wxSPropertySeg1Chopped.Len();
1668 intPropertyLen = wxSPropertySeg1Ptr->Len();
1672 std::map<int, int> SplitPoints;
1673 std::map<int, int> SplitLength;
1674 std::map<int, int>::iterator SLiter;
1675 wxString PropertyData;
1676 wxString PropertyName;
1677 wxString PropertyValue;
1678 wxString PropertyTokens;
1679 bool FirstToken = TRUE;
1680 int intPrevValue = 8;
1682 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1683 *wxSPropertyDataNameOut = wxT("GENDER");
1684 *VCardV3Value = TRUE;
1686 if (ProcessItemData == TRUE){
1688 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1692 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1696 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1697 intiter != SplitPoints.end(); ++intiter){
1699 SLiter = SplitLength.find(intiter->first);
1701 if (ProcessItemData == TRUE){
1703 if (FirstToken == TRUE){
1705 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1710 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1716 if (FirstToken == TRUE){
1718 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1723 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1729 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1730 PropertyName = PropertyElement.GetNextToken();
1731 PropertyValue = PropertyElement.GetNextToken();
1733 intPrevValue = intiter->second;
1735 // Process properties.
1737 if (PropertyName.IsEmpty()){
1743 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1745 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1746 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1750 PropertyDataMap->erase(PropertyName);
1751 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1752 PropertyLockMap->erase(PropertyName);
1753 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1763 if (wxSProperty == wxT("BDAY")){
1765 if (ProcessItemData == TRUE){
1767 intPropertyLen = wxSPropertySeg1Chopped.Len();
1771 intPropertyLen = wxSPropertySeg1Ptr->Len();
1775 std::map<int, int> SplitPoints;
1776 std::map<int, int> SplitLength;
1777 std::map<int, int>::iterator SLiter;
1778 wxString PropertyData;
1779 wxString PropertyName;
1780 wxString PropertyValue;
1781 wxString PropertyTokens;
1782 wxString PropertyXOmitYear;
1783 bool FirstToken = TRUE;
1784 int intPrevValue = 6;
1786 *wxSPropertyDataNameOut = wxT("BDAY");
1787 *VCardV3Value = TRUE;
1789 if (ProcessItemData == TRUE){
1791 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1795 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1799 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1800 intiter != SplitPoints.end(); ++intiter){
1802 SLiter = SplitLength.find(intiter->first);
1804 if (ProcessItemData == TRUE){
1806 if (FirstToken == TRUE){
1808 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1813 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1819 if (FirstToken == TRUE){
1821 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1826 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1832 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1833 PropertyName = PropertyElement.GetNextToken();
1834 PropertyValue = PropertyElement.GetNextToken();
1836 intPrevValue = intiter->second;
1838 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1839 PropertyXOmitYear = PropertyValue;
1842 // Process properties.
1844 if (PropertyName.IsEmpty()){
1850 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1852 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1853 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1857 PropertyDataMap->erase(PropertyName);
1858 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1859 PropertyLockMap->erase(PropertyName);
1860 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1866 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1867 // year matches the X-APPLE-OMIT-YEAR value.
1869 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1874 DateProc = DateSplit.GetNextToken();
1876 if (DateProc == PropertyXOmitYear){
1878 FinalDate.Append(wxT("--"));
1882 FinalDate.Append(DateProc);
1887 DateProc = DateSplit.GetNextToken();
1889 FinalDate.Append(DateProc);
1892 DateProc = DateSplit.GetNextToken();
1894 FinalDate.Append(DateProc);
1896 wxSPropertyDataOut->Append(FinalDate);
1902 if (wxSProperty == wxT("ANNIVERSARY")){
1904 if (ProcessItemData == TRUE){
1906 intPropertyLen = wxSPropertySeg1Chopped.Len();
1910 intPropertyLen = wxSPropertySeg1Ptr->Len();
1914 std::map<int, int> SplitPoints;
1915 std::map<int, int> SplitLength;
1916 std::map<int, int>::iterator SLiter;
1917 wxString PropertyData;
1918 wxString PropertyName;
1919 wxString PropertyValue;
1920 wxString PropertyTokens;
1921 wxString PropertyXOmitYear;
1922 bool FirstToken = TRUE;
1923 int intPrevValue = 13;
1925 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
1926 *VCardV3Value = TRUE;
1928 if (ProcessItemData == TRUE){
1930 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1934 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1938 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1939 intiter != SplitPoints.end(); ++intiter){
1941 SLiter = SplitLength.find(intiter->first);
1943 if (ProcessItemData == TRUE){
1945 if (FirstToken == TRUE){
1947 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1952 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1958 if (FirstToken == TRUE){
1960 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1965 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1971 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1972 PropertyName = PropertyElement.GetNextToken();
1973 PropertyValue = PropertyElement.GetNextToken();
1975 intPrevValue = intiter->second;
1977 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1978 PropertyXOmitYear = PropertyValue;
1981 // Process properties.
1983 if (PropertyName.IsEmpty()){
1989 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1991 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1992 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1996 PropertyDataMap->erase(PropertyName);
1997 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1998 PropertyLockMap->erase(PropertyName);
1999 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2005 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
2006 // year matches the X-APPLE-OMIT-YEAR value.
2008 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
2013 DateProc = DateSplit.GetNextToken();
2015 if (DateProc == PropertyXOmitYear){
2017 FinalDate.Append(wxT("--"));
2021 FinalDate.Append(DateProc);
2026 DateProc = DateSplit.GetNextToken();
2028 FinalDate.Append(DateProc);
2031 DateProc = DateSplit.GetNextToken();
2033 FinalDate.Append(DateProc);
2035 wxSPropertyDataOut->Append(FinalDate);
2039 // TZ - Not sure how to process this correctly. So data
2040 // is kept as X-VCARD3-TZ for the time being.
2042 if (wxSProperty == wxT("TZ")){
2044 if (ProcessItemData == TRUE){
2046 intPropertyLen = wxSPropertySeg1Chopped.Len();
2050 intPropertyLen = wxSPropertySeg1Ptr->Len();
2054 std::map<int, int> SplitPoints;
2055 std::map<int, int> SplitLength;
2056 std::map<int, int>::iterator SLiter;
2057 wxString PropertyData;
2058 wxString PropertyName;
2059 wxString PropertyValue;
2060 wxString PropertyTokens;
2061 wxString PropertyXOmitYear;
2062 bool FirstToken = TRUE;
2063 int intPrevValue = 4;
2065 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2066 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
2067 *VCardV3Value = TRUE;
2069 if (ProcessItemData == TRUE){
2071 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2075 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2079 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2080 intiter != SplitPoints.end(); ++intiter){
2082 SLiter = SplitLength.find(intiter->first);
2084 if (ProcessItemData == TRUE){
2086 if (FirstToken == TRUE){
2088 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2093 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2099 if (FirstToken == TRUE){
2101 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2106 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2112 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2113 PropertyName = PropertyElement.GetNextToken();
2114 PropertyValue = PropertyElement.GetNextToken();
2116 intPrevValue = intiter->second;
2118 // Process properties.
2120 if (PropertyName.IsEmpty()){
2126 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2128 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2129 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2133 PropertyDataMap->erase(PropertyName);
2134 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2135 PropertyLockMap->erase(PropertyName);
2136 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2146 if (wxSProperty == wxT("ROLE")){
2148 if (ProcessItemData == TRUE){
2150 intPropertyLen = wxSPropertySeg1Chopped.Len();
2154 intPropertyLen = wxSPropertySeg1Ptr->Len();
2158 std::map<int, int> SplitPoints;
2159 std::map<int, int> SplitLength;
2160 std::map<int, int>::iterator SLiter;
2161 wxString PropertyData;
2162 wxString PropertyName;
2163 wxString PropertyValue;
2164 wxString PropertyTokens;
2165 wxString PropertyXOmitYear;
2166 bool FirstToken = TRUE;
2167 int intPrevValue = 6;
2169 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2170 *wxSPropertyDataNameOut = wxT("ROLE");
2171 *VCardV3Value = TRUE;
2173 if (ProcessItemData == TRUE){
2175 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2179 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2183 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2184 intiter != SplitPoints.end(); ++intiter){
2186 SLiter = SplitLength.find(intiter->first);
2188 if (ProcessItemData == TRUE){
2190 if (FirstToken == TRUE){
2192 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2197 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2203 if (FirstToken == TRUE){
2205 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2210 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2216 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2217 PropertyName = PropertyElement.GetNextToken();
2218 PropertyValue = PropertyElement.GetNextToken();
2220 intPrevValue = intiter->second;
2222 // Process properties.
2224 if (PropertyName.IsEmpty()){
2230 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2232 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2233 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2237 PropertyDataMap->erase(PropertyName);
2238 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2239 PropertyLockMap->erase(PropertyName);
2240 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2250 if (wxSProperty == wxT("ORG")){
2252 if (ProcessItemData == TRUE){
2254 intPropertyLen = wxSPropertySeg1Chopped.Len();
2258 intPropertyLen = wxSPropertySeg1Ptr->Len();
2262 std::map<int, int> SplitPoints;
2263 std::map<int, int> SplitLength;
2264 std::map<int, int>::iterator SLiter;
2265 wxString PropertyData;
2266 wxString PropertyName;
2267 wxString PropertyValue;
2268 wxString PropertyTokens;
2269 wxString PropertyXOmitYear;
2270 bool FirstToken = TRUE;
2271 int intPrevValue = 5;
2273 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2274 *wxSPropertyDataNameOut = wxT("ORG");
2275 *VCardV3Value = TRUE;
2277 if (ProcessItemData == TRUE){
2279 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2283 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2287 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2288 intiter != SplitPoints.end(); ++intiter){
2290 SLiter = SplitLength.find(intiter->first);
2292 if (ProcessItemData == TRUE){
2294 if (FirstToken == TRUE){
2296 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2301 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2307 if (FirstToken == TRUE){
2309 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2314 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2320 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2321 PropertyName = PropertyElement.GetNextToken();
2322 PropertyValue = PropertyElement.GetNextToken();
2324 intPrevValue = intiter->second;
2326 // Process properties.
2328 if (PropertyName.IsEmpty()){
2334 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2336 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2337 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2341 PropertyDataMap->erase(PropertyName);
2342 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2343 PropertyLockMap->erase(PropertyName);
2344 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2354 if (wxSProperty == wxT("NOTE")){
2356 if (ProcessItemData == TRUE){
2358 intPropertyLen = wxSPropertySeg1Chopped.Len();
2362 intPropertyLen = wxSPropertySeg1Ptr->Len();
2366 std::map<int, int> SplitPoints;
2367 std::map<int, int> SplitLength;
2368 std::map<int, int>::iterator SLiter;
2369 wxString PropertyData;
2370 wxString PropertyName;
2371 wxString PropertyValue;
2372 wxString PropertyTokens;
2373 wxString PropertyXOmitYear;
2374 bool FirstToken = TRUE;
2375 int intPrevValue = 6;
2377 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2378 *wxSPropertyDataNameOut = wxT("NOTE");
2379 *VCardV3Value = TRUE;
2381 if (ProcessItemData == TRUE){
2383 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2387 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2391 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2392 intiter != SplitPoints.end(); ++intiter){
2394 SLiter = SplitLength.find(intiter->first);
2396 if (ProcessItemData == TRUE){
2398 if (FirstToken == TRUE){
2400 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2405 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2411 if (FirstToken == TRUE){
2413 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2418 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2424 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2425 PropertyName = PropertyElement.GetNextToken();
2426 PropertyValue = PropertyElement.GetNextToken();
2428 intPrevValue = intiter->second;
2430 // Process properties.
2432 if (PropertyName.IsEmpty()){
2438 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2440 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2441 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2445 PropertyDataMap->erase(PropertyName);
2446 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2447 PropertyLockMap->erase(PropertyName);
2448 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2458 if (wxSProperty == wxT("PHOTO")){
2460 if (ProcessItemData == TRUE){
2462 intPropertyLen = wxSPropertySeg1Chopped.Len();
2466 intPropertyLen = wxSPropertySeg1Ptr->Len();
2470 std::map<int, int> SplitPoints;
2471 std::map<int, int> SplitLength;
2472 std::map<int, int>::iterator SLiter;
2473 std::map<wxString, wxString> SplitData;
2474 wxString PropertyData;
2475 wxString PropertyName;
2476 wxString PropertyValue;
2477 wxString PropertyTokens;
2478 wxString PropertyXOmitYear;
2479 int intPrevValue = 7;
2481 *wxSPropertyDataNameOut = wxT("PHOTO");
2482 *VCardV3Value = TRUE;
2484 if (ProcessItemData == TRUE){
2486 SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2490 SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2494 wxString wxSMIMEType;
2495 wxString wxSEncType;
2497 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
2498 intiter != SplitData.end(); ++intiter){
2500 PropertyName = intiter->first;
2501 PropertyValue = intiter->second;
2503 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2504 wxSEncType = wxT("base64");
2508 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
2509 wxSMIMEType = wxT("image/png");
2511 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
2512 wxSMIMEType = wxT("image/jpeg");
2514 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
2515 wxSMIMEType = wxT("image/gif");
2517 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
2518 wxSMIMEType = wxT("image/bmp");
2520 } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
2521 wxSMIMEType = wxT("image/unknown");
2525 // Process properties.
2527 if (PropertyName.IsEmpty()){
2533 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2535 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2536 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2540 PropertyDataMap->erase(PropertyName);
2541 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2542 PropertyLockMap->erase(PropertyName);
2543 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2549 wxSPropertyDataOut->Append(wxT("data:"));
2550 wxSPropertyDataOut->Append(wxSMIMEType);
2551 wxSPropertyDataOut->Append(wxT(";"));
2552 wxSPropertyDataOut->Append(wxSEncType);
2553 wxSPropertyDataOut->Append(wxT(","));
2554 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2560 if (wxSProperty == wxT("SOUND")){
2562 if (ProcessItemData == TRUE){
2564 intPropertyLen = wxSPropertySeg1Chopped.Len();
2568 intPropertyLen = wxSPropertySeg1Ptr->Len();
2572 std::map<int, int> SplitPoints;
2573 std::map<int, int> SplitLength;
2574 std::map<int, int>::iterator SLiter;
2575 wxString PropertyData;
2576 wxString PropertyName;
2577 wxString PropertyValue;
2578 wxString PropertyTokens;
2579 wxString PropertyXOmitYear;
2580 bool FirstToken = TRUE;
2581 int intPrevValue = 7;
2583 *wxSPropertyDataNameOut = wxT("SOUND");
2584 *VCardV3Value = TRUE;
2586 if (ProcessItemData == TRUE){
2588 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2592 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2596 wxString wxSMIMEType;
2597 wxString wxSEncType;
2599 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2600 intiter != SplitPoints.end(); ++intiter){
2602 SLiter = SplitLength.find(intiter->first);
2604 if (ProcessItemData == TRUE){
2606 if (FirstToken == TRUE){
2608 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2613 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2619 if (FirstToken == TRUE){
2621 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2626 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2632 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2633 PropertyName = PropertyElement.GetNextToken();
2634 PropertyValue = PropertyElement.GetNextToken();
2636 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2637 wxSEncType = wxT("base64");
2641 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
2642 wxSMIMEType = PropertyValue;
2646 intPrevValue = intiter->second;
2648 // Process properties.
2650 if (PropertyName.IsEmpty()){
2656 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2658 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2659 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2663 PropertyDataMap->erase(PropertyName);
2664 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2665 PropertyLockMap->erase(PropertyName);
2666 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2672 wxSPropertyDataOut->Append(wxT("data:"));
2673 wxSPropertyDataOut->Append(wxSMIMEType);
2674 wxSPropertyDataOut->Append(wxT(";"));
2675 wxSPropertyDataOut->Append(wxSEncType);
2676 wxSPropertyDataOut->Append(wxT(","));
2677 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2681 // Look for backward compatability vCard 4.0 properties.
2685 if (wxSProperty == wxT("X-VCARD4-FN")){
2687 if (ProcessItemData == TRUE){
2689 intPropertyLen = wxSPropertySeg1Chopped.Len();
2693 intPropertyLen = wxSPropertySeg1Ptr->Len();
2694 *wxSPropertyDataNameOut = wxT("FN");
2698 std::map<int, int> SplitPoints;
2699 std::map<int, int> SplitLength;
2700 std::map<int, int>::iterator SLiter;
2701 std::map<wxString, bool>::iterator BIter;;
2702 wxString PropertyData;
2703 wxString PropertyName;
2704 wxString PropertyValue;
2705 wxString PropertyTokens;
2706 bool FirstToken = TRUE;
2707 int intPrevValue = 13;
2709 if (ProcessItemData == TRUE){
2711 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2715 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2719 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2720 intiter != SplitPoints.end(); ++intiter){
2722 SLiter = SplitLength.find(intiter->first);
2724 if (ProcessItemData == TRUE){
2726 if (FirstToken == TRUE){
2728 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2733 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2739 if (FirstToken == TRUE){
2741 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2746 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2752 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2753 PropertyName = PropertyElement.GetNextToken();
2754 PropertyValue = PropertyElement.GetNextToken();
2756 intPrevValue = intiter->second;
2758 // Process properties.
2760 // Check if there is a lock on the property value. If there is a lock then
2761 // the property value cannot be changed.
2763 if (PropertyName.IsEmpty()){
2769 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2771 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2773 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2777 PropertyDataMap->erase(PropertyName);
2778 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2786 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2787 *XVCardV4Value = TRUE;
2793 if (wxSProperty == wxT("X-VCARD4-N")){
2795 if (ProcessItemData == TRUE){
2797 intPropertyLen = wxSPropertySeg1Chopped.Len();
2801 intPropertyLen = wxSPropertySeg1Ptr->Len();
2805 std::map<int, int> SplitPoints;
2806 std::map<int, int> SplitLength;
2807 std::map<int, int>::iterator SLiter;
2808 std::map<wxString, bool>::iterator BIter;;
2809 wxString PropertyData;
2810 wxString PropertyName;
2811 wxString PropertyValue;
2812 wxString PropertyTokens;
2813 bool FirstToken = TRUE;
2814 int intPrevValue = 12;
2816 if (ProcessItemData == TRUE){
2818 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2822 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2823 *wxSPropertyDataNameOut = wxT("N");
2827 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2828 intiter != SplitPoints.end(); ++intiter){
2830 SLiter = SplitLength.find(intiter->first);
2832 if (ProcessItemData == TRUE){
2834 if (FirstToken == TRUE){
2836 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2841 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2847 if (FirstToken == TRUE){
2849 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2854 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2860 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2861 PropertyName = PropertyElement.GetNextToken();
2862 PropertyValue = PropertyElement.GetNextToken();
2864 intPrevValue = intiter->second;
2866 // Process properties.
2868 // Check if there is a lock on the property value. If there is a lock then
2869 // the property value cannot be changed.
2871 if (PropertyName.IsEmpty()){
2877 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2879 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2881 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2885 PropertyDataMap->erase(PropertyName);
2886 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2894 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2895 *XVCardV4Value = TRUE;
2899 // X-VCARD4-NICKNAME
2901 if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
2903 if (ProcessItemData == TRUE){
2905 intPropertyLen = wxSPropertySeg1Chopped.Len();
2909 intPropertyLen = wxSPropertySeg1Ptr->Len();
2913 std::map<int, int> SplitPoints;
2914 std::map<int, int> SplitLength;
2915 std::map<int, int>::iterator SLiter;
2916 std::map<wxString, bool>::iterator BIter;;
2917 wxString PropertyData;
2918 wxString PropertyName;
2919 wxString PropertyValue;
2920 wxString PropertyTokens;
2921 bool FirstToken = TRUE;
2922 int intPrevValue = 19;
2924 if (ProcessItemData == TRUE){
2926 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2930 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2931 *wxSPropertyDataNameOut = wxT("NICKNAME");
2935 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2936 intiter != SplitPoints.end(); ++intiter){
2938 SLiter = SplitLength.find(intiter->first);
2940 if (ProcessItemData == TRUE){
2942 if (FirstToken == TRUE){
2944 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2949 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2955 if (FirstToken == TRUE){
2957 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2962 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2968 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2969 PropertyName = PropertyElement.GetNextToken();
2970 PropertyValue = PropertyElement.GetNextToken();
2972 intPrevValue = intiter->second;
2974 // Process properties.
2976 // Check if there is a lock on the property value. If there is a lock then
2977 // the property value cannot be changed.
2979 if (PropertyName.IsEmpty()){
2985 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2987 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2989 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2993 PropertyDataMap->erase(PropertyName);
2994 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3002 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3003 *XVCardV4Value = TRUE;
3009 if (wxSProperty == wxT("X-VCARD4-GENDER")){
3011 if (ProcessItemData == TRUE){
3013 intPropertyLen = wxSPropertySeg1Chopped.Len();
3017 intPropertyLen = wxSPropertySeg1Ptr->Len();
3021 std::map<int, int> SplitPoints;
3022 std::map<int, int> SplitLength;
3023 std::map<int, int>::iterator SLiter;
3024 std::map<wxString, bool>::iterator BIter;;
3025 wxString PropertyData;
3026 wxString PropertyName;
3027 wxString PropertyValue;
3028 wxString PropertyTokens;
3029 bool FirstToken = TRUE;
3030 int intPrevValue = 17;
3032 if (ProcessItemData == TRUE){
3034 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3038 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3039 *wxSPropertyDataNameOut = wxT("GENDER");
3043 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3044 intiter != SplitPoints.end(); ++intiter){
3046 SLiter = SplitLength.find(intiter->first);
3048 if (ProcessItemData == TRUE){
3050 if (FirstToken == TRUE){
3052 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3057 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3063 if (FirstToken == TRUE){
3065 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3070 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3076 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3077 PropertyName = PropertyElement.GetNextToken();
3078 PropertyValue = PropertyElement.GetNextToken();
3080 //ProcessCaptureStrings(&PropertyValue);
3082 intPrevValue = intiter->second;
3084 // Process properties.
3086 // Check if there is a lock on the property value. If there is a lock then
3087 // the property value cannot be changed.
3089 if (PropertyName.IsEmpty()){
3095 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3097 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3099 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3103 PropertyDataMap->erase(PropertyName);
3104 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3112 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3113 *XVCardV4Value = TRUE;
3119 if (wxSProperty == wxT("X-VCARD4-BDAY")){
3121 if (ProcessItemData == TRUE){
3123 intPropertyLen = wxSPropertySeg1Chopped.Len();
3127 intPropertyLen = wxSPropertySeg1Ptr->Len();
3131 std::map<int, int> SplitPoints;
3132 std::map<int, int> SplitLength;
3133 std::map<int, int>::iterator SLiter;
3134 std::map<wxString, bool>::iterator BIter;;
3135 wxString PropertyData;
3136 wxString PropertyName;
3137 wxString PropertyValue;
3138 wxString PropertyTokens;
3139 bool FirstToken = TRUE;
3140 int intPrevValue = 15;
3142 if (ProcessItemData == TRUE){
3144 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3148 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3149 *wxSPropertyDataNameOut = wxT("BDAY");
3153 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3154 intiter != SplitPoints.end(); ++intiter){
3156 SLiter = SplitLength.find(intiter->first);
3158 if (ProcessItemData == TRUE){
3160 if (FirstToken == TRUE){
3162 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3167 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3173 if (FirstToken == TRUE){
3175 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3180 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3186 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3187 PropertyName = PropertyElement.GetNextToken();
3188 PropertyValue = PropertyElement.GetNextToken();
3190 intPrevValue = intiter->second;
3192 // Process properties.
3194 // Check if there is a lock on the property value. If there is a lock then
3195 // the property value cannot be changed.
3197 if (PropertyName.IsEmpty()){
3203 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3205 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3207 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3211 PropertyDataMap->erase(PropertyName);
3212 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3220 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3221 *XVCardV4Value = TRUE;
3225 // X-VCARD4-ANNIVERSARY
3227 if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
3229 if (ProcessItemData == TRUE){
3231 intPropertyLen = wxSPropertySeg1Chopped.Len();
3235 intPropertyLen = wxSPropertySeg1Ptr->Len();
3239 std::map<int, int> SplitPoints;
3240 std::map<int, int> SplitLength;
3241 std::map<int, int>::iterator SLiter;
3242 std::map<wxString, bool>::iterator BIter;;
3243 wxString PropertyData;
3244 wxString PropertyName;
3245 wxString PropertyValue;
3246 wxString PropertyTokens;
3247 bool FirstToken = TRUE;
3248 int intPrevValue = 22;
3250 if (ProcessItemData == TRUE){
3252 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3256 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3257 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
3261 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3262 intiter != SplitPoints.end(); ++intiter){
3264 SLiter = SplitLength.find(intiter->first);
3266 if (ProcessItemData == TRUE){
3268 if (FirstToken == TRUE){
3270 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3275 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3281 if (FirstToken == TRUE){
3283 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3288 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3294 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3295 PropertyName = PropertyElement.GetNextToken();
3296 PropertyValue = PropertyElement.GetNextToken();
3298 intPrevValue = intiter->second;
3300 // Process properties.
3302 // Check if there is a lock on the property value. If there is a lock then
3303 // the property value cannot be changed.
3305 if (PropertyName.IsEmpty()){
3311 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3313 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3315 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3319 PropertyDataMap->erase(PropertyName);
3320 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3328 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3329 *XVCardV4Value = TRUE;
3335 if (wxSProperty == wxT("X-VCARD4-TZ")){
3337 if (ProcessItemData == TRUE){
3339 intPropertyLen = wxSPropertySeg1Chopped.Len();
3343 intPropertyLen = wxSPropertySeg1Ptr->Len();
3347 std::map<int, int> SplitPoints;
3348 std::map<int, int> SplitLength;
3349 std::map<int, int>::iterator SLiter;
3350 std::map<wxString, bool>::iterator BIter;;
3351 wxString PropertyData;
3352 wxString PropertyName;
3353 wxString PropertyValue;
3354 wxString PropertyTokens;
3355 bool FirstToken = TRUE;
3356 int intPrevValue = 13;
3358 if (ProcessItemData == TRUE){
3360 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3364 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3365 *wxSPropertyDataNameOut = wxT("TZ");
3369 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3370 intiter != SplitPoints.end(); ++intiter){
3372 SLiter = SplitLength.find(intiter->first);
3374 if (ProcessItemData == TRUE){
3376 if (FirstToken == TRUE){
3378 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3383 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3389 if (FirstToken == TRUE){
3391 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3396 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3402 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3403 PropertyName = PropertyElement.GetNextToken();
3404 PropertyValue = PropertyElement.GetNextToken();
3406 intPrevValue = intiter->second;
3408 // Process properties.
3410 // Check if there is a lock on the property value. If there is a lock then
3411 // the property value cannot be changed.
3413 if (PropertyName.IsEmpty()){
3419 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3421 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3423 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3427 PropertyDataMap->erase(PropertyName);
3428 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3436 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3437 *XVCardV4Value = TRUE;
3443 if (wxSProperty == wxT("X-VCARD4-ADR")){
3445 if (ProcessItemData == TRUE){
3447 intPropertyLen = wxSPropertySeg1Chopped.Len();
3451 intPropertyLen = wxSPropertySeg1Ptr->Len();
3455 std::map<int, int> SplitPoints;
3456 std::map<int, int> SplitLength;
3457 std::map<int, int>::iterator SLiter;
3458 std::map<wxString, bool>::iterator BIter;;
3459 wxString PropertyData;
3460 wxString PropertyName;
3461 wxString PropertyValue;
3462 wxString PropertyTokens;
3463 bool FirstToken = TRUE;
3464 int intPrevValue = 14;
3466 if (ProcessItemData == TRUE){
3468 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3472 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3473 *wxSPropertyDataNameOut = wxT("ADR");
3477 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3478 intiter != SplitPoints.end(); ++intiter){
3480 SLiter = SplitLength.find(intiter->first);
3482 if (ProcessItemData == TRUE){
3484 if (FirstToken == TRUE){
3486 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3491 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3497 if (FirstToken == TRUE){
3499 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3504 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3510 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3511 PropertyName = PropertyElement.GetNextToken();
3512 PropertyValue = PropertyElement.GetNextToken();
3514 intPrevValue = intiter->second;
3516 // Process properties.
3518 // Check if there is a lock on the property value. If there is a lock then
3519 // the property value cannot be changed.
3521 if (PropertyName.IsEmpty()){
3527 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3529 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3531 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3535 PropertyDataMap->erase(PropertyName);
3536 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3544 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3545 *XVCardV4Value = TRUE;
3551 if (wxSProperty == wxT("X-VCARD4-EMAIL")){
3553 if (ProcessItemData == TRUE){
3555 intPropertyLen = wxSPropertySeg1Chopped.Len();
3559 intPropertyLen = wxSPropertySeg1Ptr->Len();
3563 std::map<int, int> SplitPoints;
3564 std::map<int, int> SplitLength;
3565 std::map<int, int>::iterator SLiter;
3566 std::map<wxString, bool>::iterator BIter;;
3567 wxString PropertyData;
3568 wxString PropertyName;
3569 wxString PropertyValue;
3570 wxString PropertyTokens;
3571 bool FirstToken = TRUE;
3572 int intPrevValue = 16;
3574 if (ProcessItemData == TRUE){
3576 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3580 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3581 *wxSPropertyDataNameOut = wxT("EMAIL");
3585 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3586 intiter != SplitPoints.end(); ++intiter){
3588 SLiter = SplitLength.find(intiter->first);
3590 if (ProcessItemData == TRUE){
3592 if (FirstToken == TRUE){
3594 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3599 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3605 if (FirstToken == TRUE){
3607 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3612 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3618 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3619 PropertyName = PropertyElement.GetNextToken();
3620 PropertyValue = PropertyElement.GetNextToken();
3622 intPrevValue = intiter->second;
3624 // Process properties.
3626 // Check if there is a lock on the property value. If there is a lock then
3627 // the property value cannot be changed.
3629 if (PropertyName.IsEmpty()){
3635 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3637 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3639 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3643 PropertyDataMap->erase(PropertyName);
3644 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3652 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3653 *XVCardV4Value = TRUE;
3659 if (wxSProperty == wxT("X-VCARD4-IMPP")){
3661 if (ProcessItemData == TRUE){
3663 intPropertyLen = wxSPropertySeg1Chopped.Len();
3667 intPropertyLen = wxSPropertySeg1Ptr->Len();
3671 std::map<int, int> SplitPoints;
3672 std::map<int, int> SplitLength;
3673 std::map<int, int>::iterator SLiter;
3674 std::map<wxString, bool>::iterator BIter;;
3675 wxString PropertyData;
3676 wxString PropertyName;
3677 wxString PropertyValue;
3678 wxString PropertyTokens;
3679 bool FirstToken = TRUE;
3680 int intPrevValue = 15;
3682 if (ProcessItemData == TRUE){
3684 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3688 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3689 *wxSPropertyDataNameOut = wxT("IMPP");
3693 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3694 intiter != SplitPoints.end(); ++intiter){
3696 SLiter = SplitLength.find(intiter->first);
3698 if (ProcessItemData == TRUE){
3700 if (FirstToken == TRUE){
3702 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3707 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3713 if (FirstToken == TRUE){
3715 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3720 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3726 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3727 PropertyName = PropertyElement.GetNextToken();
3728 PropertyValue = PropertyElement.GetNextToken();
3730 intPrevValue = intiter->second;
3732 // Process properties.
3734 // Check if there is a lock on the property value. If there is a lock then
3735 // the property value cannot be changed.
3737 if (PropertyName.IsEmpty()){
3743 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3745 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3747 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3751 PropertyDataMap->erase(PropertyName);
3752 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3760 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3761 *XVCardV4Value = TRUE;
3767 if (wxSProperty == wxT("X-VCARD4-TEL")){
3769 if (ProcessItemData == TRUE){
3771 intPropertyLen = wxSPropertySeg1Chopped.Len();
3775 intPropertyLen = wxSPropertySeg1Ptr->Len();
3779 std::map<int, int> SplitPoints;
3780 std::map<int, int> SplitLength;
3781 std::map<int, int>::iterator SLiter;
3782 std::map<wxString, bool>::iterator BIter;;
3783 wxString PropertyData;
3784 wxString PropertyName;
3785 wxString PropertyValue;
3786 wxString PropertyTokens;
3787 bool FirstToken = TRUE;
3788 int intPrevValue = 14;
3790 if (ProcessItemData == TRUE){
3792 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3796 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3797 *wxSPropertyDataNameOut = wxT("TEL");
3801 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3802 intiter != SplitPoints.end(); ++intiter){
3804 SLiter = SplitLength.find(intiter->first);
3806 if (ProcessItemData == TRUE){
3808 if (FirstToken == TRUE){
3810 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3815 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3821 if (FirstToken == TRUE){
3823 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3828 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3834 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3835 PropertyName = PropertyElement.GetNextToken();
3836 PropertyValue = PropertyElement.GetNextToken();
3838 intPrevValue = intiter->second;
3840 // Process properties.
3842 // Check if there is a lock on the property value. If there is a lock then
3843 // the property value cannot be changed.
3845 if (PropertyName.IsEmpty()){
3851 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3853 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3855 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3859 PropertyDataMap->erase(PropertyName);
3860 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3868 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3869 *XVCardV4Value = TRUE;
3875 if (wxSProperty == wxT("X-VCARD4-LANG")){
3877 if (ProcessItemData == TRUE){
3879 intPropertyLen = wxSPropertySeg1Chopped.Len();
3883 intPropertyLen = wxSPropertySeg1Ptr->Len();
3887 std::map<int, int> SplitPoints;
3888 std::map<int, int> SplitLength;
3889 std::map<int, int>::iterator SLiter;
3890 std::map<wxString, bool>::iterator BIter;;
3891 wxString PropertyData;
3892 wxString PropertyName;
3893 wxString PropertyValue;
3894 wxString PropertyTokens;
3895 bool FirstToken = TRUE;
3896 int intPrevValue = 15;
3898 if (ProcessItemData == TRUE){
3900 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3904 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3905 *wxSPropertyDataNameOut = wxT("LANG");
3909 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3910 intiter != SplitPoints.end(); ++intiter){
3912 SLiter = SplitLength.find(intiter->first);
3914 if (ProcessItemData == TRUE){
3916 if (FirstToken == TRUE){
3918 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3923 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3929 if (FirstToken == TRUE){
3931 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3936 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3942 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3943 PropertyName = PropertyElement.GetNextToken();
3944 PropertyValue = PropertyElement.GetNextToken();
3946 intPrevValue = intiter->second;
3948 // Process properties.
3950 // Check if there is a lock on the property value. If there is a lock then
3951 // the property value cannot be changed.
3953 if (PropertyName.IsEmpty()){
3959 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3961 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3963 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3967 PropertyDataMap->erase(PropertyName);
3968 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3976 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3977 *XVCardV4Value = TRUE;
3983 if (wxSProperty == wxT("X-VCARD4-GEO")){
3985 if (ProcessItemData == TRUE){
3987 intPropertyLen = wxSPropertySeg1Chopped.Len();
3991 intPropertyLen = wxSPropertySeg1Ptr->Len();
3995 std::map<int, int> SplitPoints;
3996 std::map<int, int> SplitLength;
3997 std::map<int, int>::iterator SLiter;
3998 std::map<wxString, bool>::iterator BIter;;
3999 wxString PropertyData;
4000 wxString PropertyName;
4001 wxString PropertyValue;
4002 wxString PropertyTokens;
4003 bool FirstToken = TRUE;
4004 int intPrevValue = 14;
4006 if (ProcessItemData == TRUE){
4008 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4012 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4013 *wxSPropertyDataNameOut = wxT("GEO");
4017 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4018 intiter != SplitPoints.end(); ++intiter){
4020 SLiter = SplitLength.find(intiter->first);
4022 if (ProcessItemData == TRUE){
4024 if (FirstToken == TRUE){
4026 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4031 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4037 if (FirstToken == TRUE){
4039 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4044 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4050 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4051 PropertyName = PropertyElement.GetNextToken();
4052 PropertyValue = PropertyElement.GetNextToken();
4054 intPrevValue = intiter->second;
4056 // Process properties.
4058 // Check if there is a lock on the property value. If there is a lock then
4059 // the property value cannot be changed.
4061 if (PropertyName.IsEmpty()){
4067 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4069 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4071 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4075 PropertyDataMap->erase(PropertyName);
4076 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4084 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4085 *XVCardV4Value = TRUE;
4091 if (wxSProperty == wxT("X-VCARD4-RELATED")){
4093 if (ProcessItemData == TRUE){
4095 intPropertyLen = wxSPropertySeg1Chopped.Len();
4099 intPropertyLen = wxSPropertySeg1Ptr->Len();
4103 std::map<int, int> SplitPoints;
4104 std::map<int, int> SplitLength;
4105 std::map<int, int>::iterator SLiter;
4106 std::map<wxString, bool>::iterator BIter;;
4107 wxString PropertyData;
4108 wxString PropertyName;
4109 wxString PropertyValue;
4110 wxString PropertyTokens;
4111 bool FirstToken = TRUE;
4112 int intPrevValue = 18;
4114 if (ProcessItemData == TRUE){
4116 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4120 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4121 *wxSPropertyDataNameOut = wxT("RELATED");
4125 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4126 intiter != SplitPoints.end(); ++intiter){
4128 SLiter = SplitLength.find(intiter->first);
4130 if (ProcessItemData == TRUE){
4132 if (FirstToken == TRUE){
4134 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4139 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4145 if (FirstToken == TRUE){
4147 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4152 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4158 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4159 PropertyName = PropertyElement.GetNextToken();
4160 PropertyValue = PropertyElement.GetNextToken();
4162 intPrevValue = intiter->second;
4164 // Process properties.
4166 // Check if there is a lock on the property value. If there is a lock then
4167 // the property value cannot be changed.
4169 if (PropertyName.IsEmpty()){
4175 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4177 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4179 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4183 PropertyDataMap->erase(PropertyName);
4184 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4192 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4193 *XVCardV4Value = TRUE;
4199 if (wxSProperty == wxT("X-VCARD4-URL")){
4201 if (ProcessItemData == TRUE){
4203 intPropertyLen = wxSPropertySeg1Chopped.Len();
4207 intPropertyLen = wxSPropertySeg1Ptr->Len();
4211 std::map<int, int> SplitPoints;
4212 std::map<int, int> SplitLength;
4213 std::map<int, int>::iterator SLiter;
4214 std::map<wxString, bool>::iterator BIter;;
4215 wxString PropertyData;
4216 wxString PropertyName;
4217 wxString PropertyValue;
4218 wxString PropertyTokens;
4219 bool FirstToken = TRUE;
4220 int intPrevValue = 14;
4222 if (ProcessItemData == TRUE){
4224 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4228 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4229 *wxSPropertyDataNameOut = wxT("URL");
4233 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4234 intiter != SplitPoints.end(); ++intiter){
4236 SLiter = SplitLength.find(intiter->first);
4238 if (ProcessItemData == TRUE){
4240 if (FirstToken == TRUE){
4242 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4247 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4253 if (FirstToken == TRUE){
4255 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4260 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4266 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4267 PropertyName = PropertyElement.GetNextToken();
4268 PropertyValue = PropertyElement.GetNextToken();
4270 intPrevValue = intiter->second;
4272 // Process properties.
4274 // Check if there is a lock on the property value. If there is a lock then
4275 // the property value cannot be changed.
4277 if (PropertyName.IsEmpty()){
4283 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4285 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4287 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4291 PropertyDataMap->erase(PropertyName);
4292 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4300 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4301 *XVCardV4Value = TRUE;
4307 if (wxSProperty == wxT("X-VCARD4-TITLE")){
4309 if (ProcessItemData == TRUE){
4311 intPropertyLen = wxSPropertySeg1Chopped.Len();
4315 intPropertyLen = wxSPropertySeg1Ptr->Len();
4319 std::map<int, int> SplitPoints;
4320 std::map<int, int> SplitLength;
4321 std::map<int, int>::iterator SLiter;
4322 std::map<wxString, bool>::iterator BIter;;
4323 wxString PropertyData;
4324 wxString PropertyName;
4325 wxString PropertyValue;
4326 wxString PropertyTokens;
4327 bool FirstToken = TRUE;
4328 int intPrevValue = 16;
4330 if (ProcessItemData == TRUE){
4332 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4336 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4337 *wxSPropertyDataNameOut = wxT("TITLE");
4341 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4342 intiter != SplitPoints.end(); ++intiter){
4344 SLiter = SplitLength.find(intiter->first);
4346 if (ProcessItemData == TRUE){
4348 if (FirstToken == TRUE){
4350 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4355 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4361 if (FirstToken == TRUE){
4363 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4368 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4374 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4375 PropertyName = PropertyElement.GetNextToken();
4376 PropertyValue = PropertyElement.GetNextToken();
4378 intPrevValue = intiter->second;
4380 // Process properties.
4382 // Check if there is a lock on the property value. If there is a lock then
4383 // the property value cannot be changed.
4385 if (PropertyName.IsEmpty()){
4391 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4393 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4395 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4399 PropertyDataMap->erase(PropertyName);
4400 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4408 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4409 *XVCardV4Value = TRUE;
4415 if (wxSProperty == wxT("X-VCARD4-ROLE")){
4417 if (ProcessItemData == TRUE){
4419 intPropertyLen = wxSPropertySeg1Chopped.Len();
4423 intPropertyLen = wxSPropertySeg1Ptr->Len();
4427 std::map<int, int> SplitPoints;
4428 std::map<int, int> SplitLength;
4429 std::map<int, int>::iterator SLiter;
4430 std::map<wxString, bool>::iterator BIter;;
4431 wxString PropertyData;
4432 wxString PropertyName;
4433 wxString PropertyValue;
4434 wxString PropertyTokens;
4435 bool FirstToken = TRUE;
4436 int intPrevValue = 15;
4438 if (ProcessItemData == TRUE){
4440 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4444 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4445 *wxSPropertyDataNameOut = wxT("ROLE");
4449 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4450 intiter != SplitPoints.end(); ++intiter){
4452 SLiter = SplitLength.find(intiter->first);
4454 if (ProcessItemData == TRUE){
4456 if (FirstToken == TRUE){
4458 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4463 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4469 if (FirstToken == TRUE){
4471 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4476 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4482 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4483 PropertyName = PropertyElement.GetNextToken();
4484 PropertyValue = PropertyElement.GetNextToken();
4486 intPrevValue = intiter->second;
4488 // Process properties.
4490 // Check if there is a lock on the property value. If there is a lock then
4491 // the property value cannot be changed.
4493 if (PropertyName.IsEmpty()){
4499 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4501 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4503 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4507 PropertyDataMap->erase(PropertyName);
4508 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4516 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4517 *XVCardV4Value = TRUE;
4523 if (wxSProperty == wxT("X-VCARD4-ORG")){
4525 if (ProcessItemData == TRUE){
4527 intPropertyLen = wxSPropertySeg1Chopped.Len();
4531 intPropertyLen = wxSPropertySeg1Ptr->Len();
4535 std::map<int, int> SplitPoints;
4536 std::map<int, int> SplitLength;
4537 std::map<int, int>::iterator SLiter;
4538 std::map<wxString, bool>::iterator BIter;;
4539 wxString PropertyData;
4540 wxString PropertyName;
4541 wxString PropertyValue;
4542 wxString PropertyTokens;
4543 bool FirstToken = TRUE;
4544 int intPrevValue = 14;
4546 if (ProcessItemData == TRUE){
4548 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4552 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4553 *wxSPropertyDataNameOut = wxT("ORG");
4557 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4558 intiter != SplitPoints.end(); ++intiter){
4560 SLiter = SplitLength.find(intiter->first);
4562 if (ProcessItemData == TRUE){
4564 if (FirstToken == TRUE){
4566 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4571 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4577 if (FirstToken == TRUE){
4579 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4584 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4590 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4591 PropertyName = PropertyElement.GetNextToken();
4592 PropertyValue = PropertyElement.GetNextToken();
4594 intPrevValue = intiter->second;
4596 // Process properties.
4598 // Check if there is a lock on the property value. If there is a lock then
4599 // the property value cannot be changed.
4601 if (PropertyName.IsEmpty()){
4607 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4609 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4611 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4615 PropertyDataMap->erase(PropertyName);
4616 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4624 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4625 *XVCardV4Value = TRUE;
4631 if (wxSProperty == wxT("X-VCARD4-NOTE")){
4633 if (ProcessItemData == TRUE){
4635 intPropertyLen = wxSPropertySeg1Chopped.Len();
4639 intPropertyLen = wxSPropertySeg1Ptr->Len();
4643 std::map<int, int> SplitPoints;
4644 std::map<int, int> SplitLength;
4645 std::map<int, int>::iterator SLiter;
4646 std::map<wxString, bool>::iterator BIter;;
4647 wxString PropertyData;
4648 wxString PropertyName;
4649 wxString PropertyValue;
4650 wxString PropertyTokens;
4651 bool FirstToken = TRUE;
4652 int intPrevValue = 15;
4654 if (ProcessItemData == TRUE){
4656 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4660 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4661 *wxSPropertyDataNameOut = wxT("NOTE");
4665 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4666 intiter != SplitPoints.end(); ++intiter){
4668 SLiter = SplitLength.find(intiter->first);
4670 if (ProcessItemData == TRUE){
4672 if (FirstToken == TRUE){
4674 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4679 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4685 if (FirstToken == TRUE){
4687 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4692 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4698 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4699 PropertyName = PropertyElement.GetNextToken();
4700 PropertyValue = PropertyElement.GetNextToken();
4702 intPrevValue = intiter->second;
4704 // Process properties.
4706 // Check if there is a lock on the property value. If there is a lock then
4707 // the property value cannot be changed.
4709 if (PropertyName.IsEmpty()){
4715 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4717 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4719 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4723 PropertyDataMap->erase(PropertyName);
4724 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4732 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4733 *XVCardV4Value = TRUE;
4737 // X-VCARD4-CATEGORIES
4739 if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
4741 if (ProcessItemData == TRUE){
4743 intPropertyLen = wxSPropertySeg1Chopped.Len();
4747 intPropertyLen = wxSPropertySeg1Ptr->Len();
4751 std::map<int, int> SplitPoints;
4752 std::map<int, int> SplitLength;
4753 std::map<int, int>::iterator SLiter;
4754 std::map<wxString, bool>::iterator BIter;;
4755 wxString PropertyData;
4756 wxString PropertyName;
4757 wxString PropertyValue;
4758 wxString PropertyTokens;
4759 bool FirstToken = TRUE;
4760 int intPrevValue = 21;
4762 if (ProcessItemData == TRUE){
4764 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4768 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4769 *wxSPropertyDataNameOut = wxT("CATEGORIES");
4773 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4774 intiter != SplitPoints.end(); ++intiter){
4776 SLiter = SplitLength.find(intiter->first);
4778 if (ProcessItemData == TRUE){
4780 if (FirstToken == TRUE){
4782 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4787 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4793 if (FirstToken == TRUE){
4795 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4800 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4806 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4807 PropertyName = PropertyElement.GetNextToken();
4808 PropertyValue = PropertyElement.GetNextToken();
4810 intPrevValue = intiter->second;
4812 // Process properties.
4814 // Check if there is a lock on the property value. If there is a lock then
4815 // the property value cannot be changed.
4817 if (PropertyName.IsEmpty()){
4823 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4825 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4827 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4831 PropertyDataMap->erase(PropertyName);
4832 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4840 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4841 *XVCardV4Value = TRUE;
4847 if (wxSProperty == wxT("X-VCARD4-PHOTO")){
4849 if (ProcessItemData == TRUE){
4851 intPropertyLen = wxSPropertySeg1Chopped.Len();
4855 intPropertyLen = wxSPropertySeg1Ptr->Len();
4859 std::map<int, int> SplitPoints;
4860 std::map<int, int> SplitLength;
4861 std::map<int, int>::iterator SLiter;
4862 std::map<wxString, bool>::iterator BIter;;
4863 wxString PropertyData;
4864 wxString PropertyName;
4865 wxString PropertyValue;
4866 wxString PropertyTokens;
4867 bool FirstToken = TRUE;
4868 int intPrevValue = 16;
4870 if (ProcessItemData == TRUE){
4872 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4876 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4877 *wxSPropertyDataNameOut = wxT("PHOTO");
4881 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4882 intiter != SplitPoints.end(); ++intiter){
4884 SLiter = SplitLength.find(intiter->first);
4886 if (ProcessItemData == TRUE){
4888 if (FirstToken == TRUE){
4890 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4895 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4901 if (FirstToken == TRUE){
4903 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4908 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4914 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4915 PropertyName = PropertyElement.GetNextToken();
4916 PropertyValue = PropertyElement.GetNextToken();
4918 intPrevValue = intiter->second;
4920 // Process properties.
4922 // Check if there is a lock on the property value. If there is a lock then
4923 // the property value cannot be changed.
4925 if (PropertyName.IsEmpty()){
4931 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4933 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4935 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4939 PropertyDataMap->erase(PropertyName);
4940 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4948 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4949 *XVCardV4Value = TRUE;
4955 if (wxSProperty == wxT("X-VCARD4-LOGO")){
4957 if (ProcessItemData == TRUE){
4959 intPropertyLen = wxSPropertySeg1Chopped.Len();
4963 intPropertyLen = wxSPropertySeg1Ptr->Len();
4967 std::map<int, int> SplitPoints;
4968 std::map<int, int> SplitLength;
4969 std::map<int, int>::iterator SLiter;
4970 std::map<wxString, bool>::iterator BIter;;
4971 wxString PropertyData;
4972 wxString PropertyName;
4973 wxString PropertyValue;
4974 wxString PropertyTokens;
4975 bool FirstToken = TRUE;
4976 int intPrevValue = 15;
4978 if (ProcessItemData == TRUE){
4980 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4984 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4985 *wxSPropertyDataNameOut = wxT("LOGO");
4989 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4990 intiter != SplitPoints.end(); ++intiter){
4992 SLiter = SplitLength.find(intiter->first);
4994 if (ProcessItemData == TRUE){
4996 if (FirstToken == TRUE){
4998 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5003 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5009 if (FirstToken == TRUE){
5011 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5016 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5022 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5023 PropertyName = PropertyElement.GetNextToken();
5024 PropertyValue = PropertyElement.GetNextToken();
5026 intPrevValue = intiter->second;
5028 // Process properties.
5030 // Check if there is a lock on the property value. If there is a lock then
5031 // the property value cannot be changed.
5033 if (PropertyName.IsEmpty()){
5039 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5041 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5043 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5047 PropertyDataMap->erase(PropertyName);
5048 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5056 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5057 *XVCardV4Value = TRUE;
5063 if (wxSProperty == wxT("X-VCARD4-SOUND")){
5065 if (ProcessItemData == TRUE){
5067 intPropertyLen = wxSPropertySeg1Chopped.Len();
5071 intPropertyLen = wxSPropertySeg1Ptr->Len();
5075 std::map<int, int> SplitPoints;
5076 std::map<int, int> SplitLength;
5077 std::map<int, int>::iterator SLiter;
5078 std::map<wxString, bool>::iterator BIter;;
5079 wxString PropertyData;
5080 wxString PropertyName;
5081 wxString PropertyValue;
5082 wxString PropertyTokens;
5083 bool FirstToken = TRUE;
5084 int intPrevValue = 16;
5086 if (ProcessItemData == TRUE){
5088 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5092 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5093 *wxSPropertyDataNameOut = wxT("SOUND");
5097 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5098 intiter != SplitPoints.end(); ++intiter){
5100 SLiter = SplitLength.find(intiter->first);
5102 if (ProcessItemData == TRUE){
5104 if (FirstToken == TRUE){
5106 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5111 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5117 if (FirstToken == TRUE){
5119 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5124 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5130 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5131 PropertyName = PropertyElement.GetNextToken();
5132 PropertyValue = PropertyElement.GetNextToken();
5134 intPrevValue = intiter->second;
5136 // Process properties.
5138 // Check if there is a lock on the property value. If there is a lock then
5139 // the property value cannot be changed.
5141 if (PropertyName.IsEmpty()){
5147 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5149 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5151 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5155 PropertyDataMap->erase(PropertyName);
5156 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5164 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5165 *XVCardV4Value = TRUE;
5171 if (wxSProperty == wxT("X-VCARD4-CALURI")){
5173 if (ProcessItemData == TRUE){
5175 intPropertyLen = wxSPropertySeg1Chopped.Len();
5179 intPropertyLen = wxSPropertySeg1Ptr->Len();
5183 std::map<int, int> SplitPoints;
5184 std::map<int, int> SplitLength;
5185 std::map<int, int>::iterator SLiter;
5186 std::map<wxString, bool>::iterator BIter;;
5187 wxString PropertyData;
5188 wxString PropertyName;
5189 wxString PropertyValue;
5190 wxString PropertyTokens;
5191 bool FirstToken = TRUE;
5192 int intPrevValue = 17;
5194 if (ProcessItemData == TRUE){
5196 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5200 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5201 *wxSPropertyDataNameOut = wxT("CALURI");
5205 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5206 intiter != SplitPoints.end(); ++intiter){
5208 SLiter = SplitLength.find(intiter->first);
5210 if (ProcessItemData == TRUE){
5212 if (FirstToken == TRUE){
5214 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5219 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5225 if (FirstToken == TRUE){
5227 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5232 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5238 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5239 PropertyName = PropertyElement.GetNextToken();
5240 PropertyValue = PropertyElement.GetNextToken();
5242 intPrevValue = intiter->second;
5244 // Process properties.
5246 // Check if there is a lock on the property value. If there is a lock then
5247 // the property value cannot be changed.
5249 if (PropertyName.IsEmpty()){
5255 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5257 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5259 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5263 PropertyDataMap->erase(PropertyName);
5264 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5272 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5273 *XVCardV4Value = TRUE;
5277 // X-VCARD4-CALADRURI
5279 if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
5281 if (ProcessItemData == TRUE){
5283 intPropertyLen = wxSPropertySeg1Chopped.Len();
5287 intPropertyLen = wxSPropertySeg1Ptr->Len();
5291 std::map<int, int> SplitPoints;
5292 std::map<int, int> SplitLength;
5293 std::map<int, int>::iterator SLiter;
5294 std::map<wxString, bool>::iterator BIter;;
5295 wxString PropertyData;
5296 wxString PropertyName;
5297 wxString PropertyValue;
5298 wxString PropertyTokens;
5299 bool FirstToken = TRUE;
5300 int intPrevValue = 20;
5302 if (ProcessItemData == TRUE){
5304 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5308 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5309 *wxSPropertyDataNameOut = wxT("CALADRURI");
5313 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5314 intiter != SplitPoints.end(); ++intiter){
5316 SLiter = SplitLength.find(intiter->first);
5318 if (ProcessItemData == TRUE){
5320 if (FirstToken == TRUE){
5322 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5327 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5333 if (FirstToken == TRUE){
5335 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5340 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5346 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5347 PropertyName = PropertyElement.GetNextToken();
5348 PropertyValue = PropertyElement.GetNextToken();
5350 intPrevValue = intiter->second;
5352 // Process properties.
5354 // Check if there is a lock on the property value. If there is a lock then
5355 // the property value cannot be changed.
5357 if (PropertyName.IsEmpty()){
5363 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5365 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5367 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5371 PropertyDataMap->erase(PropertyName);
5372 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5380 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5381 *XVCardV4Value = TRUE;
5387 if (wxSProperty == wxT("X-VCARD4-FBURL")){
5389 if (ProcessItemData == TRUE){
5391 intPropertyLen = wxSPropertySeg1Chopped.Len();
5395 intPropertyLen = wxSPropertySeg1Ptr->Len();
5399 std::map<int, int> SplitPoints;
5400 std::map<int, int> SplitLength;
5401 std::map<int, int>::iterator SLiter;
5402 std::map<wxString, bool>::iterator BIter;;
5403 wxString PropertyData;
5404 wxString PropertyName;
5405 wxString PropertyValue;
5406 wxString PropertyTokens;
5407 bool FirstToken = TRUE;
5408 int intPrevValue = 16;
5410 if (ProcessItemData == TRUE){
5412 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5416 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5417 *wxSPropertyDataNameOut = wxT("FBURL");
5421 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5422 intiter != SplitPoints.end(); ++intiter){
5424 SLiter = SplitLength.find(intiter->first);
5426 if (ProcessItemData == TRUE){
5428 if (FirstToken == TRUE){
5430 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5435 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5441 if (FirstToken == TRUE){
5443 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5448 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5454 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5455 PropertyName = PropertyElement.GetNextToken();
5456 PropertyValue = PropertyElement.GetNextToken();
5458 intPrevValue = intiter->second;
5460 // Process properties.
5462 // Check if there is a lock on the property value. If there is a lock then
5463 // the property value cannot be changed.
5465 if (PropertyName.IsEmpty()){
5471 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5473 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5475 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5479 PropertyDataMap->erase(PropertyName);
5480 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5488 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5489 *XVCardV4Value = TRUE;
5495 if (wxSProperty == wxT("X-VCARD4-KEY")){
5497 if (ProcessItemData == TRUE){
5499 intPropertyLen = wxSPropertySeg1Chopped.Len();
5503 intPropertyLen = wxSPropertySeg1Ptr->Len();
5507 std::map<int, int> SplitPoints;
5508 std::map<int, int> SplitLength;
5509 std::map<int, int>::iterator SLiter;
5510 std::map<wxString, bool>::iterator BIter;;
5511 wxString PropertyData;
5512 wxString PropertyName;
5513 wxString PropertyValue;
5514 wxString PropertyTokens;
5515 bool FirstToken = TRUE;
5516 int intPrevValue = 14;
5518 if (ProcessItemData == TRUE){
5520 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5524 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5525 *wxSPropertyDataNameOut = wxT("KEY");
5529 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5530 intiter != SplitPoints.end(); ++intiter){
5532 SLiter = SplitLength.find(intiter->first);
5534 if (ProcessItemData == TRUE){
5536 if (FirstToken == TRUE){
5538 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5543 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5549 if (FirstToken == TRUE){
5551 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5556 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5562 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5563 PropertyName = PropertyElement.GetNextToken();
5564 PropertyValue = PropertyElement.GetNextToken();
5566 intPrevValue = intiter->second;
5568 // Process properties.
5570 // Check if there is a lock on the property value. If there is a lock then
5571 // the property value cannot be changed.
5573 if (PropertyName.IsEmpty()){
5579 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5581 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5583 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5587 PropertyDataMap->erase(PropertyName);
5588 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5596 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5597 *XVCardV4Value = TRUE;
5603 if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
5605 if (ProcessItemData == TRUE){
5607 intPropertyLen = wxSPropertySeg1Chopped.Len();
5611 intPropertyLen = wxSPropertySeg1Ptr->Len();
5615 std::map<int, int> SplitPoints;
5616 std::map<int, int> SplitLength;
5617 std::map<int, int>::iterator SLiter;
5618 std::map<wxString, bool>::iterator BIter;;
5619 wxString PropertyData;
5620 wxString PropertyName;
5621 wxString PropertyValue;
5622 wxString PropertyTokens;
5623 bool FirstToken = TRUE;
5624 int intPrevValue = 14;
5626 if (ProcessItemData == TRUE){
5628 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5632 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5633 *wxSPropertyDataNameOut = wxSProperty.Mid(9);
5637 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5638 intiter != SplitPoints.end(); ++intiter){
5640 SLiter = SplitLength.find(intiter->first);
5642 if (ProcessItemData == TRUE){
5644 if (FirstToken == TRUE){
5646 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5651 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5657 if (FirstToken == TRUE){
5659 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5664 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5670 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5671 PropertyName = PropertyElement.GetNextToken();
5672 PropertyValue = PropertyElement.GetNextToken();
5674 intPrevValue = intiter->second;
5676 // Process properties.
5678 // Check if there is a lock on the property value. If there is a lock then
5679 // the property value cannot be changed.
5681 if (PropertyName.IsEmpty()){
5687 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5689 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5691 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5695 PropertyDataMap->erase(PropertyName);
5696 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5704 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5705 *XVCardV4Value = TRUE;
5709 // X-ADDRESSBOOKSERVER-KIND
5711 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
5715 if (ProcessItemData == TRUE){
5717 intPropertyLen = wxSPropertySeg1Chopped.Len();
5721 intPropertyLen = wxSPropertySeg1Ptr->Len();
5725 std::map<int, int> SplitPoints;
5726 std::map<int, int> SplitLength;
5727 std::map<int, int>::iterator SLiter;
5728 std::map<wxString, bool>::iterator BIter;;
5729 wxString PropertyData;
5730 wxString PropertyName;
5731 wxString PropertyValue;
5732 wxString PropertyTokens;
5733 bool FirstToken = TRUE;
5734 int intPrevValue = 26;
5736 if (ProcessItemData == TRUE){
5738 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5742 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5746 *wxSPropertyDataNameOut = wxT("KIND");
5748 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5749 intiter != SplitPoints.end(); ++intiter){
5751 SLiter = SplitLength.find(intiter->first);
5753 if (ProcessItemData == TRUE){
5755 if (FirstToken == TRUE){
5757 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5762 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5768 if (FirstToken == TRUE){
5770 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5775 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5781 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5782 PropertyName = PropertyElement.GetNextToken();
5783 PropertyValue = PropertyElement.GetNextToken();
5785 intPrevValue = intiter->second;
5787 // Process properties.
5789 // Check if there is a lock on the property value. If there is a lock then
5790 // the property value cannot be changed.
5792 if (PropertyName.IsEmpty()){
5798 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5800 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5802 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5806 PropertyDataMap->erase(PropertyName);
5807 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5815 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5816 *XVCardV4Value = TRUE;
5820 // X-ADDRESSBOOKSERVER-MEMBER
5822 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
5826 if (ProcessItemData == TRUE){
5828 intPropertyLen = wxSPropertySeg1Chopped.Len();
5832 intPropertyLen = wxSPropertySeg1Ptr->Len();
5836 std::map<int, int> SplitPoints;
5837 std::map<int, int> SplitLength;
5838 std::map<int, int>::iterator SLiter;
5839 std::map<wxString, bool>::iterator BIter;;
5840 wxString PropertyData;
5841 wxString PropertyName;
5842 wxString PropertyValue;
5843 wxString PropertyTokens;
5844 bool FirstToken = TRUE;
5845 int intPrevValue = 28;
5847 if (ProcessItemData == TRUE){
5849 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5853 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5857 *wxSPropertyDataNameOut = wxT("MEMBER");
5859 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5860 intiter != SplitPoints.end(); ++intiter){
5862 SLiter = SplitLength.find(intiter->first);
5864 if (ProcessItemData == TRUE){
5866 if (FirstToken == TRUE){
5868 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5873 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5879 if (FirstToken == TRUE){
5881 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5886 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5892 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5893 PropertyName = PropertyElement.GetNextToken();
5894 PropertyValue = PropertyElement.GetNextToken();
5896 intPrevValue = intiter->second;
5898 // Process properties.
5900 // Check if there is a lock on the property value. If there is a lock then
5901 // the property value cannot be changed.
5903 if (PropertyName.IsEmpty()){
5909 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5911 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5913 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5917 PropertyDataMap->erase(PropertyName);
5918 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5926 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5927 *XVCardV4Value = TRUE;
5932 // Deal with X-ABLabel specifically.
5934 if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
5936 intPropertyLen = wxSPropertySeg1Ptr->Len();
5937 std::map<int, int> SplitPoints;
5938 std::map<int, int> SplitLength;
5939 std::map<int, int>::iterator SLiter;
5940 wxString PropertyData;
5941 wxString PropertyName;
5942 wxString PropertyValue;
5943 wxString PropertyTokens;
5944 int intPrevValue = 11;
5946 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5948 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
5954 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
5956 CaptureString(strCapture, FALSE);
5960 void vCard34Conv::SplitValues(wxString *PropertyLine,
5961 std::map<int,int> *SplitPoints,
5962 std::map<int,int> *SplitLength,
5965 size_t intPropertyLen = PropertyLine->Len();
5966 int intSplitsFound = 0;
5967 int intSplitSize = 0;
5968 int intSplitSeek = 0;
5970 for (int i = intSize; i <= intPropertyLen; i++){
5974 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5975 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5977 if (intSplitsFound == 0){
5979 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5983 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5987 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
5997 if (intSplitsFound == 0){
5999 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
6000 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6004 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
6005 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6011 void vCard34Conv::SplitValuesData(wxString *PropertyLine,
6012 std::map<int,int> *SplitPoints,
6013 std::map<int,int> *SplitLength,
6015 std::map<wxString,wxString> *SplitData){
6018 wxStringTokenizer PropertyElement;
6019 wxString PropertyName;
6020 wxString PropertyValue;
6021 size_t intPropertyLen = PropertyLine->Len();
6022 int intSplitsFound = 0;
6023 int intSplitSize = 0;
6024 int intSplitSeek = (intSize - 1);
6026 for (int i = intSize; i <= intPropertyLen; i++){
6030 if (PropertyLine->Mid(i, 1) == wxT(";") &&
6031 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
6033 if (intSplitsFound == 0){
6035 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
6036 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
6040 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
6041 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
6045 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
6048 intSplitSeek = (i + 1);
6051 if (!DataStr.IsEmpty()){
6053 PropertyElement.SetString(DataStr, wxT("="));
6054 PropertyName = PropertyElement.GetNextToken();
6055 PropertyValue = PropertyElement.GetNextToken();
6056 SplitData->insert(std::make_pair(PropertyName, PropertyValue));
6061 PropertyName.clear();
6062 PropertyValue.clear();
6068 if (intSplitsFound == 0){
6070 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
6072 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
6073 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6077 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
6079 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
6080 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6084 if (!DataStr.IsEmpty()){
6086 PropertyElement.SetString(DataStr, wxT("="));
6087 PropertyName = PropertyElement.GetNextToken();
6088 PropertyValue = PropertyElement.GetNextToken();
6089 SplitData->insert(std::make_pair(PropertyName, PropertyValue));