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(){
43 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
44 wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr,
45 wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut,
46 wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
47 std::map<wxString,wxString> *PropertyDataMap,
48 std::map<wxString,bool> *PropertyLockMap,
49 bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
52 wxString wxSPropertySeg1Chopped;
53 size_t intPropertyLen;
55 if (ProcessItemData == TRUE){
57 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
59 wxSPropertySplit.GetNextToken();
60 wxSProperty = wxSPropertySplit.GetNextToken();
62 // Look for . in wxSPropertySeg1Ptr and remove all data before
65 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
66 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
71 wxSProperty = *wxSPropertyName;
76 // Go through each of the vCard 3.0 properties.
80 if (wxSProperty == wxT("EMAIL")){
82 if (ProcessItemData == TRUE){
84 intPropertyLen = wxSPropertySeg1Chopped.Len();
88 intPropertyLen = wxSPropertySeg1Ptr->Len();
92 std::map<int, int> SplitPoints;
93 std::map<int, int> SplitLength;
94 std::map<int, int>::iterator SLiter;
95 wxString PropertyData;
96 wxString PropertyName;
97 wxString PropertyValue;
98 wxString PropertyTokens;
99 bool FirstToken = TRUE;
100 int intPrevValue = 7;
102 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
103 *wxSPropertyDataNameOut = wxT("EMAIL");
104 *VCardV3Value = TRUE;
106 if (ProcessItemData == TRUE){
108 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
112 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
116 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
117 intiter != SplitPoints.end(); ++intiter){
119 SLiter = SplitLength.find(intiter->first);
121 if (ProcessItemData == TRUE){
123 if (FirstToken == TRUE){
125 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
130 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
136 if (FirstToken == TRUE){
138 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
143 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
149 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
150 PropertyName = PropertyElement.GetNextToken();
151 PropertyValue = PropertyElement.GetNextToken();
153 //ProcessCaptureStrings(&PropertyValue);
155 intPrevValue = intiter->second;
157 if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
161 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
163 if (ProcessItemData == FALSE){
164 PropertyName = wxT("PREF");
165 PropertyValue = wxT("50");
172 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
173 PropertyValue = wxT("home");
176 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
177 PropertyValue = wxT("work");
180 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
181 PropertyName = wxT("X-TYPE");
182 PropertyValue = wxT("other");
185 // Process properties.
187 if (PropertyName.IsEmpty()){
193 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
195 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
196 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
200 PropertyDataMap->erase(PropertyName);
201 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
202 PropertyLockMap->erase(PropertyName);
203 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
213 if (wxSProperty == wxT("ADR")){
215 if (ProcessItemData == TRUE){
217 intPropertyLen = wxSPropertySeg1Chopped.Len();
221 intPropertyLen = wxSPropertySeg1Ptr->Len();
225 std::map<int, int> SplitPoints;
226 std::map<int, int> SplitLength;
227 std::map<int, int>::iterator SLiter;
228 wxString PropertyData;
229 wxString PropertyName;
230 wxString PropertyValue;
231 wxString PropertyTokens;
232 bool FirstToken = TRUE;
233 int intPrevValue = 5;
235 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
236 *wxSPropertyDataNameOut = wxT("ADR");
237 *VCardV3Value = TRUE;
239 if (ProcessItemData == TRUE){
241 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
245 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
249 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
250 intiter != SplitPoints.end(); ++intiter){
252 SLiter = SplitLength.find(intiter->first);
254 if (ProcessItemData == TRUE){
256 if (FirstToken == TRUE){
258 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
263 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
269 if (FirstToken == TRUE){
271 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
276 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
282 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
283 PropertyName = PropertyElement.GetNextToken();
284 PropertyValue = PropertyElement.GetNextToken();
286 intPrevValue = intiter->second;
288 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
290 if (ProcessItemData == FALSE){
291 PropertyName = wxT("PREF");
292 PropertyValue = wxT("50");
299 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
300 PropertyValue = wxT("home");
303 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
304 PropertyValue = wxT("work");
307 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
308 PropertyName = wxT("X-TYPE");
309 PropertyValue = wxT("other");
312 // Process properties.
314 if (PropertyName.IsEmpty()){
320 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
322 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
323 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
327 PropertyDataMap->erase(PropertyName);
328 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
329 PropertyLockMap->erase(PropertyName);
330 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
340 if (wxSProperty == wxT("LABEL")){
342 if (ProcessItemData == TRUE){
344 intPropertyLen = wxSPropertySeg1Chopped.Len();
348 intPropertyLen = wxSPropertySeg1Ptr->Len();
352 std::map<int, int> SplitPoints;
353 std::map<int, int> SplitLength;
354 std::map<int, int>::iterator SLiter;
355 wxString PropertyData;
356 wxString PropertyName;
357 wxString PropertyValue;
358 wxString PropertyTokens;
359 bool FirstToken = TRUE;
360 int intPrevValue = 7;
362 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
363 *wxSPropertyDataNameOut = wxT("ADR");
364 *VCardV3Value = TRUE;
366 if (ProcessItemData == TRUE){
368 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
372 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
376 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
377 intiter != SplitPoints.end(); ++intiter){
379 SLiter = SplitLength.find(intiter->first);
381 if (ProcessItemData == TRUE){
383 if (FirstToken == TRUE){
385 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
390 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
396 if (FirstToken == TRUE){
398 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
403 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
409 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
410 PropertyName = PropertyElement.GetNextToken();
411 PropertyValue = PropertyElement.GetNextToken();
413 intPrevValue = intiter->second;
415 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
419 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
420 PropertyValue = wxT("home");
423 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
424 PropertyValue = wxT("work");
427 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
428 PropertyName = wxT("X-TYPE");
429 PropertyValue = wxT("other");
432 // Process properties.
434 if (PropertyName.IsEmpty()){
440 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
442 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
443 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
447 PropertyDataMap->erase(PropertyName);
448 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
449 PropertyLockMap->erase(PropertyName);
450 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
456 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
462 if (wxSProperty == wxT("IMPP")){
464 if (ProcessItemData == TRUE){
466 intPropertyLen = wxSPropertySeg1Chopped.Len();
470 intPropertyLen = wxSPropertySeg1Ptr->Len();
474 std::map<int, int> SplitPoints;
475 std::map<int, int> SplitLength;
476 std::map<int, int>::iterator SLiter;
477 wxString PropertyData;
478 wxString PropertyName;
479 wxString PropertyValue;
480 wxString PropertyTokens;
481 bool FirstToken = TRUE;
482 int intPrevValue = 6;
484 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
488 IMPPType = IMPPSplit.GetNextToken();
490 if (IMPPSplit.HasMoreTokens()){
492 IMPPData = IMPPSplit.GetNextToken();
494 if (IMPPType == wxT("ymsgr")){
496 IMPPType = wxT("yahoo");
500 *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
504 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
505 *wxSPropertyDataNameOut = wxT("IMPP");
506 *VCardV3Value = TRUE;
508 if (ProcessItemData == TRUE){
510 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
514 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
518 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
519 intiter != SplitPoints.end(); ++intiter){
521 SLiter = SplitLength.find(intiter->first);
523 if (ProcessItemData == TRUE){
525 if (FirstToken == TRUE){
527 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
532 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
538 if (FirstToken == TRUE){
540 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
545 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
551 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
552 PropertyName = PropertyElement.GetNextToken();
553 PropertyValue = PropertyElement.GetNextToken();
555 intPrevValue = intiter->second;
557 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
561 if (PropertyName == wxT("X-SERVICE-TYPE")){
565 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
566 PropertyValue = wxT("home");
569 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
570 PropertyValue = wxT("work");
573 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
574 PropertyName = wxT("X-TYPE");
575 PropertyValue = wxT("other");
578 // Process properties.
580 if (PropertyName.IsEmpty()){
586 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
588 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
589 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
593 PropertyDataMap->erase(PropertyName);
594 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
595 PropertyLockMap->erase(PropertyName);
596 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
606 if (wxSProperty == wxT("TEL")){
608 if (ProcessItemData == TRUE){
610 intPropertyLen = wxSPropertySeg1Chopped.Len();
614 intPropertyLen = wxSPropertySeg1Ptr->Len();
618 std::map<int, int> SplitPoints;
619 std::map<int, int> SplitLength;
620 std::map<int, int>::iterator SLiter;
621 std::map<wxString, wxString> TelType;
622 wxString PropertyData;
623 wxString PropertyName;
624 wxString PropertyValue;
625 wxString PropertyTokens;
626 bool FirstToken = TRUE;
627 int intPrevValue = 5;
629 wxSPropertyDataOut->Append(wxT("tel:"));
630 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
631 *wxSPropertyDataNameOut = wxT("TEL");
632 *VCardV3Value = TRUE;
634 if (ProcessItemData == TRUE){
636 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
640 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
644 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
645 intiter != SplitPoints.end(); ++intiter){
647 SLiter = SplitLength.find(intiter->first);
649 if (ProcessItemData == TRUE){
651 if (FirstToken == TRUE){
653 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
658 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
664 if (FirstToken == TRUE){
666 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
671 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
677 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
678 PropertyName = PropertyElement.GetNextToken();
679 PropertyValue = PropertyElement.GetNextToken();
681 intPrevValue = intiter->second;
683 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
687 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
688 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
692 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
693 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
697 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
698 PropertyName = wxT("X-TYPE");
699 PropertyValue = wxT("other");
702 // Process the telephone type options.
706 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
707 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
713 if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
714 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
720 if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
721 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
727 if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
728 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
734 if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
735 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
741 if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
742 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
748 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
749 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
753 if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
754 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
755 wxString TypeSplitData;
756 while (TypeSplit.HasMoreTokens()){
758 TypeSplitData = TypeSplit.GetNextToken();
759 TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
760 TypeSplitData.clear();
766 // Process properties.
768 if (PropertyName.IsEmpty()){
774 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
776 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
777 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
781 PropertyDataMap->erase(PropertyName);
782 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
783 PropertyLockMap->erase(PropertyName);
784 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
790 wxString TelFinalString;
791 bool TelFirstToken = TRUE;
793 for (std::map<wxString, wxString>::iterator intiter = TelType.begin();
794 intiter != TelType.end(); ++intiter){
796 // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
798 if (TelFirstToken == TRUE){
800 TelFinalString.Append(wxT("\""));
801 TelFinalString.Append(intiter->first);
802 TelFirstToken = FALSE;
806 TelFinalString.Append(wxT(","));
807 TelFinalString.Append(intiter->first);
813 if (TelFirstToken == FALSE){
815 TelFinalString.Append(wxT("\""));
819 if (!TelFinalString.IsEmpty()){
821 if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
823 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
824 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
828 PropertyDataMap->erase(PropertyName);
829 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
830 PropertyLockMap->erase(PropertyName);
831 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
841 if (wxSProperty == wxT("X-ABRELATEDNAMES")){
843 if (ProcessItemData == TRUE){
845 intPropertyLen = wxSPropertySeg1Chopped.Len();
849 intPropertyLen = wxSPropertySeg1Ptr->Len();
853 std::map<int, int> SplitPoints;
854 std::map<int, int> SplitLength;
855 std::map<int, int>::iterator SLiter;
856 wxString PropertyData;
857 wxString PropertyName;
858 wxString PropertyValue;
859 wxString PropertyTokens;
860 bool FirstToken = TRUE;
861 int intPrevValue = 18;
863 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
864 *wxSPropertyDataNameOut = wxT("RELATED");
865 *VCardV3Value = TRUE;
867 if (ProcessItemData == TRUE){
869 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
873 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
877 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
878 intiter != SplitPoints.end(); ++intiter){
880 SLiter = SplitLength.find(intiter->first);
882 if (ProcessItemData == TRUE){
884 if (FirstToken == TRUE){
886 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
891 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
897 if (FirstToken == TRUE){
899 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
904 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
910 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
911 PropertyName = PropertyElement.GetNextToken();
912 PropertyValue = PropertyElement.GetNextToken();
914 //ProcessCaptureStrings(&PropertyValue);
916 intPrevValue = intiter->second;
918 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
922 // Process properties.
924 if (PropertyName.IsEmpty()){
930 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
932 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
933 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
937 PropertyDataMap->erase(PropertyName);
938 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
939 PropertyLockMap->erase(PropertyName);
940 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
950 if (wxSProperty == wxT("URL")){
952 if (ProcessItemData == TRUE){
954 intPropertyLen = wxSPropertySeg1Chopped.Len();
958 intPropertyLen = wxSPropertySeg1Ptr->Len();
962 std::map<int, int> SplitPoints;
963 std::map<int, int> SplitLength;
964 std::map<int, int>::iterator SLiter;
965 wxString PropertyData;
966 wxString PropertyName;
967 wxString PropertyValue;
968 wxString PropertyTokens;
969 bool FirstToken = TRUE;
970 int intPrevValue = 5;
972 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
973 *wxSPropertyDataNameOut = wxT("URL");
974 *VCardV3Value = TRUE;
976 if (ProcessItemData == TRUE){
978 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
982 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
986 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
987 intiter != SplitPoints.end(); ++intiter){
989 SLiter = SplitLength.find(intiter->first);
991 if (ProcessItemData == TRUE){
993 if (FirstToken == TRUE){
995 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1000 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1006 if (FirstToken == TRUE){
1008 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1013 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1019 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1020 PropertyName = PropertyElement.GetNextToken();
1021 PropertyValue = PropertyElement.GetNextToken();
1023 intPrevValue = intiter->second;
1025 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
1029 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
1030 PropertyValue = wxT("home");
1033 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
1034 PropertyValue = wxT("work");
1037 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
1038 PropertyName = wxT("X-TYPE");
1039 PropertyValue = wxT("other");
1042 // Process properties.
1044 if (PropertyName.IsEmpty()){
1050 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1052 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1053 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1057 PropertyDataMap->erase(PropertyName);
1058 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1059 PropertyLockMap->erase(PropertyName);
1060 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1070 if (wxSProperty == wxT("TITLE")){
1072 if (ProcessItemData == TRUE){
1074 intPropertyLen = wxSPropertySeg1Chopped.Len();
1078 intPropertyLen = wxSPropertySeg1Ptr->Len();
1082 std::map<int, int> SplitPoints;
1083 std::map<int, int> SplitLength;
1084 std::map<int, int>::iterator SLiter;
1085 wxString PropertyData;
1086 wxString PropertyName;
1087 wxString PropertyValue;
1088 wxString PropertyTokens;
1089 bool FirstToken = TRUE;
1090 int intPrevValue = 7;
1092 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1093 *wxSPropertyDataNameOut = wxT("TITLE");
1094 *VCardV3Value = TRUE;
1096 if (ProcessItemData == TRUE){
1098 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1102 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1106 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1107 intiter != SplitPoints.end(); ++intiter){
1109 SLiter = SplitLength.find(intiter->first);
1111 if (ProcessItemData == TRUE){
1113 if (FirstToken == TRUE){
1115 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1120 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1126 if (FirstToken == TRUE){
1128 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1133 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1139 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1140 PropertyName = PropertyElement.GetNextToken();
1141 PropertyValue = PropertyElement.GetNextToken();
1143 intPrevValue = intiter->second;
1145 // Process properties.
1147 if (PropertyName.IsEmpty()){
1153 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1155 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1156 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1160 PropertyDataMap->erase(PropertyName);
1161 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1162 PropertyLockMap->erase(PropertyName);
1163 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1173 if (wxSProperty == wxT("FN")){
1175 if (ProcessItemData == TRUE){
1177 intPropertyLen = wxSPropertySeg1Chopped.Len();
1181 intPropertyLen = wxSPropertySeg1Ptr->Len();
1185 std::map<int, int> SplitPoints;
1186 std::map<int, int> SplitLength;
1187 std::map<int, int>::iterator SLiter;
1188 wxString PropertyData;
1189 wxString PropertyName;
1190 wxString PropertyValue;
1191 wxString PropertyTokens;
1192 bool FirstToken = TRUE;
1193 int intPrevValue = 4;
1195 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1196 *wxSPropertyDataNameOut = wxT("FN");
1197 *VCardV3Value = TRUE;
1199 if (ProcessItemData == TRUE){
1201 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1205 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1209 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1210 intiter != SplitPoints.end(); ++intiter){
1212 SLiter = SplitLength.find(intiter->first);
1214 if (ProcessItemData == TRUE){
1216 if (FirstToken == TRUE){
1218 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1223 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1229 if (FirstToken == TRUE){
1231 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1236 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1242 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1243 PropertyName = PropertyElement.GetNextToken();
1244 PropertyValue = PropertyElement.GetNextToken();
1246 intPrevValue = intiter->second;
1248 // Process properties.
1250 if (PropertyName.IsEmpty()){
1256 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1258 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1259 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1263 PropertyDataMap->erase(PropertyName);
1264 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1265 PropertyLockMap->erase(PropertyName);
1266 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1276 if (wxSProperty == wxT("N")){
1278 if (ProcessItemData == TRUE){
1280 intPropertyLen = wxSPropertySeg1Chopped.Len();
1284 intPropertyLen = wxSPropertySeg1Ptr->Len();
1288 std::map<int, int> SplitPoints;
1289 std::map<int, int> SplitLength;
1290 std::map<int, int>::iterator SLiter;
1291 wxString PropertyData;
1292 wxString PropertyName;
1293 wxString PropertyValue;
1294 wxString PropertyTokens;
1295 bool FirstToken = TRUE;
1296 int intPrevValue = 3;
1298 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1299 *wxSPropertyDataNameOut = wxT("N");
1300 *VCardV3Value = TRUE;
1302 if (ProcessItemData == TRUE){
1304 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1308 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1312 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1313 intiter != SplitPoints.end(); ++intiter){
1315 SLiter = SplitLength.find(intiter->first);
1317 if (ProcessItemData == TRUE){
1319 if (FirstToken == TRUE){
1321 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1326 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1332 if (FirstToken == TRUE){
1334 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1339 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1345 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1346 PropertyName = PropertyElement.GetNextToken();
1347 PropertyValue = PropertyElement.GetNextToken();
1349 intPrevValue = intiter->second;
1351 // Process properties.
1353 if (PropertyName.IsEmpty()){
1359 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1361 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1362 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1366 PropertyDataMap->erase(PropertyName);
1367 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1368 PropertyLockMap->erase(PropertyName);
1369 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1379 if (wxSProperty == wxT("UID")){
1381 if (ProcessItemData == TRUE){
1383 intPropertyLen = wxSPropertySeg1Chopped.Len();
1387 intPropertyLen = wxSPropertySeg1Ptr->Len();
1391 std::map<int, int> SplitPoints;
1392 std::map<int, int> SplitLength;
1393 std::map<int, int>::iterator SLiter;
1394 wxString PropertyData;
1395 wxString PropertyName;
1396 wxString PropertyValue;
1397 wxString PropertyTokens;
1398 bool FirstToken = TRUE;
1399 int intPrevValue = 5;
1401 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1402 *wxSPropertyDataNameOut = wxT("UID");
1403 *VCardV3Value = TRUE;
1405 if (ProcessItemData == TRUE){
1407 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1411 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1415 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1416 intiter != SplitPoints.end(); ++intiter){
1418 SLiter = SplitLength.find(intiter->first);
1420 if (ProcessItemData == TRUE){
1422 if (FirstToken == TRUE){
1424 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1429 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1435 if (FirstToken == TRUE){
1437 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1442 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1448 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1449 PropertyName = PropertyElement.GetNextToken();
1450 PropertyValue = PropertyElement.GetNextToken();
1452 intPrevValue = intiter->second;
1454 // Process properties.
1456 if (PropertyName.IsEmpty()){
1462 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1464 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1465 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1469 PropertyDataMap->erase(PropertyName);
1470 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1471 PropertyLockMap->erase(PropertyName);
1472 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1482 if (wxSProperty == wxT("NICKNAME")){
1484 if (ProcessItemData == TRUE){
1486 intPropertyLen = wxSPropertySeg1Chopped.Len();
1490 intPropertyLen = wxSPropertySeg1Ptr->Len();
1494 std::map<int, int> SplitPoints;
1495 std::map<int, int> SplitLength;
1496 std::map<int, int>::iterator SLiter;
1497 wxString PropertyData;
1498 wxString PropertyName;
1499 wxString PropertyValue;
1500 wxString PropertyTokens;
1501 bool FirstToken = TRUE;
1502 int intPrevValue = 10;
1504 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1505 *wxSPropertyDataNameOut = wxT("NICKNAME");
1506 *VCardV3Value = TRUE;
1508 if (ProcessItemData == TRUE){
1510 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1514 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1518 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1519 intiter != SplitPoints.end(); ++intiter){
1521 SLiter = SplitLength.find(intiter->first);
1523 if (ProcessItemData == TRUE){
1525 if (FirstToken == TRUE){
1527 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1532 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1538 if (FirstToken == TRUE){
1540 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1545 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1551 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1552 PropertyName = PropertyElement.GetNextToken();
1553 PropertyValue = PropertyElement.GetNextToken();
1555 intPrevValue = intiter->second;
1557 // Process properties.
1559 if (PropertyName.IsEmpty()){
1565 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1567 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1568 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1572 PropertyDataMap->erase(PropertyName);
1573 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1574 PropertyLockMap->erase(PropertyName);
1575 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1585 if (wxSProperty == wxT("GENDER")){
1587 if (ProcessItemData == TRUE){
1589 intPropertyLen = wxSPropertySeg1Chopped.Len();
1593 intPropertyLen = wxSPropertySeg1Ptr->Len();
1597 std::map<int, int> SplitPoints;
1598 std::map<int, int> SplitLength;
1599 std::map<int, int>::iterator SLiter;
1600 wxString PropertyData;
1601 wxString PropertyName;
1602 wxString PropertyValue;
1603 wxString PropertyTokens;
1604 bool FirstToken = TRUE;
1605 int intPrevValue = 8;
1607 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1608 *wxSPropertyDataNameOut = wxT("GENDER");
1609 *VCardV3Value = TRUE;
1611 if (ProcessItemData == TRUE){
1613 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1617 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1621 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1622 intiter != SplitPoints.end(); ++intiter){
1624 SLiter = SplitLength.find(intiter->first);
1626 if (ProcessItemData == TRUE){
1628 if (FirstToken == TRUE){
1630 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1635 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1641 if (FirstToken == TRUE){
1643 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1648 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1654 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1655 PropertyName = PropertyElement.GetNextToken();
1656 PropertyValue = PropertyElement.GetNextToken();
1658 intPrevValue = intiter->second;
1660 // Process properties.
1662 if (PropertyName.IsEmpty()){
1668 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1670 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1671 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1675 PropertyDataMap->erase(PropertyName);
1676 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1677 PropertyLockMap->erase(PropertyName);
1678 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1688 if (wxSProperty == wxT("BDAY")){
1690 if (ProcessItemData == TRUE){
1692 intPropertyLen = wxSPropertySeg1Chopped.Len();
1696 intPropertyLen = wxSPropertySeg1Ptr->Len();
1700 std::map<int, int> SplitPoints;
1701 std::map<int, int> SplitLength;
1702 std::map<int, int>::iterator SLiter;
1703 wxString PropertyData;
1704 wxString PropertyName;
1705 wxString PropertyValue;
1706 wxString PropertyTokens;
1707 wxString PropertyXOmitYear;
1708 bool FirstToken = TRUE;
1709 int intPrevValue = 6;
1711 *wxSPropertyDataNameOut = wxT("BDAY");
1712 *VCardV3Value = TRUE;
1714 if (ProcessItemData == TRUE){
1716 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1720 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1724 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1725 intiter != SplitPoints.end(); ++intiter){
1727 SLiter = SplitLength.find(intiter->first);
1729 if (ProcessItemData == TRUE){
1731 if (FirstToken == TRUE){
1733 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1738 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1744 if (FirstToken == TRUE){
1746 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1751 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1757 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1758 PropertyName = PropertyElement.GetNextToken();
1759 PropertyValue = PropertyElement.GetNextToken();
1761 intPrevValue = intiter->second;
1763 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1764 PropertyXOmitYear = PropertyValue;
1767 // Process properties.
1769 if (PropertyName.IsEmpty()){
1775 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1777 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1778 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1782 PropertyDataMap->erase(PropertyName);
1783 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1784 PropertyLockMap->erase(PropertyName);
1785 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1791 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1792 // year matches the X-APPLE-OMIT-YEAR value.
1794 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1799 DateProc = DateSplit.GetNextToken();
1801 if (DateProc == PropertyXOmitYear){
1803 FinalDate.Append(wxT("--"));
1807 FinalDate.Append(DateProc);
1812 DateProc = DateSplit.GetNextToken();
1814 FinalDate.Append(DateProc);
1817 DateProc = DateSplit.GetNextToken();
1819 FinalDate.Append(DateProc);
1821 wxSPropertyDataOut->Append(FinalDate);
1827 if (wxSProperty == wxT("ANNIVERSARY")){
1829 if (ProcessItemData == TRUE){
1831 intPropertyLen = wxSPropertySeg1Chopped.Len();
1835 intPropertyLen = wxSPropertySeg1Ptr->Len();
1839 std::map<int, int> SplitPoints;
1840 std::map<int, int> SplitLength;
1841 std::map<int, int>::iterator SLiter;
1842 wxString PropertyData;
1843 wxString PropertyName;
1844 wxString PropertyValue;
1845 wxString PropertyTokens;
1846 wxString PropertyXOmitYear;
1847 bool FirstToken = TRUE;
1848 int intPrevValue = 13;
1850 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
1851 *VCardV3Value = TRUE;
1853 if (ProcessItemData == TRUE){
1855 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1859 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1863 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1864 intiter != SplitPoints.end(); ++intiter){
1866 SLiter = SplitLength.find(intiter->first);
1868 if (ProcessItemData == TRUE){
1870 if (FirstToken == TRUE){
1872 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1877 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1883 if (FirstToken == TRUE){
1885 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1890 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1896 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1897 PropertyName = PropertyElement.GetNextToken();
1898 PropertyValue = PropertyElement.GetNextToken();
1900 intPrevValue = intiter->second;
1902 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1903 PropertyXOmitYear = PropertyValue;
1906 // Process properties.
1908 if (PropertyName.IsEmpty()){
1914 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1916 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1917 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1921 PropertyDataMap->erase(PropertyName);
1922 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1923 PropertyLockMap->erase(PropertyName);
1924 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1930 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1931 // year matches the X-APPLE-OMIT-YEAR value.
1933 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1938 DateProc = DateSplit.GetNextToken();
1940 if (DateProc == PropertyXOmitYear){
1942 FinalDate.Append(wxT("--"));
1946 FinalDate.Append(DateProc);
1951 DateProc = DateSplit.GetNextToken();
1953 FinalDate.Append(DateProc);
1956 DateProc = DateSplit.GetNextToken();
1958 FinalDate.Append(DateProc);
1960 wxSPropertyDataOut->Append(FinalDate);
1964 // TZ - Not sure how to process this correctly. So data
1965 // is kept as X-VCARD3-TZ for the time being.
1967 if (wxSProperty == wxT("TZ")){
1969 if (ProcessItemData == TRUE){
1971 intPropertyLen = wxSPropertySeg1Chopped.Len();
1975 intPropertyLen = wxSPropertySeg1Ptr->Len();
1979 std::map<int, int> SplitPoints;
1980 std::map<int, int> SplitLength;
1981 std::map<int, int>::iterator SLiter;
1982 wxString PropertyData;
1983 wxString PropertyName;
1984 wxString PropertyValue;
1985 wxString PropertyTokens;
1986 wxString PropertyXOmitYear;
1987 bool FirstToken = TRUE;
1988 int intPrevValue = 4;
1990 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1991 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
1992 *VCardV3Value = TRUE;
1994 if (ProcessItemData == TRUE){
1996 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2000 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2004 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2005 intiter != SplitPoints.end(); ++intiter){
2007 SLiter = SplitLength.find(intiter->first);
2009 if (ProcessItemData == TRUE){
2011 if (FirstToken == TRUE){
2013 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2018 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2024 if (FirstToken == TRUE){
2026 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2031 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2037 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2038 PropertyName = PropertyElement.GetNextToken();
2039 PropertyValue = PropertyElement.GetNextToken();
2041 intPrevValue = intiter->second;
2043 // Process properties.
2045 if (PropertyName.IsEmpty()){
2051 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2053 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2054 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2058 PropertyDataMap->erase(PropertyName);
2059 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2060 PropertyLockMap->erase(PropertyName);
2061 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2071 if (wxSProperty == wxT("ROLE")){
2073 if (ProcessItemData == TRUE){
2075 intPropertyLen = wxSPropertySeg1Chopped.Len();
2079 intPropertyLen = wxSPropertySeg1Ptr->Len();
2083 std::map<int, int> SplitPoints;
2084 std::map<int, int> SplitLength;
2085 std::map<int, int>::iterator SLiter;
2086 wxString PropertyData;
2087 wxString PropertyName;
2088 wxString PropertyValue;
2089 wxString PropertyTokens;
2090 wxString PropertyXOmitYear;
2091 bool FirstToken = TRUE;
2092 int intPrevValue = 6;
2094 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2095 *wxSPropertyDataNameOut = wxT("ROLE");
2096 *VCardV3Value = TRUE;
2098 if (ProcessItemData == TRUE){
2100 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2104 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2108 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2109 intiter != SplitPoints.end(); ++intiter){
2111 SLiter = SplitLength.find(intiter->first);
2113 if (ProcessItemData == TRUE){
2115 if (FirstToken == TRUE){
2117 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2122 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2128 if (FirstToken == TRUE){
2130 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2135 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2141 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2142 PropertyName = PropertyElement.GetNextToken();
2143 PropertyValue = PropertyElement.GetNextToken();
2145 intPrevValue = intiter->second;
2147 // Process properties.
2149 if (PropertyName.IsEmpty()){
2155 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2157 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2158 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2162 PropertyDataMap->erase(PropertyName);
2163 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2164 PropertyLockMap->erase(PropertyName);
2165 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2175 if (wxSProperty == wxT("ORG")){
2177 if (ProcessItemData == TRUE){
2179 intPropertyLen = wxSPropertySeg1Chopped.Len();
2183 intPropertyLen = wxSPropertySeg1Ptr->Len();
2187 std::map<int, int> SplitPoints;
2188 std::map<int, int> SplitLength;
2189 std::map<int, int>::iterator SLiter;
2190 wxString PropertyData;
2191 wxString PropertyName;
2192 wxString PropertyValue;
2193 wxString PropertyTokens;
2194 wxString PropertyXOmitYear;
2195 bool FirstToken = TRUE;
2196 int intPrevValue = 5;
2198 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2199 *wxSPropertyDataNameOut = wxT("ORG");
2200 *VCardV3Value = TRUE;
2202 if (ProcessItemData == TRUE){
2204 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2208 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2212 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2213 intiter != SplitPoints.end(); ++intiter){
2215 SLiter = SplitLength.find(intiter->first);
2217 if (ProcessItemData == TRUE){
2219 if (FirstToken == TRUE){
2221 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2226 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2232 if (FirstToken == TRUE){
2234 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2239 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2245 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2246 PropertyName = PropertyElement.GetNextToken();
2247 PropertyValue = PropertyElement.GetNextToken();
2249 intPrevValue = intiter->second;
2251 // Process properties.
2253 if (PropertyName.IsEmpty()){
2259 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2261 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2262 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2266 PropertyDataMap->erase(PropertyName);
2267 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2268 PropertyLockMap->erase(PropertyName);
2269 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2279 if (wxSProperty == wxT("NOTE")){
2281 if (ProcessItemData == TRUE){
2283 intPropertyLen = wxSPropertySeg1Chopped.Len();
2287 intPropertyLen = wxSPropertySeg1Ptr->Len();
2291 std::map<int, int> SplitPoints;
2292 std::map<int, int> SplitLength;
2293 std::map<int, int>::iterator SLiter;
2294 wxString PropertyData;
2295 wxString PropertyName;
2296 wxString PropertyValue;
2297 wxString PropertyTokens;
2298 wxString PropertyXOmitYear;
2299 bool FirstToken = TRUE;
2300 int intPrevValue = 6;
2302 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2303 *wxSPropertyDataNameOut = wxT("NOTE");
2304 *VCardV3Value = TRUE;
2306 if (ProcessItemData == TRUE){
2308 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2312 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2316 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2317 intiter != SplitPoints.end(); ++intiter){
2319 SLiter = SplitLength.find(intiter->first);
2321 if (ProcessItemData == TRUE){
2323 if (FirstToken == TRUE){
2325 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2330 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2336 if (FirstToken == TRUE){
2338 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2343 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2349 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2350 PropertyName = PropertyElement.GetNextToken();
2351 PropertyValue = PropertyElement.GetNextToken();
2353 intPrevValue = intiter->second;
2355 // Process properties.
2357 if (PropertyName.IsEmpty()){
2363 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2365 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2366 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2370 PropertyDataMap->erase(PropertyName);
2371 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2372 PropertyLockMap->erase(PropertyName);
2373 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2383 if (wxSProperty == wxT("PHOTO")){
2385 if (ProcessItemData == TRUE){
2387 intPropertyLen = wxSPropertySeg1Chopped.Len();
2391 intPropertyLen = wxSPropertySeg1Ptr->Len();
2395 std::map<int, int> SplitPoints;
2396 std::map<int, int> SplitLength;
2397 std::map<int, int>::iterator SLiter;
2398 std::map<wxString, wxString> SplitData;
2399 wxString PropertyData;
2400 wxString PropertyName;
2401 wxString PropertyValue;
2402 wxString PropertyTokens;
2403 wxString PropertyXOmitYear;
2404 int intPrevValue = 7;
2406 *wxSPropertyDataNameOut = wxT("PHOTO");
2407 *VCardV3Value = TRUE;
2409 if (ProcessItemData == TRUE){
2411 SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2415 SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2419 wxString wxSMIMEType;
2420 wxString wxSEncType;
2422 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
2423 intiter != SplitData.end(); ++intiter){
2425 PropertyName = intiter->first;
2426 PropertyValue = intiter->second;
2428 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2429 wxSEncType = wxT("base64");
2433 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
2434 wxSMIMEType = wxT("image/png");
2436 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
2437 wxSMIMEType = wxT("image/jpeg");
2439 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
2440 wxSMIMEType = wxT("image/gif");
2442 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
2443 wxSMIMEType = wxT("image/bmp");
2445 } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
2446 wxSMIMEType = wxT("image/unknown");
2450 // Process properties.
2452 if (PropertyName.IsEmpty()){
2458 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2460 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2461 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2465 PropertyDataMap->erase(PropertyName);
2466 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2467 PropertyLockMap->erase(PropertyName);
2468 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2474 wxSPropertyDataOut->Append(wxT("data:"));
2475 wxSPropertyDataOut->Append(wxSMIMEType);
2476 wxSPropertyDataOut->Append(wxT(";"));
2477 wxSPropertyDataOut->Append(wxSEncType);
2478 wxSPropertyDataOut->Append(wxT(","));
2479 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2485 if (wxSProperty == wxT("SOUND")){
2487 if (ProcessItemData == TRUE){
2489 intPropertyLen = wxSPropertySeg1Chopped.Len();
2493 intPropertyLen = wxSPropertySeg1Ptr->Len();
2497 std::map<int, int> SplitPoints;
2498 std::map<int, int> SplitLength;
2499 std::map<int, int>::iterator SLiter;
2500 wxString PropertyData;
2501 wxString PropertyName;
2502 wxString PropertyValue;
2503 wxString PropertyTokens;
2504 wxString PropertyXOmitYear;
2505 bool FirstToken = TRUE;
2506 int intPrevValue = 7;
2508 *wxSPropertyDataNameOut = wxT("SOUND");
2509 *VCardV3Value = TRUE;
2511 if (ProcessItemData == TRUE){
2513 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2517 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2521 wxString wxSMIMEType;
2522 wxString wxSEncType;
2524 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2525 intiter != SplitPoints.end(); ++intiter){
2527 SLiter = SplitLength.find(intiter->first);
2529 if (ProcessItemData == TRUE){
2531 if (FirstToken == TRUE){
2533 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2538 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2544 if (FirstToken == TRUE){
2546 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2551 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2557 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2558 PropertyName = PropertyElement.GetNextToken();
2559 PropertyValue = PropertyElement.GetNextToken();
2561 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2562 wxSEncType = wxT("base64");
2566 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
2567 wxSMIMEType = PropertyValue;
2571 intPrevValue = intiter->second;
2573 // Process properties.
2575 if (PropertyName.IsEmpty()){
2581 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2583 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2584 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2588 PropertyDataMap->erase(PropertyName);
2589 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2590 PropertyLockMap->erase(PropertyName);
2591 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2597 wxSPropertyDataOut->Append(wxT("data:"));
2598 wxSPropertyDataOut->Append(wxSMIMEType);
2599 wxSPropertyDataOut->Append(wxT(";"));
2600 wxSPropertyDataOut->Append(wxSEncType);
2601 wxSPropertyDataOut->Append(wxT(","));
2602 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2606 // Look for backward compatability vCard 4.0 properties.
2610 if (wxSProperty == wxT("X-VCARD4-FN")){
2612 if (ProcessItemData == TRUE){
2614 intPropertyLen = wxSPropertySeg1Chopped.Len();
2618 intPropertyLen = wxSPropertySeg1Ptr->Len();
2619 *wxSPropertyDataNameOut = wxT("FN");
2623 std::map<int, int> SplitPoints;
2624 std::map<int, int> SplitLength;
2625 std::map<int, int>::iterator SLiter;
2626 std::map<wxString, bool>::iterator BIter;;
2627 wxString PropertyData;
2628 wxString PropertyName;
2629 wxString PropertyValue;
2630 wxString PropertyTokens;
2631 bool FirstToken = TRUE;
2632 int intPrevValue = 13;
2634 if (ProcessItemData == TRUE){
2636 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2640 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2644 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2645 intiter != SplitPoints.end(); ++intiter){
2647 SLiter = SplitLength.find(intiter->first);
2649 if (ProcessItemData == TRUE){
2651 if (FirstToken == TRUE){
2653 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2658 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2664 if (FirstToken == TRUE){
2666 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2671 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2677 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2678 PropertyName = PropertyElement.GetNextToken();
2679 PropertyValue = PropertyElement.GetNextToken();
2681 intPrevValue = intiter->second;
2683 // Process properties.
2685 // Check if there is a lock on the property value. If there is a lock then
2686 // the property value cannot be changed.
2688 if (PropertyName.IsEmpty()){
2694 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2696 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2698 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2702 PropertyDataMap->erase(PropertyName);
2703 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2711 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2712 *XVCardV4Value = TRUE;
2718 if (wxSProperty == wxT("X-VCARD4-N")){
2720 if (ProcessItemData == TRUE){
2722 intPropertyLen = wxSPropertySeg1Chopped.Len();
2726 intPropertyLen = wxSPropertySeg1Ptr->Len();
2730 std::map<int, int> SplitPoints;
2731 std::map<int, int> SplitLength;
2732 std::map<int, int>::iterator SLiter;
2733 std::map<wxString, bool>::iterator BIter;;
2734 wxString PropertyData;
2735 wxString PropertyName;
2736 wxString PropertyValue;
2737 wxString PropertyTokens;
2738 bool FirstToken = TRUE;
2739 int intPrevValue = 12;
2741 if (ProcessItemData == TRUE){
2743 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2747 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2748 *wxSPropertyDataNameOut = wxT("N");
2752 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2753 intiter != SplitPoints.end(); ++intiter){
2755 SLiter = SplitLength.find(intiter->first);
2757 if (ProcessItemData == TRUE){
2759 if (FirstToken == TRUE){
2761 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2766 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2772 if (FirstToken == TRUE){
2774 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2779 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2785 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2786 PropertyName = PropertyElement.GetNextToken();
2787 PropertyValue = PropertyElement.GetNextToken();
2789 intPrevValue = intiter->second;
2791 // Process properties.
2793 // Check if there is a lock on the property value. If there is a lock then
2794 // the property value cannot be changed.
2796 if (PropertyName.IsEmpty()){
2802 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2804 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2806 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2810 PropertyDataMap->erase(PropertyName);
2811 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2819 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2820 *XVCardV4Value = TRUE;
2824 // X-VCARD4-NICKNAME
2826 if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
2828 if (ProcessItemData == TRUE){
2830 intPropertyLen = wxSPropertySeg1Chopped.Len();
2834 intPropertyLen = wxSPropertySeg1Ptr->Len();
2838 std::map<int, int> SplitPoints;
2839 std::map<int, int> SplitLength;
2840 std::map<int, int>::iterator SLiter;
2841 std::map<wxString, bool>::iterator BIter;;
2842 wxString PropertyData;
2843 wxString PropertyName;
2844 wxString PropertyValue;
2845 wxString PropertyTokens;
2846 bool FirstToken = TRUE;
2847 int intPrevValue = 19;
2849 if (ProcessItemData == TRUE){
2851 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2855 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2856 *wxSPropertyDataNameOut = wxT("NICKNAME");
2860 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2861 intiter != SplitPoints.end(); ++intiter){
2863 SLiter = SplitLength.find(intiter->first);
2865 if (ProcessItemData == TRUE){
2867 if (FirstToken == TRUE){
2869 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2874 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2880 if (FirstToken == TRUE){
2882 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2887 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2893 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2894 PropertyName = PropertyElement.GetNextToken();
2895 PropertyValue = PropertyElement.GetNextToken();
2897 intPrevValue = intiter->second;
2899 // Process properties.
2901 // Check if there is a lock on the property value. If there is a lock then
2902 // the property value cannot be changed.
2904 if (PropertyName.IsEmpty()){
2910 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2912 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2914 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2918 PropertyDataMap->erase(PropertyName);
2919 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2927 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2928 *XVCardV4Value = TRUE;
2934 if (wxSProperty == wxT("X-VCARD4-GENDER")){
2936 if (ProcessItemData == TRUE){
2938 intPropertyLen = wxSPropertySeg1Chopped.Len();
2942 intPropertyLen = wxSPropertySeg1Ptr->Len();
2946 std::map<int, int> SplitPoints;
2947 std::map<int, int> SplitLength;
2948 std::map<int, int>::iterator SLiter;
2949 std::map<wxString, bool>::iterator BIter;;
2950 wxString PropertyData;
2951 wxString PropertyName;
2952 wxString PropertyValue;
2953 wxString PropertyTokens;
2954 bool FirstToken = TRUE;
2955 int intPrevValue = 17;
2957 if (ProcessItemData == TRUE){
2959 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2963 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2964 *wxSPropertyDataNameOut = wxT("GENDER");
2968 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2969 intiter != SplitPoints.end(); ++intiter){
2971 SLiter = SplitLength.find(intiter->first);
2973 if (ProcessItemData == TRUE){
2975 if (FirstToken == TRUE){
2977 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2982 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2988 if (FirstToken == TRUE){
2990 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2995 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3001 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3002 PropertyName = PropertyElement.GetNextToken();
3003 PropertyValue = PropertyElement.GetNextToken();
3005 //ProcessCaptureStrings(&PropertyValue);
3007 intPrevValue = intiter->second;
3009 // Process properties.
3011 // Check if there is a lock on the property value. If there is a lock then
3012 // the property value cannot be changed.
3014 if (PropertyName.IsEmpty()){
3020 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3022 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3024 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3028 PropertyDataMap->erase(PropertyName);
3029 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3037 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3038 *XVCardV4Value = TRUE;
3044 if (wxSProperty == wxT("X-VCARD4-BDAY")){
3046 if (ProcessItemData == TRUE){
3048 intPropertyLen = wxSPropertySeg1Chopped.Len();
3052 intPropertyLen = wxSPropertySeg1Ptr->Len();
3056 std::map<int, int> SplitPoints;
3057 std::map<int, int> SplitLength;
3058 std::map<int, int>::iterator SLiter;
3059 std::map<wxString, bool>::iterator BIter;;
3060 wxString PropertyData;
3061 wxString PropertyName;
3062 wxString PropertyValue;
3063 wxString PropertyTokens;
3064 bool FirstToken = TRUE;
3065 int intPrevValue = 15;
3067 if (ProcessItemData == TRUE){
3069 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3073 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3074 *wxSPropertyDataNameOut = wxT("BDAY");
3078 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3079 intiter != SplitPoints.end(); ++intiter){
3081 SLiter = SplitLength.find(intiter->first);
3083 if (ProcessItemData == TRUE){
3085 if (FirstToken == TRUE){
3087 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3092 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3098 if (FirstToken == TRUE){
3100 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3105 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3111 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3112 PropertyName = PropertyElement.GetNextToken();
3113 PropertyValue = PropertyElement.GetNextToken();
3115 intPrevValue = intiter->second;
3117 // Process properties.
3119 // Check if there is a lock on the property value. If there is a lock then
3120 // the property value cannot be changed.
3122 if (PropertyName.IsEmpty()){
3128 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3130 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3132 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3136 PropertyDataMap->erase(PropertyName);
3137 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3145 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3146 *XVCardV4Value = TRUE;
3150 // X-VCARD4-ANNIVERSARY
3152 if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
3154 if (ProcessItemData == TRUE){
3156 intPropertyLen = wxSPropertySeg1Chopped.Len();
3160 intPropertyLen = wxSPropertySeg1Ptr->Len();
3164 std::map<int, int> SplitPoints;
3165 std::map<int, int> SplitLength;
3166 std::map<int, int>::iterator SLiter;
3167 std::map<wxString, bool>::iterator BIter;;
3168 wxString PropertyData;
3169 wxString PropertyName;
3170 wxString PropertyValue;
3171 wxString PropertyTokens;
3172 bool FirstToken = TRUE;
3173 int intPrevValue = 22;
3175 if (ProcessItemData == TRUE){
3177 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3181 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3182 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
3186 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3187 intiter != SplitPoints.end(); ++intiter){
3189 SLiter = SplitLength.find(intiter->first);
3191 if (ProcessItemData == TRUE){
3193 if (FirstToken == TRUE){
3195 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3200 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3206 if (FirstToken == TRUE){
3208 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3213 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3219 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3220 PropertyName = PropertyElement.GetNextToken();
3221 PropertyValue = PropertyElement.GetNextToken();
3223 intPrevValue = intiter->second;
3225 // Process properties.
3227 // Check if there is a lock on the property value. If there is a lock then
3228 // the property value cannot be changed.
3230 if (PropertyName.IsEmpty()){
3236 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3238 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3240 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3244 PropertyDataMap->erase(PropertyName);
3245 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3253 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3254 *XVCardV4Value = TRUE;
3260 if (wxSProperty == wxT("X-VCARD4-TZ")){
3262 if (ProcessItemData == TRUE){
3264 intPropertyLen = wxSPropertySeg1Chopped.Len();
3268 intPropertyLen = wxSPropertySeg1Ptr->Len();
3272 std::map<int, int> SplitPoints;
3273 std::map<int, int> SplitLength;
3274 std::map<int, int>::iterator SLiter;
3275 std::map<wxString, bool>::iterator BIter;;
3276 wxString PropertyData;
3277 wxString PropertyName;
3278 wxString PropertyValue;
3279 wxString PropertyTokens;
3280 bool FirstToken = TRUE;
3281 int intPrevValue = 13;
3283 if (ProcessItemData == TRUE){
3285 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3289 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3290 *wxSPropertyDataNameOut = wxT("TZ");
3294 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3295 intiter != SplitPoints.end(); ++intiter){
3297 SLiter = SplitLength.find(intiter->first);
3299 if (ProcessItemData == TRUE){
3301 if (FirstToken == TRUE){
3303 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3308 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3314 if (FirstToken == TRUE){
3316 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3321 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3327 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3328 PropertyName = PropertyElement.GetNextToken();
3329 PropertyValue = PropertyElement.GetNextToken();
3331 intPrevValue = intiter->second;
3333 // Process properties.
3335 // Check if there is a lock on the property value. If there is a lock then
3336 // the property value cannot be changed.
3338 if (PropertyName.IsEmpty()){
3344 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3346 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3348 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3352 PropertyDataMap->erase(PropertyName);
3353 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3361 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3362 *XVCardV4Value = TRUE;
3368 if (wxSProperty == wxT("X-VCARD4-ADR")){
3370 if (ProcessItemData == TRUE){
3372 intPropertyLen = wxSPropertySeg1Chopped.Len();
3376 intPropertyLen = wxSPropertySeg1Ptr->Len();
3380 std::map<int, int> SplitPoints;
3381 std::map<int, int> SplitLength;
3382 std::map<int, int>::iterator SLiter;
3383 std::map<wxString, bool>::iterator BIter;;
3384 wxString PropertyData;
3385 wxString PropertyName;
3386 wxString PropertyValue;
3387 wxString PropertyTokens;
3388 bool FirstToken = TRUE;
3389 int intPrevValue = 14;
3391 if (ProcessItemData == TRUE){
3393 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3397 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3398 *wxSPropertyDataNameOut = wxT("ADR");
3402 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3403 intiter != SplitPoints.end(); ++intiter){
3405 SLiter = SplitLength.find(intiter->first);
3407 if (ProcessItemData == TRUE){
3409 if (FirstToken == TRUE){
3411 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3416 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3422 if (FirstToken == TRUE){
3424 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3429 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3435 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3436 PropertyName = PropertyElement.GetNextToken();
3437 PropertyValue = PropertyElement.GetNextToken();
3439 intPrevValue = intiter->second;
3441 // Process properties.
3443 // Check if there is a lock on the property value. If there is a lock then
3444 // the property value cannot be changed.
3446 if (PropertyName.IsEmpty()){
3452 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3454 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3456 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3460 PropertyDataMap->erase(PropertyName);
3461 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3469 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3470 *XVCardV4Value = TRUE;
3476 if (wxSProperty == wxT("X-VCARD4-EMAIL")){
3478 if (ProcessItemData == TRUE){
3480 intPropertyLen = wxSPropertySeg1Chopped.Len();
3484 intPropertyLen = wxSPropertySeg1Ptr->Len();
3488 std::map<int, int> SplitPoints;
3489 std::map<int, int> SplitLength;
3490 std::map<int, int>::iterator SLiter;
3491 std::map<wxString, bool>::iterator BIter;;
3492 wxString PropertyData;
3493 wxString PropertyName;
3494 wxString PropertyValue;
3495 wxString PropertyTokens;
3496 bool FirstToken = TRUE;
3497 int intPrevValue = 16;
3499 if (ProcessItemData == TRUE){
3501 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3505 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3506 *wxSPropertyDataNameOut = wxT("EMAIL");
3510 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3511 intiter != SplitPoints.end(); ++intiter){
3513 SLiter = SplitLength.find(intiter->first);
3515 if (ProcessItemData == TRUE){
3517 if (FirstToken == TRUE){
3519 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3524 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3530 if (FirstToken == TRUE){
3532 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3537 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3543 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3544 PropertyName = PropertyElement.GetNextToken();
3545 PropertyValue = PropertyElement.GetNextToken();
3547 intPrevValue = intiter->second;
3549 // Process properties.
3551 // Check if there is a lock on the property value. If there is a lock then
3552 // the property value cannot be changed.
3554 if (PropertyName.IsEmpty()){
3560 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3562 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3564 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3568 PropertyDataMap->erase(PropertyName);
3569 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3577 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3578 *XVCardV4Value = TRUE;
3584 if (wxSProperty == wxT("X-VCARD4-IMPP")){
3586 if (ProcessItemData == TRUE){
3588 intPropertyLen = wxSPropertySeg1Chopped.Len();
3592 intPropertyLen = wxSPropertySeg1Ptr->Len();
3596 std::map<int, int> SplitPoints;
3597 std::map<int, int> SplitLength;
3598 std::map<int, int>::iterator SLiter;
3599 std::map<wxString, bool>::iterator BIter;;
3600 wxString PropertyData;
3601 wxString PropertyName;
3602 wxString PropertyValue;
3603 wxString PropertyTokens;
3604 bool FirstToken = TRUE;
3605 int intPrevValue = 15;
3607 if (ProcessItemData == TRUE){
3609 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3613 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3614 *wxSPropertyDataNameOut = wxT("IMPP");
3618 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3619 intiter != SplitPoints.end(); ++intiter){
3621 SLiter = SplitLength.find(intiter->first);
3623 if (ProcessItemData == TRUE){
3625 if (FirstToken == TRUE){
3627 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3632 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3638 if (FirstToken == TRUE){
3640 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3645 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3651 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3652 PropertyName = PropertyElement.GetNextToken();
3653 PropertyValue = PropertyElement.GetNextToken();
3655 intPrevValue = intiter->second;
3657 // Process properties.
3659 // Check if there is a lock on the property value. If there is a lock then
3660 // the property value cannot be changed.
3662 if (PropertyName.IsEmpty()){
3668 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3670 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3672 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3676 PropertyDataMap->erase(PropertyName);
3677 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3685 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3686 *XVCardV4Value = TRUE;
3692 if (wxSProperty == wxT("X-VCARD4-TEL")){
3694 if (ProcessItemData == TRUE){
3696 intPropertyLen = wxSPropertySeg1Chopped.Len();
3700 intPropertyLen = wxSPropertySeg1Ptr->Len();
3704 std::map<int, int> SplitPoints;
3705 std::map<int, int> SplitLength;
3706 std::map<int, int>::iterator SLiter;
3707 std::map<wxString, bool>::iterator BIter;;
3708 wxString PropertyData;
3709 wxString PropertyName;
3710 wxString PropertyValue;
3711 wxString PropertyTokens;
3712 bool FirstToken = TRUE;
3713 int intPrevValue = 14;
3715 if (ProcessItemData == TRUE){
3717 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3721 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3722 *wxSPropertyDataNameOut = wxT("TEL");
3726 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3727 intiter != SplitPoints.end(); ++intiter){
3729 SLiter = SplitLength.find(intiter->first);
3731 if (ProcessItemData == TRUE){
3733 if (FirstToken == TRUE){
3735 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3740 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3746 if (FirstToken == TRUE){
3748 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3753 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3759 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3760 PropertyName = PropertyElement.GetNextToken();
3761 PropertyValue = PropertyElement.GetNextToken();
3763 intPrevValue = intiter->second;
3765 // Process properties.
3767 // Check if there is a lock on the property value. If there is a lock then
3768 // the property value cannot be changed.
3770 if (PropertyName.IsEmpty()){
3776 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3778 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3780 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3784 PropertyDataMap->erase(PropertyName);
3785 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3793 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3794 *XVCardV4Value = TRUE;
3800 if (wxSProperty == wxT("X-VCARD4-LANG")){
3802 if (ProcessItemData == TRUE){
3804 intPropertyLen = wxSPropertySeg1Chopped.Len();
3808 intPropertyLen = wxSPropertySeg1Ptr->Len();
3812 std::map<int, int> SplitPoints;
3813 std::map<int, int> SplitLength;
3814 std::map<int, int>::iterator SLiter;
3815 std::map<wxString, bool>::iterator BIter;;
3816 wxString PropertyData;
3817 wxString PropertyName;
3818 wxString PropertyValue;
3819 wxString PropertyTokens;
3820 bool FirstToken = TRUE;
3821 int intPrevValue = 15;
3823 if (ProcessItemData == TRUE){
3825 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3829 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3830 *wxSPropertyDataNameOut = wxT("LANG");
3834 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3835 intiter != SplitPoints.end(); ++intiter){
3837 SLiter = SplitLength.find(intiter->first);
3839 if (ProcessItemData == TRUE){
3841 if (FirstToken == TRUE){
3843 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3848 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3854 if (FirstToken == TRUE){
3856 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3861 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3867 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3868 PropertyName = PropertyElement.GetNextToken();
3869 PropertyValue = PropertyElement.GetNextToken();
3871 intPrevValue = intiter->second;
3873 // Process properties.
3875 // Check if there is a lock on the property value. If there is a lock then
3876 // the property value cannot be changed.
3878 if (PropertyName.IsEmpty()){
3884 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3886 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3888 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3892 PropertyDataMap->erase(PropertyName);
3893 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3901 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3902 *XVCardV4Value = TRUE;
3908 if (wxSProperty == wxT("X-VCARD4-GEO")){
3910 if (ProcessItemData == TRUE){
3912 intPropertyLen = wxSPropertySeg1Chopped.Len();
3916 intPropertyLen = wxSPropertySeg1Ptr->Len();
3920 std::map<int, int> SplitPoints;
3921 std::map<int, int> SplitLength;
3922 std::map<int, int>::iterator SLiter;
3923 std::map<wxString, bool>::iterator BIter;;
3924 wxString PropertyData;
3925 wxString PropertyName;
3926 wxString PropertyValue;
3927 wxString PropertyTokens;
3928 bool FirstToken = TRUE;
3929 int intPrevValue = 14;
3931 if (ProcessItemData == TRUE){
3933 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3937 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3938 *wxSPropertyDataNameOut = wxT("GEO");
3942 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3943 intiter != SplitPoints.end(); ++intiter){
3945 SLiter = SplitLength.find(intiter->first);
3947 if (ProcessItemData == TRUE){
3949 if (FirstToken == TRUE){
3951 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3956 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3962 if (FirstToken == TRUE){
3964 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3969 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3975 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3976 PropertyName = PropertyElement.GetNextToken();
3977 PropertyValue = PropertyElement.GetNextToken();
3979 intPrevValue = intiter->second;
3981 // Process properties.
3983 // Check if there is a lock on the property value. If there is a lock then
3984 // the property value cannot be changed.
3986 if (PropertyName.IsEmpty()){
3992 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3994 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3996 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4000 PropertyDataMap->erase(PropertyName);
4001 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4009 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4010 *XVCardV4Value = TRUE;
4016 if (wxSProperty == wxT("X-VCARD4-RELATED")){
4018 if (ProcessItemData == TRUE){
4020 intPropertyLen = wxSPropertySeg1Chopped.Len();
4024 intPropertyLen = wxSPropertySeg1Ptr->Len();
4028 std::map<int, int> SplitPoints;
4029 std::map<int, int> SplitLength;
4030 std::map<int, int>::iterator SLiter;
4031 std::map<wxString, bool>::iterator BIter;;
4032 wxString PropertyData;
4033 wxString PropertyName;
4034 wxString PropertyValue;
4035 wxString PropertyTokens;
4036 bool FirstToken = TRUE;
4037 int intPrevValue = 18;
4039 if (ProcessItemData == TRUE){
4041 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4045 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4046 *wxSPropertyDataNameOut = wxT("RELATED");
4050 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4051 intiter != SplitPoints.end(); ++intiter){
4053 SLiter = SplitLength.find(intiter->first);
4055 if (ProcessItemData == TRUE){
4057 if (FirstToken == TRUE){
4059 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4064 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4070 if (FirstToken == TRUE){
4072 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4077 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4083 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4084 PropertyName = PropertyElement.GetNextToken();
4085 PropertyValue = PropertyElement.GetNextToken();
4087 intPrevValue = intiter->second;
4089 // Process properties.
4091 // Check if there is a lock on the property value. If there is a lock then
4092 // the property value cannot be changed.
4094 if (PropertyName.IsEmpty()){
4100 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4102 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4104 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4108 PropertyDataMap->erase(PropertyName);
4109 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4117 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4118 *XVCardV4Value = TRUE;
4124 if (wxSProperty == wxT("X-VCARD4-URL")){
4126 if (ProcessItemData == TRUE){
4128 intPropertyLen = wxSPropertySeg1Chopped.Len();
4132 intPropertyLen = wxSPropertySeg1Ptr->Len();
4136 std::map<int, int> SplitPoints;
4137 std::map<int, int> SplitLength;
4138 std::map<int, int>::iterator SLiter;
4139 std::map<wxString, bool>::iterator BIter;;
4140 wxString PropertyData;
4141 wxString PropertyName;
4142 wxString PropertyValue;
4143 wxString PropertyTokens;
4144 bool FirstToken = TRUE;
4145 int intPrevValue = 14;
4147 if (ProcessItemData == TRUE){
4149 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4153 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4154 *wxSPropertyDataNameOut = wxT("URL");
4158 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4159 intiter != SplitPoints.end(); ++intiter){
4161 SLiter = SplitLength.find(intiter->first);
4163 if (ProcessItemData == TRUE){
4165 if (FirstToken == TRUE){
4167 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4172 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4178 if (FirstToken == TRUE){
4180 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4185 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4191 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4192 PropertyName = PropertyElement.GetNextToken();
4193 PropertyValue = PropertyElement.GetNextToken();
4195 intPrevValue = intiter->second;
4197 // Process properties.
4199 // Check if there is a lock on the property value. If there is a lock then
4200 // the property value cannot be changed.
4202 if (PropertyName.IsEmpty()){
4208 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4210 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4212 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4216 PropertyDataMap->erase(PropertyName);
4217 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4225 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4226 *XVCardV4Value = TRUE;
4232 if (wxSProperty == wxT("X-VCARD4-TITLE")){
4234 if (ProcessItemData == TRUE){
4236 intPropertyLen = wxSPropertySeg1Chopped.Len();
4240 intPropertyLen = wxSPropertySeg1Ptr->Len();
4244 std::map<int, int> SplitPoints;
4245 std::map<int, int> SplitLength;
4246 std::map<int, int>::iterator SLiter;
4247 std::map<wxString, bool>::iterator BIter;;
4248 wxString PropertyData;
4249 wxString PropertyName;
4250 wxString PropertyValue;
4251 wxString PropertyTokens;
4252 bool FirstToken = TRUE;
4253 int intPrevValue = 16;
4255 if (ProcessItemData == TRUE){
4257 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4261 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4262 *wxSPropertyDataNameOut = wxT("TITLE");
4266 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4267 intiter != SplitPoints.end(); ++intiter){
4269 SLiter = SplitLength.find(intiter->first);
4271 if (ProcessItemData == TRUE){
4273 if (FirstToken == TRUE){
4275 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4280 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4286 if (FirstToken == TRUE){
4288 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4293 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4299 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4300 PropertyName = PropertyElement.GetNextToken();
4301 PropertyValue = PropertyElement.GetNextToken();
4303 intPrevValue = intiter->second;
4305 // Process properties.
4307 // Check if there is a lock on the property value. If there is a lock then
4308 // the property value cannot be changed.
4310 if (PropertyName.IsEmpty()){
4316 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4318 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4320 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4324 PropertyDataMap->erase(PropertyName);
4325 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4333 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4334 *XVCardV4Value = TRUE;
4340 if (wxSProperty == wxT("X-VCARD4-ROLE")){
4342 if (ProcessItemData == TRUE){
4344 intPropertyLen = wxSPropertySeg1Chopped.Len();
4348 intPropertyLen = wxSPropertySeg1Ptr->Len();
4352 std::map<int, int> SplitPoints;
4353 std::map<int, int> SplitLength;
4354 std::map<int, int>::iterator SLiter;
4355 std::map<wxString, bool>::iterator BIter;;
4356 wxString PropertyData;
4357 wxString PropertyName;
4358 wxString PropertyValue;
4359 wxString PropertyTokens;
4360 bool FirstToken = TRUE;
4361 int intPrevValue = 15;
4363 if (ProcessItemData == TRUE){
4365 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4369 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4370 *wxSPropertyDataNameOut = wxT("ROLE");
4374 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4375 intiter != SplitPoints.end(); ++intiter){
4377 SLiter = SplitLength.find(intiter->first);
4379 if (ProcessItemData == TRUE){
4381 if (FirstToken == TRUE){
4383 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4388 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4394 if (FirstToken == TRUE){
4396 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4401 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4407 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4408 PropertyName = PropertyElement.GetNextToken();
4409 PropertyValue = PropertyElement.GetNextToken();
4411 intPrevValue = intiter->second;
4413 // Process properties.
4415 // Check if there is a lock on the property value. If there is a lock then
4416 // the property value cannot be changed.
4418 if (PropertyName.IsEmpty()){
4424 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4426 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4428 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4432 PropertyDataMap->erase(PropertyName);
4433 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4441 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4442 *XVCardV4Value = TRUE;
4448 if (wxSProperty == wxT("X-VCARD4-ORG")){
4450 if (ProcessItemData == TRUE){
4452 intPropertyLen = wxSPropertySeg1Chopped.Len();
4456 intPropertyLen = wxSPropertySeg1Ptr->Len();
4460 std::map<int, int> SplitPoints;
4461 std::map<int, int> SplitLength;
4462 std::map<int, int>::iterator SLiter;
4463 std::map<wxString, bool>::iterator BIter;;
4464 wxString PropertyData;
4465 wxString PropertyName;
4466 wxString PropertyValue;
4467 wxString PropertyTokens;
4468 bool FirstToken = TRUE;
4469 int intPrevValue = 14;
4471 if (ProcessItemData == TRUE){
4473 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4477 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4478 *wxSPropertyDataNameOut = wxT("ORG");
4482 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4483 intiter != SplitPoints.end(); ++intiter){
4485 SLiter = SplitLength.find(intiter->first);
4487 if (ProcessItemData == TRUE){
4489 if (FirstToken == TRUE){
4491 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4496 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4502 if (FirstToken == TRUE){
4504 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4509 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4515 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4516 PropertyName = PropertyElement.GetNextToken();
4517 PropertyValue = PropertyElement.GetNextToken();
4519 intPrevValue = intiter->second;
4521 // Process properties.
4523 // Check if there is a lock on the property value. If there is a lock then
4524 // the property value cannot be changed.
4526 if (PropertyName.IsEmpty()){
4532 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4534 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4536 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4540 PropertyDataMap->erase(PropertyName);
4541 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4549 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4550 *XVCardV4Value = TRUE;
4556 if (wxSProperty == wxT("X-VCARD4-NOTE")){
4558 if (ProcessItemData == TRUE){
4560 intPropertyLen = wxSPropertySeg1Chopped.Len();
4564 intPropertyLen = wxSPropertySeg1Ptr->Len();
4568 std::map<int, int> SplitPoints;
4569 std::map<int, int> SplitLength;
4570 std::map<int, int>::iterator SLiter;
4571 std::map<wxString, bool>::iterator BIter;;
4572 wxString PropertyData;
4573 wxString PropertyName;
4574 wxString PropertyValue;
4575 wxString PropertyTokens;
4576 bool FirstToken = TRUE;
4577 int intPrevValue = 15;
4579 if (ProcessItemData == TRUE){
4581 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4585 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4586 *wxSPropertyDataNameOut = wxT("NOTE");
4590 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4591 intiter != SplitPoints.end(); ++intiter){
4593 SLiter = SplitLength.find(intiter->first);
4595 if (ProcessItemData == TRUE){
4597 if (FirstToken == TRUE){
4599 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4604 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4610 if (FirstToken == TRUE){
4612 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4617 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4623 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4624 PropertyName = PropertyElement.GetNextToken();
4625 PropertyValue = PropertyElement.GetNextToken();
4627 intPrevValue = intiter->second;
4629 // Process properties.
4631 // Check if there is a lock on the property value. If there is a lock then
4632 // the property value cannot be changed.
4634 if (PropertyName.IsEmpty()){
4640 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4642 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4644 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4648 PropertyDataMap->erase(PropertyName);
4649 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4657 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4658 *XVCardV4Value = TRUE;
4662 // X-VCARD4-CATEGORIES
4664 if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
4666 if (ProcessItemData == TRUE){
4668 intPropertyLen = wxSPropertySeg1Chopped.Len();
4672 intPropertyLen = wxSPropertySeg1Ptr->Len();
4676 std::map<int, int> SplitPoints;
4677 std::map<int, int> SplitLength;
4678 std::map<int, int>::iterator SLiter;
4679 std::map<wxString, bool>::iterator BIter;;
4680 wxString PropertyData;
4681 wxString PropertyName;
4682 wxString PropertyValue;
4683 wxString PropertyTokens;
4684 bool FirstToken = TRUE;
4685 int intPrevValue = 21;
4687 if (ProcessItemData == TRUE){
4689 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4693 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4694 *wxSPropertyDataNameOut = wxT("CATEGORIES");
4698 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4699 intiter != SplitPoints.end(); ++intiter){
4701 SLiter = SplitLength.find(intiter->first);
4703 if (ProcessItemData == TRUE){
4705 if (FirstToken == TRUE){
4707 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4712 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4718 if (FirstToken == TRUE){
4720 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4725 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4731 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4732 PropertyName = PropertyElement.GetNextToken();
4733 PropertyValue = PropertyElement.GetNextToken();
4735 intPrevValue = intiter->second;
4737 // Process properties.
4739 // Check if there is a lock on the property value. If there is a lock then
4740 // the property value cannot be changed.
4742 if (PropertyName.IsEmpty()){
4748 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4750 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4752 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4756 PropertyDataMap->erase(PropertyName);
4757 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4765 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4766 *XVCardV4Value = TRUE;
4772 if (wxSProperty == wxT("X-VCARD4-PHOTO")){
4774 if (ProcessItemData == TRUE){
4776 intPropertyLen = wxSPropertySeg1Chopped.Len();
4780 intPropertyLen = wxSPropertySeg1Ptr->Len();
4784 std::map<int, int> SplitPoints;
4785 std::map<int, int> SplitLength;
4786 std::map<int, int>::iterator SLiter;
4787 std::map<wxString, bool>::iterator BIter;;
4788 wxString PropertyData;
4789 wxString PropertyName;
4790 wxString PropertyValue;
4791 wxString PropertyTokens;
4792 bool FirstToken = TRUE;
4793 int intPrevValue = 16;
4795 if (ProcessItemData == TRUE){
4797 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4801 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4802 *wxSPropertyDataNameOut = wxT("PHOTO");
4806 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4807 intiter != SplitPoints.end(); ++intiter){
4809 SLiter = SplitLength.find(intiter->first);
4811 if (ProcessItemData == TRUE){
4813 if (FirstToken == TRUE){
4815 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4820 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4826 if (FirstToken == TRUE){
4828 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4833 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4839 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4840 PropertyName = PropertyElement.GetNextToken();
4841 PropertyValue = PropertyElement.GetNextToken();
4843 intPrevValue = intiter->second;
4845 // Process properties.
4847 // Check if there is a lock on the property value. If there is a lock then
4848 // the property value cannot be changed.
4850 if (PropertyName.IsEmpty()){
4856 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4858 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4860 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4864 PropertyDataMap->erase(PropertyName);
4865 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4873 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4874 *XVCardV4Value = TRUE;
4880 if (wxSProperty == wxT("X-VCARD4-LOGO")){
4882 if (ProcessItemData == TRUE){
4884 intPropertyLen = wxSPropertySeg1Chopped.Len();
4888 intPropertyLen = wxSPropertySeg1Ptr->Len();
4892 std::map<int, int> SplitPoints;
4893 std::map<int, int> SplitLength;
4894 std::map<int, int>::iterator SLiter;
4895 std::map<wxString, bool>::iterator BIter;;
4896 wxString PropertyData;
4897 wxString PropertyName;
4898 wxString PropertyValue;
4899 wxString PropertyTokens;
4900 bool FirstToken = TRUE;
4901 int intPrevValue = 15;
4903 if (ProcessItemData == TRUE){
4905 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4909 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4910 *wxSPropertyDataNameOut = wxT("LOGO");
4914 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4915 intiter != SplitPoints.end(); ++intiter){
4917 SLiter = SplitLength.find(intiter->first);
4919 if (ProcessItemData == TRUE){
4921 if (FirstToken == TRUE){
4923 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4928 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4934 if (FirstToken == TRUE){
4936 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4941 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4947 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4948 PropertyName = PropertyElement.GetNextToken();
4949 PropertyValue = PropertyElement.GetNextToken();
4951 intPrevValue = intiter->second;
4953 // Process properties.
4955 // Check if there is a lock on the property value. If there is a lock then
4956 // the property value cannot be changed.
4958 if (PropertyName.IsEmpty()){
4964 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4966 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4968 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4972 PropertyDataMap->erase(PropertyName);
4973 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4981 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4982 *XVCardV4Value = TRUE;
4988 if (wxSProperty == wxT("X-VCARD4-SOUND")){
4990 if (ProcessItemData == TRUE){
4992 intPropertyLen = wxSPropertySeg1Chopped.Len();
4996 intPropertyLen = wxSPropertySeg1Ptr->Len();
5000 std::map<int, int> SplitPoints;
5001 std::map<int, int> SplitLength;
5002 std::map<int, int>::iterator SLiter;
5003 std::map<wxString, bool>::iterator BIter;;
5004 wxString PropertyData;
5005 wxString PropertyName;
5006 wxString PropertyValue;
5007 wxString PropertyTokens;
5008 bool FirstToken = TRUE;
5009 int intPrevValue = 16;
5011 if (ProcessItemData == TRUE){
5013 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5017 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5018 *wxSPropertyDataNameOut = wxT("SOUND");
5022 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5023 intiter != SplitPoints.end(); ++intiter){
5025 SLiter = SplitLength.find(intiter->first);
5027 if (ProcessItemData == TRUE){
5029 if (FirstToken == TRUE){
5031 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5036 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5042 if (FirstToken == TRUE){
5044 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5049 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5055 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5056 PropertyName = PropertyElement.GetNextToken();
5057 PropertyValue = PropertyElement.GetNextToken();
5059 intPrevValue = intiter->second;
5061 // Process properties.
5063 // Check if there is a lock on the property value. If there is a lock then
5064 // the property value cannot be changed.
5066 if (PropertyName.IsEmpty()){
5072 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5074 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5076 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5080 PropertyDataMap->erase(PropertyName);
5081 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5089 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5090 *XVCardV4Value = TRUE;
5096 if (wxSProperty == wxT("X-VCARD4-CALURI")){
5098 if (ProcessItemData == TRUE){
5100 intPropertyLen = wxSPropertySeg1Chopped.Len();
5104 intPropertyLen = wxSPropertySeg1Ptr->Len();
5108 std::map<int, int> SplitPoints;
5109 std::map<int, int> SplitLength;
5110 std::map<int, int>::iterator SLiter;
5111 std::map<wxString, bool>::iterator BIter;;
5112 wxString PropertyData;
5113 wxString PropertyName;
5114 wxString PropertyValue;
5115 wxString PropertyTokens;
5116 bool FirstToken = TRUE;
5117 int intPrevValue = 17;
5119 if (ProcessItemData == TRUE){
5121 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5125 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5126 *wxSPropertyDataNameOut = wxT("CALURI");
5130 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5131 intiter != SplitPoints.end(); ++intiter){
5133 SLiter = SplitLength.find(intiter->first);
5135 if (ProcessItemData == TRUE){
5137 if (FirstToken == TRUE){
5139 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5144 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5150 if (FirstToken == TRUE){
5152 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5157 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5163 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5164 PropertyName = PropertyElement.GetNextToken();
5165 PropertyValue = PropertyElement.GetNextToken();
5167 intPrevValue = intiter->second;
5169 // Process properties.
5171 // Check if there is a lock on the property value. If there is a lock then
5172 // the property value cannot be changed.
5174 if (PropertyName.IsEmpty()){
5180 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5182 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5184 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5188 PropertyDataMap->erase(PropertyName);
5189 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5197 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5198 *XVCardV4Value = TRUE;
5202 // X-VCARD4-CALADRURI
5204 if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
5206 if (ProcessItemData == TRUE){
5208 intPropertyLen = wxSPropertySeg1Chopped.Len();
5212 intPropertyLen = wxSPropertySeg1Ptr->Len();
5216 std::map<int, int> SplitPoints;
5217 std::map<int, int> SplitLength;
5218 std::map<int, int>::iterator SLiter;
5219 std::map<wxString, bool>::iterator BIter;;
5220 wxString PropertyData;
5221 wxString PropertyName;
5222 wxString PropertyValue;
5223 wxString PropertyTokens;
5224 bool FirstToken = TRUE;
5225 int intPrevValue = 20;
5227 if (ProcessItemData == TRUE){
5229 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5233 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5234 *wxSPropertyDataNameOut = wxT("CALADRURI");
5238 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5239 intiter != SplitPoints.end(); ++intiter){
5241 SLiter = SplitLength.find(intiter->first);
5243 if (ProcessItemData == TRUE){
5245 if (FirstToken == TRUE){
5247 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5252 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5258 if (FirstToken == TRUE){
5260 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5265 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5271 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5272 PropertyName = PropertyElement.GetNextToken();
5273 PropertyValue = PropertyElement.GetNextToken();
5275 intPrevValue = intiter->second;
5277 // Process properties.
5279 // Check if there is a lock on the property value. If there is a lock then
5280 // the property value cannot be changed.
5282 if (PropertyName.IsEmpty()){
5288 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5290 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5292 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5296 PropertyDataMap->erase(PropertyName);
5297 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5305 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5306 *XVCardV4Value = TRUE;
5312 if (wxSProperty == wxT("X-VCARD4-FBURL")){
5314 if (ProcessItemData == TRUE){
5316 intPropertyLen = wxSPropertySeg1Chopped.Len();
5320 intPropertyLen = wxSPropertySeg1Ptr->Len();
5324 std::map<int, int> SplitPoints;
5325 std::map<int, int> SplitLength;
5326 std::map<int, int>::iterator SLiter;
5327 std::map<wxString, bool>::iterator BIter;;
5328 wxString PropertyData;
5329 wxString PropertyName;
5330 wxString PropertyValue;
5331 wxString PropertyTokens;
5332 bool FirstToken = TRUE;
5333 int intPrevValue = 16;
5335 if (ProcessItemData == TRUE){
5337 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5341 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5342 *wxSPropertyDataNameOut = wxT("FBURL");
5346 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5347 intiter != SplitPoints.end(); ++intiter){
5349 SLiter = SplitLength.find(intiter->first);
5351 if (ProcessItemData == TRUE){
5353 if (FirstToken == TRUE){
5355 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5360 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5366 if (FirstToken == TRUE){
5368 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5373 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5379 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5380 PropertyName = PropertyElement.GetNextToken();
5381 PropertyValue = PropertyElement.GetNextToken();
5383 intPrevValue = intiter->second;
5385 // Process properties.
5387 // Check if there is a lock on the property value. If there is a lock then
5388 // the property value cannot be changed.
5390 if (PropertyName.IsEmpty()){
5396 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5398 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5400 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5404 PropertyDataMap->erase(PropertyName);
5405 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5413 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5414 *XVCardV4Value = TRUE;
5420 if (wxSProperty == wxT("X-VCARD4-KEY")){
5422 if (ProcessItemData == TRUE){
5424 intPropertyLen = wxSPropertySeg1Chopped.Len();
5428 intPropertyLen = wxSPropertySeg1Ptr->Len();
5432 std::map<int, int> SplitPoints;
5433 std::map<int, int> SplitLength;
5434 std::map<int, int>::iterator SLiter;
5435 std::map<wxString, bool>::iterator BIter;;
5436 wxString PropertyData;
5437 wxString PropertyName;
5438 wxString PropertyValue;
5439 wxString PropertyTokens;
5440 bool FirstToken = TRUE;
5441 int intPrevValue = 14;
5443 if (ProcessItemData == TRUE){
5445 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5449 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5450 *wxSPropertyDataNameOut = wxT("KEY");
5454 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5455 intiter != SplitPoints.end(); ++intiter){
5457 SLiter = SplitLength.find(intiter->first);
5459 if (ProcessItemData == TRUE){
5461 if (FirstToken == TRUE){
5463 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5468 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5474 if (FirstToken == TRUE){
5476 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5481 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5487 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5488 PropertyName = PropertyElement.GetNextToken();
5489 PropertyValue = PropertyElement.GetNextToken();
5491 intPrevValue = intiter->second;
5493 // Process properties.
5495 // Check if there is a lock on the property value. If there is a lock then
5496 // the property value cannot be changed.
5498 if (PropertyName.IsEmpty()){
5504 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5506 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5508 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5512 PropertyDataMap->erase(PropertyName);
5513 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5521 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5522 *XVCardV4Value = TRUE;
5528 if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
5530 if (ProcessItemData == TRUE){
5532 intPropertyLen = wxSPropertySeg1Chopped.Len();
5536 intPropertyLen = wxSPropertySeg1Ptr->Len();
5540 std::map<int, int> SplitPoints;
5541 std::map<int, int> SplitLength;
5542 std::map<int, int>::iterator SLiter;
5543 std::map<wxString, bool>::iterator BIter;;
5544 wxString PropertyData;
5545 wxString PropertyName;
5546 wxString PropertyValue;
5547 wxString PropertyTokens;
5548 bool FirstToken = TRUE;
5549 int intPrevValue = 14;
5551 if (ProcessItemData == TRUE){
5553 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5557 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5558 *wxSPropertyDataNameOut = wxSProperty.Mid(9);
5562 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5563 intiter != SplitPoints.end(); ++intiter){
5565 SLiter = SplitLength.find(intiter->first);
5567 if (ProcessItemData == TRUE){
5569 if (FirstToken == TRUE){
5571 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5576 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5582 if (FirstToken == TRUE){
5584 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5589 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5595 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5596 PropertyName = PropertyElement.GetNextToken();
5597 PropertyValue = PropertyElement.GetNextToken();
5599 intPrevValue = intiter->second;
5601 // Process properties.
5603 // Check if there is a lock on the property value. If there is a lock then
5604 // the property value cannot be changed.
5606 if (PropertyName.IsEmpty()){
5612 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5614 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5616 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5620 PropertyDataMap->erase(PropertyName);
5621 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5629 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5630 *XVCardV4Value = TRUE;
5634 // X-ADDRESSBOOKSERVER-KIND
5636 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
5640 if (ProcessItemData == TRUE){
5642 intPropertyLen = wxSPropertySeg1Chopped.Len();
5646 intPropertyLen = wxSPropertySeg1Ptr->Len();
5650 std::map<int, int> SplitPoints;
5651 std::map<int, int> SplitLength;
5652 std::map<int, int>::iterator SLiter;
5653 std::map<wxString, bool>::iterator BIter;;
5654 wxString PropertyData;
5655 wxString PropertyName;
5656 wxString PropertyValue;
5657 wxString PropertyTokens;
5658 bool FirstToken = TRUE;
5659 int intPrevValue = 26;
5661 if (ProcessItemData == TRUE){
5663 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5667 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5671 *wxSPropertyDataNameOut = wxT("KIND");
5673 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5674 intiter != SplitPoints.end(); ++intiter){
5676 SLiter = SplitLength.find(intiter->first);
5678 if (ProcessItemData == TRUE){
5680 if (FirstToken == TRUE){
5682 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5687 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5693 if (FirstToken == TRUE){
5695 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5700 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5706 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5707 PropertyName = PropertyElement.GetNextToken();
5708 PropertyValue = PropertyElement.GetNextToken();
5710 intPrevValue = intiter->second;
5712 // Process properties.
5714 // Check if there is a lock on the property value. If there is a lock then
5715 // the property value cannot be changed.
5717 if (PropertyName.IsEmpty()){
5723 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5725 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5727 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5731 PropertyDataMap->erase(PropertyName);
5732 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5740 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5741 *XVCardV4Value = TRUE;
5745 // X-ADDRESSBOOKSERVER-MEMBER
5747 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
5751 if (ProcessItemData == TRUE){
5753 intPropertyLen = wxSPropertySeg1Chopped.Len();
5757 intPropertyLen = wxSPropertySeg1Ptr->Len();
5761 std::map<int, int> SplitPoints;
5762 std::map<int, int> SplitLength;
5763 std::map<int, int>::iterator SLiter;
5764 std::map<wxString, bool>::iterator BIter;;
5765 wxString PropertyData;
5766 wxString PropertyName;
5767 wxString PropertyValue;
5768 wxString PropertyTokens;
5769 bool FirstToken = TRUE;
5770 int intPrevValue = 28;
5772 if (ProcessItemData == TRUE){
5774 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5778 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5782 *wxSPropertyDataNameOut = wxT("MEMBER");
5784 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5785 intiter != SplitPoints.end(); ++intiter){
5787 SLiter = SplitLength.find(intiter->first);
5789 if (ProcessItemData == TRUE){
5791 if (FirstToken == TRUE){
5793 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5798 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5804 if (FirstToken == TRUE){
5806 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5811 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5817 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5818 PropertyName = PropertyElement.GetNextToken();
5819 PropertyValue = PropertyElement.GetNextToken();
5821 intPrevValue = intiter->second;
5823 // Process properties.
5825 // Check if there is a lock on the property value. If there is a lock then
5826 // the property value cannot be changed.
5828 if (PropertyName.IsEmpty()){
5834 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5836 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5838 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5842 PropertyDataMap->erase(PropertyName);
5843 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5851 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5852 *XVCardV4Value = TRUE;
5857 // Deal with X-ABLabel specifically.
5859 if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
5861 intPropertyLen = wxSPropertySeg1Ptr->Len();
5862 std::map<int, int> SplitPoints;
5863 std::map<int, int> SplitLength;
5864 std::map<int, int>::iterator SLiter;
5865 wxString PropertyData;
5866 wxString PropertyName;
5867 wxString PropertyValue;
5868 wxString PropertyTokens;
5869 int intPrevValue = 11;
5871 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5873 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
5879 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
5881 CaptureString(strCapture, FALSE);
5885 void vCard34Conv::SplitValues(wxString *PropertyLine,
5886 std::map<int,int> *SplitPoints,
5887 std::map<int,int> *SplitLength,
5890 size_t intPropertyLen = PropertyLine->Len();
5891 int intSplitsFound = 0;
5892 int intSplitSize = 0;
5893 int intSplitSeek = 0;
5895 for (int i = intSize; i <= intPropertyLen; i++){
5899 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5900 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5902 if (intSplitsFound == 0){
5904 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5908 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5912 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
5922 if (intSplitsFound == 0){
5924 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
5925 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5929 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
5930 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5936 void vCard34Conv::SplitValuesData(wxString *PropertyLine,
5937 std::map<int,int> *SplitPoints,
5938 std::map<int,int> *SplitLength,
5940 std::map<wxString,wxString> *SplitData){
5943 wxStringTokenizer PropertyElement;
5944 wxString PropertyName;
5945 wxString PropertyValue;
5946 size_t intPropertyLen = PropertyLine->Len();
5947 int intSplitsFound = 0;
5948 int intSplitSize = 0;
5949 int intSplitSeek = (intSize - 1);
5951 for (int i = intSize; i <= intPropertyLen; i++){
5955 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5956 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5958 if (intSplitsFound == 0){
5960 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
5961 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5965 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
5966 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5970 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
5973 intSplitSeek = (i + 1);
5976 if (!DataStr.IsEmpty()){
5978 PropertyElement.SetString(DataStr, wxT("="));
5979 PropertyName = PropertyElement.GetNextToken();
5980 PropertyValue = PropertyElement.GetNextToken();
5981 SplitData->insert(std::make_pair(PropertyName, PropertyValue));
5986 PropertyName.clear();
5987 PropertyValue.clear();
5993 if (intSplitsFound == 0){
5995 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
5997 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
5998 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6002 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
6004 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
6005 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
6009 if (!DataStr.IsEmpty()){
6011 PropertyElement.SetString(DataStr, wxT("="));
6012 PropertyName = PropertyElement.GetNextToken();
6013 PropertyValue = PropertyElement.GetNextToken();
6014 SplitData->insert(std::make_pair(PropertyName, PropertyValue));