1 #include "vcard34conv.h"
3 #include "../version.h"
4 #include "../common/textprocessing.h"
10 #include <wx/tokenzr.h>
11 #include <wx/datetime.h>
14 // vcard.cpp - Deals with vCard 4.0 formatted files meeting the
15 // RFC 6350 specification.
17 vCard34Conv::vCard34Conv(){
25 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
26 wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr,
27 wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut,
28 wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
29 std::map<wxString,wxString> *PropertyDataMap,
30 std::map<wxString,bool> *PropertyLockMap,
31 bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
34 wxString wxSPropertySeg1Chopped;
35 size_t intPropertyLen;
37 if (ProcessItemData == TRUE){
39 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
41 wxSPropertySplit.GetNextToken();
42 wxSProperty = wxSPropertySplit.GetNextToken();
44 // Look for . in wxSPropertySeg1Ptr and remove all data before
47 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
48 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
53 wxSProperty = *wxSPropertyName;
58 // Go through each of the vCard 3.0 properties.
62 if (wxSProperty == wxT("EMAIL")){
64 if (ProcessItemData == TRUE){
66 intPropertyLen = wxSPropertySeg1Chopped.Len();
70 intPropertyLen = wxSPropertySeg1Ptr->Len();
74 std::map<int, int> SplitPoints;
75 std::map<int, int> SplitLength;
76 std::map<int, int>::iterator SLiter;
77 wxString PropertyData;
78 wxString PropertyName;
79 wxString PropertyValue;
80 wxString PropertyTokens;
81 bool FirstToken = TRUE;
84 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
85 *wxSPropertyDataNameOut = wxT("EMAIL");
88 if (ProcessItemData == TRUE){
90 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
94 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
98 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
99 intiter != SplitPoints.end(); ++intiter){
101 SLiter = SplitLength.find(intiter->first);
103 if (ProcessItemData == TRUE){
105 if (FirstToken == TRUE){
107 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
112 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
118 if (FirstToken == TRUE){
120 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
125 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
131 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
132 PropertyName = PropertyElement.GetNextToken();
133 PropertyValue = PropertyElement.GetNextToken();
135 //ProcessCaptureStrings(&PropertyValue);
137 intPrevValue = intiter->second;
139 if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
143 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
145 if (ProcessItemData == FALSE){
146 PropertyName = wxT("PREF");
147 PropertyValue = wxT("50");
154 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
155 PropertyValue = wxT("home");
158 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
159 PropertyValue = wxT("work");
162 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
163 PropertyName = wxT("X-TYPE");
164 PropertyValue = wxT("other");
167 // Process properties.
169 if (PropertyName.IsEmpty()){
175 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
177 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
178 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
182 PropertyDataMap->erase(PropertyName);
183 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
184 PropertyLockMap->erase(PropertyName);
185 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
195 if (wxSProperty == wxT("ADR")){
197 if (ProcessItemData == TRUE){
199 intPropertyLen = wxSPropertySeg1Chopped.Len();
203 intPropertyLen = wxSPropertySeg1Ptr->Len();
207 std::map<int, int> SplitPoints;
208 std::map<int, int> SplitLength;
209 std::map<int, int>::iterator SLiter;
210 wxString PropertyData;
211 wxString PropertyName;
212 wxString PropertyValue;
213 wxString PropertyTokens;
214 bool FirstToken = TRUE;
215 int intPrevValue = 5;
217 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
218 *wxSPropertyDataNameOut = wxT("ADR");
219 *VCardV3Value = TRUE;
221 if (ProcessItemData == TRUE){
223 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
227 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
231 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
232 intiter != SplitPoints.end(); ++intiter){
234 SLiter = SplitLength.find(intiter->first);
236 if (ProcessItemData == TRUE){
238 if (FirstToken == TRUE){
240 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
245 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
251 if (FirstToken == TRUE){
253 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
258 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
264 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
265 PropertyName = PropertyElement.GetNextToken();
266 PropertyValue = PropertyElement.GetNextToken();
268 intPrevValue = intiter->second;
270 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
272 if (ProcessItemData == FALSE){
273 PropertyName = wxT("PREF");
274 PropertyValue = wxT("50");
281 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
282 PropertyValue = wxT("home");
285 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
286 PropertyValue = wxT("work");
289 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
290 PropertyName = wxT("X-TYPE");
291 PropertyValue = wxT("other");
294 // Process properties.
296 if (PropertyName.IsEmpty()){
302 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
304 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
305 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
309 PropertyDataMap->erase(PropertyName);
310 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
311 PropertyLockMap->erase(PropertyName);
312 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
322 if (wxSProperty == wxT("LABEL")){
324 if (ProcessItemData == TRUE){
326 intPropertyLen = wxSPropertySeg1Chopped.Len();
330 intPropertyLen = wxSPropertySeg1Ptr->Len();
334 std::map<int, int> SplitPoints;
335 std::map<int, int> SplitLength;
336 std::map<int, int>::iterator SLiter;
337 wxString PropertyData;
338 wxString PropertyName;
339 wxString PropertyValue;
340 wxString PropertyTokens;
341 bool FirstToken = TRUE;
342 int intPrevValue = 7;
344 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
345 *wxSPropertyDataNameOut = wxT("ADR");
346 *VCardV3Value = TRUE;
348 if (ProcessItemData == TRUE){
350 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
354 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
358 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
359 intiter != SplitPoints.end(); ++intiter){
361 SLiter = SplitLength.find(intiter->first);
363 if (ProcessItemData == TRUE){
365 if (FirstToken == TRUE){
367 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
372 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
378 if (FirstToken == TRUE){
380 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
385 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
391 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
392 PropertyName = PropertyElement.GetNextToken();
393 PropertyValue = PropertyElement.GetNextToken();
395 intPrevValue = intiter->second;
397 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
401 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
402 PropertyValue = wxT("home");
405 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
406 PropertyValue = wxT("work");
409 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
410 PropertyName = wxT("X-TYPE");
411 PropertyValue = wxT("other");
414 // Process properties.
416 if (PropertyName.IsEmpty()){
422 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
424 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
425 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
429 PropertyDataMap->erase(PropertyName);
430 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
431 PropertyLockMap->erase(PropertyName);
432 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
438 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
444 if (wxSProperty == wxT("IMPP")){
446 if (ProcessItemData == TRUE){
448 intPropertyLen = wxSPropertySeg1Chopped.Len();
452 intPropertyLen = wxSPropertySeg1Ptr->Len();
456 std::map<int, int> SplitPoints;
457 std::map<int, int> SplitLength;
458 std::map<int, int>::iterator SLiter;
459 wxString PropertyData;
460 wxString PropertyName;
461 wxString PropertyValue;
462 wxString PropertyTokens;
463 bool FirstToken = TRUE;
464 int intPrevValue = 6;
466 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
470 IMPPType = IMPPSplit.GetNextToken();
472 if (IMPPSplit.HasMoreTokens()){
474 IMPPData = IMPPSplit.GetNextToken();
476 if (IMPPType == wxT("ymsgr")){
478 IMPPType = wxT("yahoo");
482 *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
486 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
487 *wxSPropertyDataNameOut = wxT("IMPP");
488 *VCardV3Value = TRUE;
490 if (ProcessItemData == TRUE){
492 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
496 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
500 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
501 intiter != SplitPoints.end(); ++intiter){
503 SLiter = SplitLength.find(intiter->first);
505 if (ProcessItemData == TRUE){
507 if (FirstToken == TRUE){
509 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
514 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
520 if (FirstToken == TRUE){
522 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
527 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
533 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
534 PropertyName = PropertyElement.GetNextToken();
535 PropertyValue = PropertyElement.GetNextToken();
537 intPrevValue = intiter->second;
539 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
543 if (PropertyName == wxT("X-SERVICE-TYPE")){
547 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
548 PropertyValue = wxT("home");
551 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
552 PropertyValue = wxT("work");
555 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
556 PropertyName = wxT("X-TYPE");
557 PropertyValue = wxT("other");
560 // Process properties.
562 if (PropertyName.IsEmpty()){
568 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
570 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
571 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
575 PropertyDataMap->erase(PropertyName);
576 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
577 PropertyLockMap->erase(PropertyName);
578 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
588 if (wxSProperty == wxT("TEL")){
590 if (ProcessItemData == TRUE){
592 intPropertyLen = wxSPropertySeg1Chopped.Len();
596 intPropertyLen = wxSPropertySeg1Ptr->Len();
600 std::map<int, int> SplitPoints;
601 std::map<int, int> SplitLength;
602 std::map<int, int>::iterator SLiter;
603 std::map<wxString, wxString> TelType;
604 wxString PropertyData;
605 wxString PropertyName;
606 wxString PropertyValue;
607 wxString PropertyTokens;
608 bool FirstToken = TRUE;
609 int intPrevValue = 5;
611 wxSPropertyDataOut->Append(wxT("tel:"));
612 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
613 *wxSPropertyDataNameOut = wxT("TEL");
614 *VCardV3Value = TRUE;
616 if (ProcessItemData == TRUE){
618 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
622 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
626 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
627 intiter != SplitPoints.end(); ++intiter){
629 SLiter = SplitLength.find(intiter->first);
631 if (ProcessItemData == TRUE){
633 if (FirstToken == TRUE){
635 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
640 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
646 if (FirstToken == TRUE){
648 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
653 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
659 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
660 PropertyName = PropertyElement.GetNextToken();
661 PropertyValue = PropertyElement.GetNextToken();
663 intPrevValue = intiter->second;
665 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
669 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
670 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
674 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
675 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
679 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
680 PropertyName = wxT("X-TYPE");
681 PropertyValue = wxT("other");
684 // Process the telephone type options.
688 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
689 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
695 if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
696 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
702 if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
703 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
709 if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
710 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
716 if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
717 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
723 if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
724 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
730 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
731 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
735 if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
736 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
737 wxString TypeSplitData;
738 while (TypeSplit.HasMoreTokens()){
740 TypeSplitData = TypeSplit.GetNextToken();
741 TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
742 TypeSplitData.clear();
748 // Process properties.
750 if (PropertyName.IsEmpty()){
756 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
758 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
759 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
763 PropertyDataMap->erase(PropertyName);
764 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
765 PropertyLockMap->erase(PropertyName);
766 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
772 wxString TelFinalString;
773 bool TelFirstToken = TRUE;
775 for (std::map<wxString, wxString>::iterator intiter = TelType.begin();
776 intiter != TelType.end(); ++intiter){
778 // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
780 if (TelFirstToken == TRUE){
782 TelFinalString.Append(wxT("\""));
783 TelFinalString.Append(intiter->first);
784 TelFirstToken = FALSE;
788 TelFinalString.Append(wxT(","));
789 TelFinalString.Append(intiter->first);
795 if (TelFirstToken == FALSE){
797 TelFinalString.Append(wxT("\""));
801 if (!TelFinalString.IsEmpty()){
803 if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
805 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
806 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
810 PropertyDataMap->erase(PropertyName);
811 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
812 PropertyLockMap->erase(PropertyName);
813 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
823 if (wxSProperty == wxT("X-ABRELATEDNAMES")){
825 if (ProcessItemData == TRUE){
827 intPropertyLen = wxSPropertySeg1Chopped.Len();
831 intPropertyLen = wxSPropertySeg1Ptr->Len();
835 std::map<int, int> SplitPoints;
836 std::map<int, int> SplitLength;
837 std::map<int, int>::iterator SLiter;
838 wxString PropertyData;
839 wxString PropertyName;
840 wxString PropertyValue;
841 wxString PropertyTokens;
842 bool FirstToken = TRUE;
843 int intPrevValue = 18;
845 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
846 *wxSPropertyDataNameOut = wxT("RELATED");
847 *VCardV3Value = TRUE;
849 if (ProcessItemData == TRUE){
851 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
855 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
859 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
860 intiter != SplitPoints.end(); ++intiter){
862 SLiter = SplitLength.find(intiter->first);
864 if (ProcessItemData == TRUE){
866 if (FirstToken == TRUE){
868 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
873 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
879 if (FirstToken == TRUE){
881 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
886 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
892 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
893 PropertyName = PropertyElement.GetNextToken();
894 PropertyValue = PropertyElement.GetNextToken();
896 //ProcessCaptureStrings(&PropertyValue);
898 intPrevValue = intiter->second;
900 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
904 // Process properties.
906 if (PropertyName.IsEmpty()){
912 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
914 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
915 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
919 PropertyDataMap->erase(PropertyName);
920 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
921 PropertyLockMap->erase(PropertyName);
922 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
932 if (wxSProperty == wxT("URL")){
934 if (ProcessItemData == TRUE){
936 intPropertyLen = wxSPropertySeg1Chopped.Len();
940 intPropertyLen = wxSPropertySeg1Ptr->Len();
944 std::map<int, int> SplitPoints;
945 std::map<int, int> SplitLength;
946 std::map<int, int>::iterator SLiter;
947 wxString PropertyData;
948 wxString PropertyName;
949 wxString PropertyValue;
950 wxString PropertyTokens;
951 bool FirstToken = TRUE;
952 int intPrevValue = 5;
954 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
955 *wxSPropertyDataNameOut = wxT("URL");
956 *VCardV3Value = TRUE;
958 if (ProcessItemData == TRUE){
960 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
964 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
968 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
969 intiter != SplitPoints.end(); ++intiter){
971 SLiter = SplitLength.find(intiter->first);
973 if (ProcessItemData == TRUE){
975 if (FirstToken == TRUE){
977 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
982 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
988 if (FirstToken == TRUE){
990 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
995 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1001 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1002 PropertyName = PropertyElement.GetNextToken();
1003 PropertyValue = PropertyElement.GetNextToken();
1005 intPrevValue = intiter->second;
1007 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
1011 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
1012 PropertyValue = wxT("home");
1015 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
1016 PropertyValue = wxT("work");
1019 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
1020 PropertyName = wxT("X-TYPE");
1021 PropertyValue = wxT("other");
1024 // Process properties.
1026 if (PropertyName.IsEmpty()){
1032 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1034 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1035 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1039 PropertyDataMap->erase(PropertyName);
1040 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1041 PropertyLockMap->erase(PropertyName);
1042 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1052 if (wxSProperty == wxT("TITLE")){
1054 if (ProcessItemData == TRUE){
1056 intPropertyLen = wxSPropertySeg1Chopped.Len();
1060 intPropertyLen = wxSPropertySeg1Ptr->Len();
1064 std::map<int, int> SplitPoints;
1065 std::map<int, int> SplitLength;
1066 std::map<int, int>::iterator SLiter;
1067 wxString PropertyData;
1068 wxString PropertyName;
1069 wxString PropertyValue;
1070 wxString PropertyTokens;
1071 bool FirstToken = TRUE;
1072 int intPrevValue = 7;
1074 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1075 *wxSPropertyDataNameOut = wxT("TITLE");
1076 *VCardV3Value = TRUE;
1078 if (ProcessItemData == TRUE){
1080 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1084 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1088 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1089 intiter != SplitPoints.end(); ++intiter){
1091 SLiter = SplitLength.find(intiter->first);
1093 if (ProcessItemData == TRUE){
1095 if (FirstToken == TRUE){
1097 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1102 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1108 if (FirstToken == TRUE){
1110 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1115 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1121 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1122 PropertyName = PropertyElement.GetNextToken();
1123 PropertyValue = PropertyElement.GetNextToken();
1125 intPrevValue = intiter->second;
1127 // Process properties.
1129 if (PropertyName.IsEmpty()){
1135 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1137 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1138 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1142 PropertyDataMap->erase(PropertyName);
1143 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1144 PropertyLockMap->erase(PropertyName);
1145 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1155 if (wxSProperty == wxT("FN")){
1157 if (ProcessItemData == TRUE){
1159 intPropertyLen = wxSPropertySeg1Chopped.Len();
1163 intPropertyLen = wxSPropertySeg1Ptr->Len();
1167 std::map<int, int> SplitPoints;
1168 std::map<int, int> SplitLength;
1169 std::map<int, int>::iterator SLiter;
1170 wxString PropertyData;
1171 wxString PropertyName;
1172 wxString PropertyValue;
1173 wxString PropertyTokens;
1174 bool FirstToken = TRUE;
1175 int intPrevValue = 4;
1177 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1178 *wxSPropertyDataNameOut = wxT("FN");
1179 *VCardV3Value = TRUE;
1181 if (ProcessItemData == TRUE){
1183 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1187 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1191 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1192 intiter != SplitPoints.end(); ++intiter){
1194 SLiter = SplitLength.find(intiter->first);
1196 if (ProcessItemData == TRUE){
1198 if (FirstToken == TRUE){
1200 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1205 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1211 if (FirstToken == TRUE){
1213 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1218 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1224 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1225 PropertyName = PropertyElement.GetNextToken();
1226 PropertyValue = PropertyElement.GetNextToken();
1228 intPrevValue = intiter->second;
1230 // Process properties.
1232 if (PropertyName.IsEmpty()){
1238 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1240 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1241 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1245 PropertyDataMap->erase(PropertyName);
1246 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1247 PropertyLockMap->erase(PropertyName);
1248 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1258 if (wxSProperty == wxT("N")){
1260 if (ProcessItemData == TRUE){
1262 intPropertyLen = wxSPropertySeg1Chopped.Len();
1266 intPropertyLen = wxSPropertySeg1Ptr->Len();
1270 std::map<int, int> SplitPoints;
1271 std::map<int, int> SplitLength;
1272 std::map<int, int>::iterator SLiter;
1273 wxString PropertyData;
1274 wxString PropertyName;
1275 wxString PropertyValue;
1276 wxString PropertyTokens;
1277 bool FirstToken = TRUE;
1278 int intPrevValue = 3;
1280 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1281 *wxSPropertyDataNameOut = wxT("N");
1282 *VCardV3Value = TRUE;
1284 if (ProcessItemData == TRUE){
1286 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1290 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1294 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1295 intiter != SplitPoints.end(); ++intiter){
1297 SLiter = SplitLength.find(intiter->first);
1299 if (ProcessItemData == TRUE){
1301 if (FirstToken == TRUE){
1303 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1308 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1314 if (FirstToken == TRUE){
1316 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1321 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1327 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1328 PropertyName = PropertyElement.GetNextToken();
1329 PropertyValue = PropertyElement.GetNextToken();
1331 intPrevValue = intiter->second;
1333 // Process properties.
1335 if (PropertyName.IsEmpty()){
1341 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1343 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1344 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1348 PropertyDataMap->erase(PropertyName);
1349 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1350 PropertyLockMap->erase(PropertyName);
1351 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1361 if (wxSProperty == wxT("UID")){
1363 if (ProcessItemData == TRUE){
1365 intPropertyLen = wxSPropertySeg1Chopped.Len();
1369 intPropertyLen = wxSPropertySeg1Ptr->Len();
1373 std::map<int, int> SplitPoints;
1374 std::map<int, int> SplitLength;
1375 std::map<int, int>::iterator SLiter;
1376 wxString PropertyData;
1377 wxString PropertyName;
1378 wxString PropertyValue;
1379 wxString PropertyTokens;
1380 bool FirstToken = TRUE;
1381 int intPrevValue = 5;
1383 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1384 *wxSPropertyDataNameOut = wxT("UID");
1385 *VCardV3Value = TRUE;
1387 if (ProcessItemData == TRUE){
1389 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1393 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1397 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1398 intiter != SplitPoints.end(); ++intiter){
1400 SLiter = SplitLength.find(intiter->first);
1402 if (ProcessItemData == TRUE){
1404 if (FirstToken == TRUE){
1406 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1411 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1417 if (FirstToken == TRUE){
1419 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1424 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1430 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1431 PropertyName = PropertyElement.GetNextToken();
1432 PropertyValue = PropertyElement.GetNextToken();
1434 intPrevValue = intiter->second;
1436 // Process properties.
1438 if (PropertyName.IsEmpty()){
1444 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1446 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1447 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1451 PropertyDataMap->erase(PropertyName);
1452 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1453 PropertyLockMap->erase(PropertyName);
1454 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1464 if (wxSProperty == wxT("NICKNAME")){
1466 if (ProcessItemData == TRUE){
1468 intPropertyLen = wxSPropertySeg1Chopped.Len();
1472 intPropertyLen = wxSPropertySeg1Ptr->Len();
1476 std::map<int, int> SplitPoints;
1477 std::map<int, int> SplitLength;
1478 std::map<int, int>::iterator SLiter;
1479 wxString PropertyData;
1480 wxString PropertyName;
1481 wxString PropertyValue;
1482 wxString PropertyTokens;
1483 bool FirstToken = TRUE;
1484 int intPrevValue = 10;
1486 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1487 *wxSPropertyDataNameOut = wxT("NICKNAME");
1488 *VCardV3Value = TRUE;
1490 if (ProcessItemData == TRUE){
1492 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1496 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1500 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1501 intiter != SplitPoints.end(); ++intiter){
1503 SLiter = SplitLength.find(intiter->first);
1505 if (ProcessItemData == TRUE){
1507 if (FirstToken == TRUE){
1509 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1514 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1520 if (FirstToken == TRUE){
1522 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1527 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1533 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1534 PropertyName = PropertyElement.GetNextToken();
1535 PropertyValue = PropertyElement.GetNextToken();
1537 intPrevValue = intiter->second;
1539 // Process properties.
1541 if (PropertyName.IsEmpty()){
1547 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1549 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1550 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1554 PropertyDataMap->erase(PropertyName);
1555 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1556 PropertyLockMap->erase(PropertyName);
1557 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1567 if (wxSProperty == wxT("GENDER")){
1569 if (ProcessItemData == TRUE){
1571 intPropertyLen = wxSPropertySeg1Chopped.Len();
1575 intPropertyLen = wxSPropertySeg1Ptr->Len();
1579 std::map<int, int> SplitPoints;
1580 std::map<int, int> SplitLength;
1581 std::map<int, int>::iterator SLiter;
1582 wxString PropertyData;
1583 wxString PropertyName;
1584 wxString PropertyValue;
1585 wxString PropertyTokens;
1586 bool FirstToken = TRUE;
1587 int intPrevValue = 8;
1589 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1590 *wxSPropertyDataNameOut = wxT("GENDER");
1591 *VCardV3Value = TRUE;
1593 if (ProcessItemData == TRUE){
1595 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1599 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1603 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1604 intiter != SplitPoints.end(); ++intiter){
1606 SLiter = SplitLength.find(intiter->first);
1608 if (ProcessItemData == TRUE){
1610 if (FirstToken == TRUE){
1612 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1617 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1623 if (FirstToken == TRUE){
1625 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1630 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1636 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1637 PropertyName = PropertyElement.GetNextToken();
1638 PropertyValue = PropertyElement.GetNextToken();
1640 intPrevValue = intiter->second;
1642 // Process properties.
1644 if (PropertyName.IsEmpty()){
1650 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1652 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1653 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1657 PropertyDataMap->erase(PropertyName);
1658 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1659 PropertyLockMap->erase(PropertyName);
1660 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1670 if (wxSProperty == wxT("BDAY")){
1672 if (ProcessItemData == TRUE){
1674 intPropertyLen = wxSPropertySeg1Chopped.Len();
1678 intPropertyLen = wxSPropertySeg1Ptr->Len();
1682 std::map<int, int> SplitPoints;
1683 std::map<int, int> SplitLength;
1684 std::map<int, int>::iterator SLiter;
1685 wxString PropertyData;
1686 wxString PropertyName;
1687 wxString PropertyValue;
1688 wxString PropertyTokens;
1689 wxString PropertyXOmitYear;
1690 bool FirstToken = TRUE;
1691 int intPrevValue = 6;
1693 *wxSPropertyDataNameOut = wxT("BDAY");
1694 *VCardV3Value = TRUE;
1696 if (ProcessItemData == TRUE){
1698 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1702 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1706 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1707 intiter != SplitPoints.end(); ++intiter){
1709 SLiter = SplitLength.find(intiter->first);
1711 if (ProcessItemData == TRUE){
1713 if (FirstToken == TRUE){
1715 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1720 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1726 if (FirstToken == TRUE){
1728 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1733 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1739 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1740 PropertyName = PropertyElement.GetNextToken();
1741 PropertyValue = PropertyElement.GetNextToken();
1743 intPrevValue = intiter->second;
1745 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1746 PropertyXOmitYear = PropertyValue;
1749 // Process properties.
1751 if (PropertyName.IsEmpty()){
1757 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1759 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1760 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1764 PropertyDataMap->erase(PropertyName);
1765 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1766 PropertyLockMap->erase(PropertyName);
1767 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1773 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1774 // year matches the X-APPLE-OMIT-YEAR value.
1776 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1781 DateProc = DateSplit.GetNextToken();
1783 if (DateProc == PropertyXOmitYear){
1785 FinalDate.Append(wxT("--"));
1789 FinalDate.Append(DateProc);
1794 DateProc = DateSplit.GetNextToken();
1796 FinalDate.Append(DateProc);
1799 DateProc = DateSplit.GetNextToken();
1801 FinalDate.Append(DateProc);
1803 wxSPropertyDataOut->Append(FinalDate);
1809 if (wxSProperty == wxT("ANNIVERSARY")){
1811 if (ProcessItemData == TRUE){
1813 intPropertyLen = wxSPropertySeg1Chopped.Len();
1817 intPropertyLen = wxSPropertySeg1Ptr->Len();
1821 std::map<int, int> SplitPoints;
1822 std::map<int, int> SplitLength;
1823 std::map<int, int>::iterator SLiter;
1824 wxString PropertyData;
1825 wxString PropertyName;
1826 wxString PropertyValue;
1827 wxString PropertyTokens;
1828 wxString PropertyXOmitYear;
1829 bool FirstToken = TRUE;
1830 int intPrevValue = 13;
1832 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
1833 *VCardV3Value = TRUE;
1835 if (ProcessItemData == TRUE){
1837 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1841 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1845 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1846 intiter != SplitPoints.end(); ++intiter){
1848 SLiter = SplitLength.find(intiter->first);
1850 if (ProcessItemData == TRUE){
1852 if (FirstToken == TRUE){
1854 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
1859 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
1865 if (FirstToken == TRUE){
1867 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
1872 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
1878 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1879 PropertyName = PropertyElement.GetNextToken();
1880 PropertyValue = PropertyElement.GetNextToken();
1882 intPrevValue = intiter->second;
1884 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
1885 PropertyXOmitYear = PropertyValue;
1888 // Process properties.
1890 if (PropertyName.IsEmpty()){
1896 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
1898 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1899 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1903 PropertyDataMap->erase(PropertyName);
1904 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
1905 PropertyLockMap->erase(PropertyName);
1906 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
1912 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
1913 // year matches the X-APPLE-OMIT-YEAR value.
1915 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
1920 DateProc = DateSplit.GetNextToken();
1922 if (DateProc == PropertyXOmitYear){
1924 FinalDate.Append(wxT("--"));
1928 FinalDate.Append(DateProc);
1933 DateProc = DateSplit.GetNextToken();
1935 FinalDate.Append(DateProc);
1938 DateProc = DateSplit.GetNextToken();
1940 FinalDate.Append(DateProc);
1942 wxSPropertyDataOut->Append(FinalDate);
1946 // TZ - Not sure how to process this correctly. So data
1947 // is kept as X-VCARD3-TZ for the time being.
1949 if (wxSProperty == wxT("TZ")){
1951 if (ProcessItemData == TRUE){
1953 intPropertyLen = wxSPropertySeg1Chopped.Len();
1957 intPropertyLen = wxSPropertySeg1Ptr->Len();
1961 std::map<int, int> SplitPoints;
1962 std::map<int, int> SplitLength;
1963 std::map<int, int>::iterator SLiter;
1964 wxString PropertyData;
1965 wxString PropertyName;
1966 wxString PropertyValue;
1967 wxString PropertyTokens;
1968 wxString PropertyXOmitYear;
1969 bool FirstToken = TRUE;
1970 int intPrevValue = 4;
1972 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
1973 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
1974 *VCardV3Value = TRUE;
1976 if (ProcessItemData == TRUE){
1978 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
1982 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
1986 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1987 intiter != SplitPoints.end(); ++intiter){
1989 SLiter = SplitLength.find(intiter->first);
1991 if (ProcessItemData == TRUE){
1993 if (FirstToken == TRUE){
1995 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2000 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2006 if (FirstToken == TRUE){
2008 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2013 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2019 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2020 PropertyName = PropertyElement.GetNextToken();
2021 PropertyValue = PropertyElement.GetNextToken();
2023 intPrevValue = intiter->second;
2025 // Process properties.
2027 if (PropertyName.IsEmpty()){
2033 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2035 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2036 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2040 PropertyDataMap->erase(PropertyName);
2041 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2042 PropertyLockMap->erase(PropertyName);
2043 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2053 if (wxSProperty == wxT("ROLE")){
2055 if (ProcessItemData == TRUE){
2057 intPropertyLen = wxSPropertySeg1Chopped.Len();
2061 intPropertyLen = wxSPropertySeg1Ptr->Len();
2065 std::map<int, int> SplitPoints;
2066 std::map<int, int> SplitLength;
2067 std::map<int, int>::iterator SLiter;
2068 wxString PropertyData;
2069 wxString PropertyName;
2070 wxString PropertyValue;
2071 wxString PropertyTokens;
2072 wxString PropertyXOmitYear;
2073 bool FirstToken = TRUE;
2074 int intPrevValue = 6;
2076 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2077 *wxSPropertyDataNameOut = wxT("ROLE");
2078 *VCardV3Value = TRUE;
2080 if (ProcessItemData == TRUE){
2082 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2086 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2090 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2091 intiter != SplitPoints.end(); ++intiter){
2093 SLiter = SplitLength.find(intiter->first);
2095 if (ProcessItemData == TRUE){
2097 if (FirstToken == TRUE){
2099 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2104 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2110 if (FirstToken == TRUE){
2112 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2117 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2123 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2124 PropertyName = PropertyElement.GetNextToken();
2125 PropertyValue = PropertyElement.GetNextToken();
2127 intPrevValue = intiter->second;
2129 // Process properties.
2131 if (PropertyName.IsEmpty()){
2137 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2139 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2140 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2144 PropertyDataMap->erase(PropertyName);
2145 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2146 PropertyLockMap->erase(PropertyName);
2147 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2157 if (wxSProperty == wxT("ORG")){
2159 if (ProcessItemData == TRUE){
2161 intPropertyLen = wxSPropertySeg1Chopped.Len();
2165 intPropertyLen = wxSPropertySeg1Ptr->Len();
2169 std::map<int, int> SplitPoints;
2170 std::map<int, int> SplitLength;
2171 std::map<int, int>::iterator SLiter;
2172 wxString PropertyData;
2173 wxString PropertyName;
2174 wxString PropertyValue;
2175 wxString PropertyTokens;
2176 wxString PropertyXOmitYear;
2177 bool FirstToken = TRUE;
2178 int intPrevValue = 5;
2180 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2181 *wxSPropertyDataNameOut = wxT("ORG");
2182 *VCardV3Value = TRUE;
2184 if (ProcessItemData == TRUE){
2186 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2190 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2194 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2195 intiter != SplitPoints.end(); ++intiter){
2197 SLiter = SplitLength.find(intiter->first);
2199 if (ProcessItemData == TRUE){
2201 if (FirstToken == TRUE){
2203 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2208 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2214 if (FirstToken == TRUE){
2216 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2221 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2227 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2228 PropertyName = PropertyElement.GetNextToken();
2229 PropertyValue = PropertyElement.GetNextToken();
2231 intPrevValue = intiter->second;
2233 // Process properties.
2235 if (PropertyName.IsEmpty()){
2241 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2243 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2244 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2248 PropertyDataMap->erase(PropertyName);
2249 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2250 PropertyLockMap->erase(PropertyName);
2251 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2261 if (wxSProperty == wxT("NOTE")){
2263 if (ProcessItemData == TRUE){
2265 intPropertyLen = wxSPropertySeg1Chopped.Len();
2269 intPropertyLen = wxSPropertySeg1Ptr->Len();
2273 std::map<int, int> SplitPoints;
2274 std::map<int, int> SplitLength;
2275 std::map<int, int>::iterator SLiter;
2276 wxString PropertyData;
2277 wxString PropertyName;
2278 wxString PropertyValue;
2279 wxString PropertyTokens;
2280 wxString PropertyXOmitYear;
2281 bool FirstToken = TRUE;
2282 int intPrevValue = 6;
2284 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2285 *wxSPropertyDataNameOut = wxT("NOTE");
2286 *VCardV3Value = TRUE;
2288 if (ProcessItemData == TRUE){
2290 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2294 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2298 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2299 intiter != SplitPoints.end(); ++intiter){
2301 SLiter = SplitLength.find(intiter->first);
2303 if (ProcessItemData == TRUE){
2305 if (FirstToken == TRUE){
2307 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2312 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2318 if (FirstToken == TRUE){
2320 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2325 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2331 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2332 PropertyName = PropertyElement.GetNextToken();
2333 PropertyValue = PropertyElement.GetNextToken();
2335 intPrevValue = intiter->second;
2337 // Process properties.
2339 if (PropertyName.IsEmpty()){
2345 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2347 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2348 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2352 PropertyDataMap->erase(PropertyName);
2353 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2354 PropertyLockMap->erase(PropertyName);
2355 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2365 if (wxSProperty == wxT("PHOTO")){
2367 if (ProcessItemData == TRUE){
2369 intPropertyLen = wxSPropertySeg1Chopped.Len();
2373 intPropertyLen = wxSPropertySeg1Ptr->Len();
2377 std::map<int, int> SplitPoints;
2378 std::map<int, int> SplitLength;
2379 std::map<int, int>::iterator SLiter;
2380 std::map<wxString, wxString> SplitData;
2381 wxString PropertyData;
2382 wxString PropertyName;
2383 wxString PropertyValue;
2384 wxString PropertyTokens;
2385 wxString PropertyXOmitYear;
2386 int intPrevValue = 7;
2388 *wxSPropertyDataNameOut = wxT("PHOTO");
2389 *VCardV3Value = TRUE;
2391 if (ProcessItemData == TRUE){
2393 SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2397 SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
2401 wxString wxSMIMEType;
2402 wxString wxSEncType;
2404 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
2405 intiter != SplitData.end(); ++intiter){
2407 PropertyName = intiter->first;
2408 PropertyValue = intiter->second;
2410 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2411 wxSEncType = wxT("base64");
2415 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
2416 wxSMIMEType = wxT("image/png");
2418 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
2419 wxSMIMEType = wxT("image/jpeg");
2421 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
2422 wxSMIMEType = wxT("image/gif");
2424 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
2425 wxSMIMEType = wxT("image/bmp");
2427 } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
2428 wxSMIMEType = wxT("image/unknown");
2432 // Process properties.
2434 if (PropertyName.IsEmpty()){
2440 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2442 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2443 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2447 PropertyDataMap->erase(PropertyName);
2448 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2449 PropertyLockMap->erase(PropertyName);
2450 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2456 wxSPropertyDataOut->Append(wxT("data:"));
2457 wxSPropertyDataOut->Append(wxSMIMEType);
2458 wxSPropertyDataOut->Append(wxT(";"));
2459 wxSPropertyDataOut->Append(wxSEncType);
2460 wxSPropertyDataOut->Append(wxT(","));
2461 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2467 if (wxSProperty == wxT("SOUND")){
2469 if (ProcessItemData == TRUE){
2471 intPropertyLen = wxSPropertySeg1Chopped.Len();
2475 intPropertyLen = wxSPropertySeg1Ptr->Len();
2479 std::map<int, int> SplitPoints;
2480 std::map<int, int> SplitLength;
2481 std::map<int, int>::iterator SLiter;
2482 wxString PropertyData;
2483 wxString PropertyName;
2484 wxString PropertyValue;
2485 wxString PropertyTokens;
2486 wxString PropertyXOmitYear;
2487 bool FirstToken = TRUE;
2488 int intPrevValue = 7;
2490 *wxSPropertyDataNameOut = wxT("SOUND");
2491 *VCardV3Value = TRUE;
2493 if (ProcessItemData == TRUE){
2495 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2499 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2503 wxString wxSMIMEType;
2504 wxString wxSEncType;
2506 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2507 intiter != SplitPoints.end(); ++intiter){
2509 SLiter = SplitLength.find(intiter->first);
2511 if (ProcessItemData == TRUE){
2513 if (FirstToken == TRUE){
2515 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2520 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2526 if (FirstToken == TRUE){
2528 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2533 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2539 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2540 PropertyName = PropertyElement.GetNextToken();
2541 PropertyValue = PropertyElement.GetNextToken();
2543 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
2544 wxSEncType = wxT("base64");
2548 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
2549 wxSMIMEType = PropertyValue;
2553 intPrevValue = intiter->second;
2555 // Process properties.
2557 if (PropertyName.IsEmpty()){
2563 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2565 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2566 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2570 PropertyDataMap->erase(PropertyName);
2571 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2572 PropertyLockMap->erase(PropertyName);
2573 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
2579 wxSPropertyDataOut->Append(wxT("data:"));
2580 wxSPropertyDataOut->Append(wxSMIMEType);
2581 wxSPropertyDataOut->Append(wxT(";"));
2582 wxSPropertyDataOut->Append(wxSEncType);
2583 wxSPropertyDataOut->Append(wxT(","));
2584 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
2588 // Look for backward compatability vCard 4.0 properties.
2592 if (wxSProperty == wxT("X-VCARD4-FN")){
2594 if (ProcessItemData == TRUE){
2596 intPropertyLen = wxSPropertySeg1Chopped.Len();
2600 intPropertyLen = wxSPropertySeg1Ptr->Len();
2601 *wxSPropertyDataNameOut = wxT("FN");
2605 std::map<int, int> SplitPoints;
2606 std::map<int, int> SplitLength;
2607 std::map<int, int>::iterator SLiter;
2608 std::map<wxString, bool>::iterator BIter;;
2609 wxString PropertyData;
2610 wxString PropertyName;
2611 wxString PropertyValue;
2612 wxString PropertyTokens;
2613 bool FirstToken = TRUE;
2614 int intPrevValue = 13;
2616 if (ProcessItemData == TRUE){
2618 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2622 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2626 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2627 intiter != SplitPoints.end(); ++intiter){
2629 SLiter = SplitLength.find(intiter->first);
2631 if (ProcessItemData == TRUE){
2633 if (FirstToken == TRUE){
2635 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2640 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2646 if (FirstToken == TRUE){
2648 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2653 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2659 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2660 PropertyName = PropertyElement.GetNextToken();
2661 PropertyValue = PropertyElement.GetNextToken();
2663 intPrevValue = intiter->second;
2665 // Process properties.
2667 // Check if there is a lock on the property value. If there is a lock then
2668 // the property value cannot be changed.
2670 if (PropertyName.IsEmpty()){
2676 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2678 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2680 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2684 PropertyDataMap->erase(PropertyName);
2685 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2693 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2694 *XVCardV4Value = TRUE;
2700 if (wxSProperty == wxT("X-VCARD4-N")){
2702 if (ProcessItemData == TRUE){
2704 intPropertyLen = wxSPropertySeg1Chopped.Len();
2708 intPropertyLen = wxSPropertySeg1Ptr->Len();
2712 std::map<int, int> SplitPoints;
2713 std::map<int, int> SplitLength;
2714 std::map<int, int>::iterator SLiter;
2715 std::map<wxString, bool>::iterator BIter;;
2716 wxString PropertyData;
2717 wxString PropertyName;
2718 wxString PropertyValue;
2719 wxString PropertyTokens;
2720 bool FirstToken = TRUE;
2721 int intPrevValue = 12;
2723 if (ProcessItemData == TRUE){
2725 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2729 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2730 *wxSPropertyDataNameOut = wxT("N");
2734 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2735 intiter != SplitPoints.end(); ++intiter){
2737 SLiter = SplitLength.find(intiter->first);
2739 if (ProcessItemData == TRUE){
2741 if (FirstToken == TRUE){
2743 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2748 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2754 if (FirstToken == TRUE){
2756 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2761 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2767 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2768 PropertyName = PropertyElement.GetNextToken();
2769 PropertyValue = PropertyElement.GetNextToken();
2771 intPrevValue = intiter->second;
2773 // Process properties.
2775 // Check if there is a lock on the property value. If there is a lock then
2776 // the property value cannot be changed.
2778 if (PropertyName.IsEmpty()){
2784 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2786 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2788 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2792 PropertyDataMap->erase(PropertyName);
2793 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2801 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2802 *XVCardV4Value = TRUE;
2806 // X-VCARD4-NICKNAME
2808 if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
2810 if (ProcessItemData == TRUE){
2812 intPropertyLen = wxSPropertySeg1Chopped.Len();
2816 intPropertyLen = wxSPropertySeg1Ptr->Len();
2820 std::map<int, int> SplitPoints;
2821 std::map<int, int> SplitLength;
2822 std::map<int, int>::iterator SLiter;
2823 std::map<wxString, bool>::iterator BIter;;
2824 wxString PropertyData;
2825 wxString PropertyName;
2826 wxString PropertyValue;
2827 wxString PropertyTokens;
2828 bool FirstToken = TRUE;
2829 int intPrevValue = 19;
2831 if (ProcessItemData == TRUE){
2833 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2837 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2838 *wxSPropertyDataNameOut = wxT("NICKNAME");
2842 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2843 intiter != SplitPoints.end(); ++intiter){
2845 SLiter = SplitLength.find(intiter->first);
2847 if (ProcessItemData == TRUE){
2849 if (FirstToken == TRUE){
2851 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2856 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2862 if (FirstToken == TRUE){
2864 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2869 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2875 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2876 PropertyName = PropertyElement.GetNextToken();
2877 PropertyValue = PropertyElement.GetNextToken();
2879 intPrevValue = intiter->second;
2881 // Process properties.
2883 // Check if there is a lock on the property value. If there is a lock then
2884 // the property value cannot be changed.
2886 if (PropertyName.IsEmpty()){
2892 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
2894 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
2896 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2900 PropertyDataMap->erase(PropertyName);
2901 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
2909 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
2910 *XVCardV4Value = TRUE;
2916 if (wxSProperty == wxT("X-VCARD4-GENDER")){
2918 if (ProcessItemData == TRUE){
2920 intPropertyLen = wxSPropertySeg1Chopped.Len();
2924 intPropertyLen = wxSPropertySeg1Ptr->Len();
2928 std::map<int, int> SplitPoints;
2929 std::map<int, int> SplitLength;
2930 std::map<int, int>::iterator SLiter;
2931 std::map<wxString, bool>::iterator BIter;;
2932 wxString PropertyData;
2933 wxString PropertyName;
2934 wxString PropertyValue;
2935 wxString PropertyTokens;
2936 bool FirstToken = TRUE;
2937 int intPrevValue = 17;
2939 if (ProcessItemData == TRUE){
2941 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
2945 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
2946 *wxSPropertyDataNameOut = wxT("GENDER");
2950 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
2951 intiter != SplitPoints.end(); ++intiter){
2953 SLiter = SplitLength.find(intiter->first);
2955 if (ProcessItemData == TRUE){
2957 if (FirstToken == TRUE){
2959 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
2964 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
2970 if (FirstToken == TRUE){
2972 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
2977 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
2983 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
2984 PropertyName = PropertyElement.GetNextToken();
2985 PropertyValue = PropertyElement.GetNextToken();
2987 //ProcessCaptureStrings(&PropertyValue);
2989 intPrevValue = intiter->second;
2991 // Process properties.
2993 // Check if there is a lock on the property value. If there is a lock then
2994 // the property value cannot be changed.
2996 if (PropertyName.IsEmpty()){
3002 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3004 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3006 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3010 PropertyDataMap->erase(PropertyName);
3011 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3019 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3020 *XVCardV4Value = TRUE;
3026 if (wxSProperty == wxT("X-VCARD4-BDAY")){
3028 if (ProcessItemData == TRUE){
3030 intPropertyLen = wxSPropertySeg1Chopped.Len();
3034 intPropertyLen = wxSPropertySeg1Ptr->Len();
3038 std::map<int, int> SplitPoints;
3039 std::map<int, int> SplitLength;
3040 std::map<int, int>::iterator SLiter;
3041 std::map<wxString, bool>::iterator BIter;;
3042 wxString PropertyData;
3043 wxString PropertyName;
3044 wxString PropertyValue;
3045 wxString PropertyTokens;
3046 bool FirstToken = TRUE;
3047 int intPrevValue = 15;
3049 if (ProcessItemData == TRUE){
3051 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3055 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3056 *wxSPropertyDataNameOut = wxT("BDAY");
3060 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3061 intiter != SplitPoints.end(); ++intiter){
3063 SLiter = SplitLength.find(intiter->first);
3065 if (ProcessItemData == TRUE){
3067 if (FirstToken == TRUE){
3069 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3074 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3080 if (FirstToken == TRUE){
3082 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3087 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3093 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3094 PropertyName = PropertyElement.GetNextToken();
3095 PropertyValue = PropertyElement.GetNextToken();
3097 intPrevValue = intiter->second;
3099 // Process properties.
3101 // Check if there is a lock on the property value. If there is a lock then
3102 // the property value cannot be changed.
3104 if (PropertyName.IsEmpty()){
3110 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3112 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3114 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3118 PropertyDataMap->erase(PropertyName);
3119 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3127 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3128 *XVCardV4Value = TRUE;
3132 // X-VCARD4-ANNIVERSARY
3134 if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
3136 if (ProcessItemData == TRUE){
3138 intPropertyLen = wxSPropertySeg1Chopped.Len();
3142 intPropertyLen = wxSPropertySeg1Ptr->Len();
3146 std::map<int, int> SplitPoints;
3147 std::map<int, int> SplitLength;
3148 std::map<int, int>::iterator SLiter;
3149 std::map<wxString, bool>::iterator BIter;;
3150 wxString PropertyData;
3151 wxString PropertyName;
3152 wxString PropertyValue;
3153 wxString PropertyTokens;
3154 bool FirstToken = TRUE;
3155 int intPrevValue = 22;
3157 if (ProcessItemData == TRUE){
3159 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3163 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3164 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
3168 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3169 intiter != SplitPoints.end(); ++intiter){
3171 SLiter = SplitLength.find(intiter->first);
3173 if (ProcessItemData == TRUE){
3175 if (FirstToken == TRUE){
3177 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3182 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3188 if (FirstToken == TRUE){
3190 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3195 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3201 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3202 PropertyName = PropertyElement.GetNextToken();
3203 PropertyValue = PropertyElement.GetNextToken();
3205 intPrevValue = intiter->second;
3207 // Process properties.
3209 // Check if there is a lock on the property value. If there is a lock then
3210 // the property value cannot be changed.
3212 if (PropertyName.IsEmpty()){
3218 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3220 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3222 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3226 PropertyDataMap->erase(PropertyName);
3227 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3235 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3236 *XVCardV4Value = TRUE;
3242 if (wxSProperty == wxT("X-VCARD4-TZ")){
3244 if (ProcessItemData == TRUE){
3246 intPropertyLen = wxSPropertySeg1Chopped.Len();
3250 intPropertyLen = wxSPropertySeg1Ptr->Len();
3254 std::map<int, int> SplitPoints;
3255 std::map<int, int> SplitLength;
3256 std::map<int, int>::iterator SLiter;
3257 std::map<wxString, bool>::iterator BIter;;
3258 wxString PropertyData;
3259 wxString PropertyName;
3260 wxString PropertyValue;
3261 wxString PropertyTokens;
3262 bool FirstToken = TRUE;
3263 int intPrevValue = 13;
3265 if (ProcessItemData == TRUE){
3267 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3271 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3272 *wxSPropertyDataNameOut = wxT("TZ");
3276 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3277 intiter != SplitPoints.end(); ++intiter){
3279 SLiter = SplitLength.find(intiter->first);
3281 if (ProcessItemData == TRUE){
3283 if (FirstToken == TRUE){
3285 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3290 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3296 if (FirstToken == TRUE){
3298 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3303 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3309 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3310 PropertyName = PropertyElement.GetNextToken();
3311 PropertyValue = PropertyElement.GetNextToken();
3313 intPrevValue = intiter->second;
3315 // Process properties.
3317 // Check if there is a lock on the property value. If there is a lock then
3318 // the property value cannot be changed.
3320 if (PropertyName.IsEmpty()){
3326 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3328 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3330 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3334 PropertyDataMap->erase(PropertyName);
3335 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3343 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3344 *XVCardV4Value = TRUE;
3350 if (wxSProperty == wxT("X-VCARD4-ADR")){
3352 if (ProcessItemData == TRUE){
3354 intPropertyLen = wxSPropertySeg1Chopped.Len();
3358 intPropertyLen = wxSPropertySeg1Ptr->Len();
3362 std::map<int, int> SplitPoints;
3363 std::map<int, int> SplitLength;
3364 std::map<int, int>::iterator SLiter;
3365 std::map<wxString, bool>::iterator BIter;;
3366 wxString PropertyData;
3367 wxString PropertyName;
3368 wxString PropertyValue;
3369 wxString PropertyTokens;
3370 bool FirstToken = TRUE;
3371 int intPrevValue = 14;
3373 if (ProcessItemData == TRUE){
3375 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3379 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3380 *wxSPropertyDataNameOut = wxT("ADR");
3384 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3385 intiter != SplitPoints.end(); ++intiter){
3387 SLiter = SplitLength.find(intiter->first);
3389 if (ProcessItemData == TRUE){
3391 if (FirstToken == TRUE){
3393 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3398 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3404 if (FirstToken == TRUE){
3406 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3411 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3417 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3418 PropertyName = PropertyElement.GetNextToken();
3419 PropertyValue = PropertyElement.GetNextToken();
3421 intPrevValue = intiter->second;
3423 // Process properties.
3425 // Check if there is a lock on the property value. If there is a lock then
3426 // the property value cannot be changed.
3428 if (PropertyName.IsEmpty()){
3434 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3436 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3438 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3442 PropertyDataMap->erase(PropertyName);
3443 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3451 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3452 *XVCardV4Value = TRUE;
3458 if (wxSProperty == wxT("X-VCARD4-EMAIL")){
3460 if (ProcessItemData == TRUE){
3462 intPropertyLen = wxSPropertySeg1Chopped.Len();
3466 intPropertyLen = wxSPropertySeg1Ptr->Len();
3470 std::map<int, int> SplitPoints;
3471 std::map<int, int> SplitLength;
3472 std::map<int, int>::iterator SLiter;
3473 std::map<wxString, bool>::iterator BIter;;
3474 wxString PropertyData;
3475 wxString PropertyName;
3476 wxString PropertyValue;
3477 wxString PropertyTokens;
3478 bool FirstToken = TRUE;
3479 int intPrevValue = 16;
3481 if (ProcessItemData == TRUE){
3483 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3487 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3488 *wxSPropertyDataNameOut = wxT("EMAIL");
3492 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3493 intiter != SplitPoints.end(); ++intiter){
3495 SLiter = SplitLength.find(intiter->first);
3497 if (ProcessItemData == TRUE){
3499 if (FirstToken == TRUE){
3501 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3506 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3512 if (FirstToken == TRUE){
3514 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3519 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3525 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3526 PropertyName = PropertyElement.GetNextToken();
3527 PropertyValue = PropertyElement.GetNextToken();
3529 intPrevValue = intiter->second;
3531 // Process properties.
3533 // Check if there is a lock on the property value. If there is a lock then
3534 // the property value cannot be changed.
3536 if (PropertyName.IsEmpty()){
3542 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3544 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3546 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3550 PropertyDataMap->erase(PropertyName);
3551 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3559 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3560 *XVCardV4Value = TRUE;
3566 if (wxSProperty == wxT("X-VCARD4-IMPP")){
3568 if (ProcessItemData == TRUE){
3570 intPropertyLen = wxSPropertySeg1Chopped.Len();
3574 intPropertyLen = wxSPropertySeg1Ptr->Len();
3578 std::map<int, int> SplitPoints;
3579 std::map<int, int> SplitLength;
3580 std::map<int, int>::iterator SLiter;
3581 std::map<wxString, bool>::iterator BIter;;
3582 wxString PropertyData;
3583 wxString PropertyName;
3584 wxString PropertyValue;
3585 wxString PropertyTokens;
3586 bool FirstToken = TRUE;
3587 int intPrevValue = 15;
3589 if (ProcessItemData == TRUE){
3591 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3595 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3596 *wxSPropertyDataNameOut = wxT("IMPP");
3600 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3601 intiter != SplitPoints.end(); ++intiter){
3603 SLiter = SplitLength.find(intiter->first);
3605 if (ProcessItemData == TRUE){
3607 if (FirstToken == TRUE){
3609 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3614 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3620 if (FirstToken == TRUE){
3622 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3627 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3633 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3634 PropertyName = PropertyElement.GetNextToken();
3635 PropertyValue = PropertyElement.GetNextToken();
3637 intPrevValue = intiter->second;
3639 // Process properties.
3641 // Check if there is a lock on the property value. If there is a lock then
3642 // the property value cannot be changed.
3644 if (PropertyName.IsEmpty()){
3650 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3652 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3654 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3658 PropertyDataMap->erase(PropertyName);
3659 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3667 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3668 *XVCardV4Value = TRUE;
3674 if (wxSProperty == wxT("X-VCARD4-TEL")){
3676 if (ProcessItemData == TRUE){
3678 intPropertyLen = wxSPropertySeg1Chopped.Len();
3682 intPropertyLen = wxSPropertySeg1Ptr->Len();
3686 std::map<int, int> SplitPoints;
3687 std::map<int, int> SplitLength;
3688 std::map<int, int>::iterator SLiter;
3689 std::map<wxString, bool>::iterator BIter;;
3690 wxString PropertyData;
3691 wxString PropertyName;
3692 wxString PropertyValue;
3693 wxString PropertyTokens;
3694 bool FirstToken = TRUE;
3695 int intPrevValue = 14;
3697 if (ProcessItemData == TRUE){
3699 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3703 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3704 *wxSPropertyDataNameOut = wxT("TEL");
3708 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3709 intiter != SplitPoints.end(); ++intiter){
3711 SLiter = SplitLength.find(intiter->first);
3713 if (ProcessItemData == TRUE){
3715 if (FirstToken == TRUE){
3717 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3722 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3728 if (FirstToken == TRUE){
3730 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3735 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3741 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3742 PropertyName = PropertyElement.GetNextToken();
3743 PropertyValue = PropertyElement.GetNextToken();
3745 intPrevValue = intiter->second;
3747 // Process properties.
3749 // Check if there is a lock on the property value. If there is a lock then
3750 // the property value cannot be changed.
3752 if (PropertyName.IsEmpty()){
3758 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3760 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3762 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3766 PropertyDataMap->erase(PropertyName);
3767 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3775 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3776 *XVCardV4Value = TRUE;
3782 if (wxSProperty == wxT("X-VCARD4-LANG")){
3784 if (ProcessItemData == TRUE){
3786 intPropertyLen = wxSPropertySeg1Chopped.Len();
3790 intPropertyLen = wxSPropertySeg1Ptr->Len();
3794 std::map<int, int> SplitPoints;
3795 std::map<int, int> SplitLength;
3796 std::map<int, int>::iterator SLiter;
3797 std::map<wxString, bool>::iterator BIter;;
3798 wxString PropertyData;
3799 wxString PropertyName;
3800 wxString PropertyValue;
3801 wxString PropertyTokens;
3802 bool FirstToken = TRUE;
3803 int intPrevValue = 15;
3805 if (ProcessItemData == TRUE){
3807 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3811 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3812 *wxSPropertyDataNameOut = wxT("LANG");
3816 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3817 intiter != SplitPoints.end(); ++intiter){
3819 SLiter = SplitLength.find(intiter->first);
3821 if (ProcessItemData == TRUE){
3823 if (FirstToken == TRUE){
3825 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3830 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3836 if (FirstToken == TRUE){
3838 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3843 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3849 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3850 PropertyName = PropertyElement.GetNextToken();
3851 PropertyValue = PropertyElement.GetNextToken();
3853 intPrevValue = intiter->second;
3855 // Process properties.
3857 // Check if there is a lock on the property value. If there is a lock then
3858 // the property value cannot be changed.
3860 if (PropertyName.IsEmpty()){
3866 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3868 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3870 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3874 PropertyDataMap->erase(PropertyName);
3875 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3883 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3884 *XVCardV4Value = TRUE;
3890 if (wxSProperty == wxT("X-VCARD4-GEO")){
3892 if (ProcessItemData == TRUE){
3894 intPropertyLen = wxSPropertySeg1Chopped.Len();
3898 intPropertyLen = wxSPropertySeg1Ptr->Len();
3902 std::map<int, int> SplitPoints;
3903 std::map<int, int> SplitLength;
3904 std::map<int, int>::iterator SLiter;
3905 std::map<wxString, bool>::iterator BIter;;
3906 wxString PropertyData;
3907 wxString PropertyName;
3908 wxString PropertyValue;
3909 wxString PropertyTokens;
3910 bool FirstToken = TRUE;
3911 int intPrevValue = 14;
3913 if (ProcessItemData == TRUE){
3915 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3919 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3920 *wxSPropertyDataNameOut = wxT("GEO");
3924 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3925 intiter != SplitPoints.end(); ++intiter){
3927 SLiter = SplitLength.find(intiter->first);
3929 if (ProcessItemData == TRUE){
3931 if (FirstToken == TRUE){
3933 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3938 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3944 if (FirstToken == TRUE){
3946 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3951 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3957 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3958 PropertyName = PropertyElement.GetNextToken();
3959 PropertyValue = PropertyElement.GetNextToken();
3961 intPrevValue = intiter->second;
3963 // Process properties.
3965 // Check if there is a lock on the property value. If there is a lock then
3966 // the property value cannot be changed.
3968 if (PropertyName.IsEmpty()){
3974 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
3976 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3978 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3982 PropertyDataMap->erase(PropertyName);
3983 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3991 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
3992 *XVCardV4Value = TRUE;
3998 if (wxSProperty == wxT("X-VCARD4-RELATED")){
4000 if (ProcessItemData == TRUE){
4002 intPropertyLen = wxSPropertySeg1Chopped.Len();
4006 intPropertyLen = wxSPropertySeg1Ptr->Len();
4010 std::map<int, int> SplitPoints;
4011 std::map<int, int> SplitLength;
4012 std::map<int, int>::iterator SLiter;
4013 std::map<wxString, bool>::iterator BIter;;
4014 wxString PropertyData;
4015 wxString PropertyName;
4016 wxString PropertyValue;
4017 wxString PropertyTokens;
4018 bool FirstToken = TRUE;
4019 int intPrevValue = 18;
4021 if (ProcessItemData == TRUE){
4023 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4027 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4028 *wxSPropertyDataNameOut = wxT("RELATED");
4032 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4033 intiter != SplitPoints.end(); ++intiter){
4035 SLiter = SplitLength.find(intiter->first);
4037 if (ProcessItemData == TRUE){
4039 if (FirstToken == TRUE){
4041 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4046 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4052 if (FirstToken == TRUE){
4054 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4059 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4065 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4066 PropertyName = PropertyElement.GetNextToken();
4067 PropertyValue = PropertyElement.GetNextToken();
4069 intPrevValue = intiter->second;
4071 // Process properties.
4073 // Check if there is a lock on the property value. If there is a lock then
4074 // the property value cannot be changed.
4076 if (PropertyName.IsEmpty()){
4082 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4084 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4086 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4090 PropertyDataMap->erase(PropertyName);
4091 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4099 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4100 *XVCardV4Value = TRUE;
4106 if (wxSProperty == wxT("X-VCARD4-URL")){
4108 if (ProcessItemData == TRUE){
4110 intPropertyLen = wxSPropertySeg1Chopped.Len();
4114 intPropertyLen = wxSPropertySeg1Ptr->Len();
4118 std::map<int, int> SplitPoints;
4119 std::map<int, int> SplitLength;
4120 std::map<int, int>::iterator SLiter;
4121 std::map<wxString, bool>::iterator BIter;;
4122 wxString PropertyData;
4123 wxString PropertyName;
4124 wxString PropertyValue;
4125 wxString PropertyTokens;
4126 bool FirstToken = TRUE;
4127 int intPrevValue = 14;
4129 if (ProcessItemData == TRUE){
4131 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4135 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4136 *wxSPropertyDataNameOut = wxT("URL");
4140 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4141 intiter != SplitPoints.end(); ++intiter){
4143 SLiter = SplitLength.find(intiter->first);
4145 if (ProcessItemData == TRUE){
4147 if (FirstToken == TRUE){
4149 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4154 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4160 if (FirstToken == TRUE){
4162 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4167 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4173 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4174 PropertyName = PropertyElement.GetNextToken();
4175 PropertyValue = PropertyElement.GetNextToken();
4177 intPrevValue = intiter->second;
4179 // Process properties.
4181 // Check if there is a lock on the property value. If there is a lock then
4182 // the property value cannot be changed.
4184 if (PropertyName.IsEmpty()){
4190 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4192 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4194 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4198 PropertyDataMap->erase(PropertyName);
4199 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4207 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4208 *XVCardV4Value = TRUE;
4214 if (wxSProperty == wxT("X-VCARD4-TITLE")){
4216 if (ProcessItemData == TRUE){
4218 intPropertyLen = wxSPropertySeg1Chopped.Len();
4222 intPropertyLen = wxSPropertySeg1Ptr->Len();
4226 std::map<int, int> SplitPoints;
4227 std::map<int, int> SplitLength;
4228 std::map<int, int>::iterator SLiter;
4229 std::map<wxString, bool>::iterator BIter;;
4230 wxString PropertyData;
4231 wxString PropertyName;
4232 wxString PropertyValue;
4233 wxString PropertyTokens;
4234 bool FirstToken = TRUE;
4235 int intPrevValue = 16;
4237 if (ProcessItemData == TRUE){
4239 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4243 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4244 *wxSPropertyDataNameOut = wxT("TITLE");
4248 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4249 intiter != SplitPoints.end(); ++intiter){
4251 SLiter = SplitLength.find(intiter->first);
4253 if (ProcessItemData == TRUE){
4255 if (FirstToken == TRUE){
4257 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4262 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4268 if (FirstToken == TRUE){
4270 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4275 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4281 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4282 PropertyName = PropertyElement.GetNextToken();
4283 PropertyValue = PropertyElement.GetNextToken();
4285 intPrevValue = intiter->second;
4287 // Process properties.
4289 // Check if there is a lock on the property value. If there is a lock then
4290 // the property value cannot be changed.
4292 if (PropertyName.IsEmpty()){
4298 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4300 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4302 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4306 PropertyDataMap->erase(PropertyName);
4307 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4315 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4316 *XVCardV4Value = TRUE;
4322 if (wxSProperty == wxT("X-VCARD4-ROLE")){
4324 if (ProcessItemData == TRUE){
4326 intPropertyLen = wxSPropertySeg1Chopped.Len();
4330 intPropertyLen = wxSPropertySeg1Ptr->Len();
4334 std::map<int, int> SplitPoints;
4335 std::map<int, int> SplitLength;
4336 std::map<int, int>::iterator SLiter;
4337 std::map<wxString, bool>::iterator BIter;;
4338 wxString PropertyData;
4339 wxString PropertyName;
4340 wxString PropertyValue;
4341 wxString PropertyTokens;
4342 bool FirstToken = TRUE;
4343 int intPrevValue = 15;
4345 if (ProcessItemData == TRUE){
4347 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4351 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4352 *wxSPropertyDataNameOut = wxT("ROLE");
4356 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4357 intiter != SplitPoints.end(); ++intiter){
4359 SLiter = SplitLength.find(intiter->first);
4361 if (ProcessItemData == TRUE){
4363 if (FirstToken == TRUE){
4365 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4370 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4376 if (FirstToken == TRUE){
4378 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4383 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4389 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4390 PropertyName = PropertyElement.GetNextToken();
4391 PropertyValue = PropertyElement.GetNextToken();
4393 intPrevValue = intiter->second;
4395 // Process properties.
4397 // Check if there is a lock on the property value. If there is a lock then
4398 // the property value cannot be changed.
4400 if (PropertyName.IsEmpty()){
4406 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4408 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4410 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4414 PropertyDataMap->erase(PropertyName);
4415 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4423 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4424 *XVCardV4Value = TRUE;
4430 if (wxSProperty == wxT("X-VCARD4-ORG")){
4432 if (ProcessItemData == TRUE){
4434 intPropertyLen = wxSPropertySeg1Chopped.Len();
4438 intPropertyLen = wxSPropertySeg1Ptr->Len();
4442 std::map<int, int> SplitPoints;
4443 std::map<int, int> SplitLength;
4444 std::map<int, int>::iterator SLiter;
4445 std::map<wxString, bool>::iterator BIter;;
4446 wxString PropertyData;
4447 wxString PropertyName;
4448 wxString PropertyValue;
4449 wxString PropertyTokens;
4450 bool FirstToken = TRUE;
4451 int intPrevValue = 14;
4453 if (ProcessItemData == TRUE){
4455 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4459 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4460 *wxSPropertyDataNameOut = wxT("ORG");
4464 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4465 intiter != SplitPoints.end(); ++intiter){
4467 SLiter = SplitLength.find(intiter->first);
4469 if (ProcessItemData == TRUE){
4471 if (FirstToken == TRUE){
4473 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4478 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4484 if (FirstToken == TRUE){
4486 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4491 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4497 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4498 PropertyName = PropertyElement.GetNextToken();
4499 PropertyValue = PropertyElement.GetNextToken();
4501 intPrevValue = intiter->second;
4503 // Process properties.
4505 // Check if there is a lock on the property value. If there is a lock then
4506 // the property value cannot be changed.
4508 if (PropertyName.IsEmpty()){
4514 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4516 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4518 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4522 PropertyDataMap->erase(PropertyName);
4523 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4531 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4532 *XVCardV4Value = TRUE;
4538 if (wxSProperty == wxT("X-VCARD4-NOTE")){
4540 if (ProcessItemData == TRUE){
4542 intPropertyLen = wxSPropertySeg1Chopped.Len();
4546 intPropertyLen = wxSPropertySeg1Ptr->Len();
4550 std::map<int, int> SplitPoints;
4551 std::map<int, int> SplitLength;
4552 std::map<int, int>::iterator SLiter;
4553 std::map<wxString, bool>::iterator BIter;;
4554 wxString PropertyData;
4555 wxString PropertyName;
4556 wxString PropertyValue;
4557 wxString PropertyTokens;
4558 bool FirstToken = TRUE;
4559 int intPrevValue = 15;
4561 if (ProcessItemData == TRUE){
4563 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4567 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4568 *wxSPropertyDataNameOut = wxT("NOTE");
4572 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4573 intiter != SplitPoints.end(); ++intiter){
4575 SLiter = SplitLength.find(intiter->first);
4577 if (ProcessItemData == TRUE){
4579 if (FirstToken == TRUE){
4581 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4586 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4592 if (FirstToken == TRUE){
4594 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4599 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4605 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4606 PropertyName = PropertyElement.GetNextToken();
4607 PropertyValue = PropertyElement.GetNextToken();
4609 intPrevValue = intiter->second;
4611 // Process properties.
4613 // Check if there is a lock on the property value. If there is a lock then
4614 // the property value cannot be changed.
4616 if (PropertyName.IsEmpty()){
4622 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4624 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4626 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4630 PropertyDataMap->erase(PropertyName);
4631 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4639 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4640 *XVCardV4Value = TRUE;
4644 // X-VCARD4-CATEGORIES
4646 if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
4648 if (ProcessItemData == TRUE){
4650 intPropertyLen = wxSPropertySeg1Chopped.Len();
4654 intPropertyLen = wxSPropertySeg1Ptr->Len();
4658 std::map<int, int> SplitPoints;
4659 std::map<int, int> SplitLength;
4660 std::map<int, int>::iterator SLiter;
4661 std::map<wxString, bool>::iterator BIter;;
4662 wxString PropertyData;
4663 wxString PropertyName;
4664 wxString PropertyValue;
4665 wxString PropertyTokens;
4666 bool FirstToken = TRUE;
4667 int intPrevValue = 21;
4669 if (ProcessItemData == TRUE){
4671 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4675 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4676 *wxSPropertyDataNameOut = wxT("CATEGORIES");
4680 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4681 intiter != SplitPoints.end(); ++intiter){
4683 SLiter = SplitLength.find(intiter->first);
4685 if (ProcessItemData == TRUE){
4687 if (FirstToken == TRUE){
4689 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4694 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4700 if (FirstToken == TRUE){
4702 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4707 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4713 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4714 PropertyName = PropertyElement.GetNextToken();
4715 PropertyValue = PropertyElement.GetNextToken();
4717 intPrevValue = intiter->second;
4719 // Process properties.
4721 // Check if there is a lock on the property value. If there is a lock then
4722 // the property value cannot be changed.
4724 if (PropertyName.IsEmpty()){
4730 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4732 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4734 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4738 PropertyDataMap->erase(PropertyName);
4739 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4747 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4748 *XVCardV4Value = TRUE;
4754 if (wxSProperty == wxT("X-VCARD4-PHOTO")){
4756 if (ProcessItemData == TRUE){
4758 intPropertyLen = wxSPropertySeg1Chopped.Len();
4762 intPropertyLen = wxSPropertySeg1Ptr->Len();
4766 std::map<int, int> SplitPoints;
4767 std::map<int, int> SplitLength;
4768 std::map<int, int>::iterator SLiter;
4769 std::map<wxString, bool>::iterator BIter;;
4770 wxString PropertyData;
4771 wxString PropertyName;
4772 wxString PropertyValue;
4773 wxString PropertyTokens;
4774 bool FirstToken = TRUE;
4775 int intPrevValue = 16;
4777 if (ProcessItemData == TRUE){
4779 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4783 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4784 *wxSPropertyDataNameOut = wxT("PHOTO");
4788 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4789 intiter != SplitPoints.end(); ++intiter){
4791 SLiter = SplitLength.find(intiter->first);
4793 if (ProcessItemData == TRUE){
4795 if (FirstToken == TRUE){
4797 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4802 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4808 if (FirstToken == TRUE){
4810 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4815 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4821 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4822 PropertyName = PropertyElement.GetNextToken();
4823 PropertyValue = PropertyElement.GetNextToken();
4825 intPrevValue = intiter->second;
4827 // Process properties.
4829 // Check if there is a lock on the property value. If there is a lock then
4830 // the property value cannot be changed.
4832 if (PropertyName.IsEmpty()){
4838 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4840 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4842 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4846 PropertyDataMap->erase(PropertyName);
4847 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4855 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4856 *XVCardV4Value = TRUE;
4862 if (wxSProperty == wxT("X-VCARD4-LOGO")){
4864 if (ProcessItemData == TRUE){
4866 intPropertyLen = wxSPropertySeg1Chopped.Len();
4870 intPropertyLen = wxSPropertySeg1Ptr->Len();
4874 std::map<int, int> SplitPoints;
4875 std::map<int, int> SplitLength;
4876 std::map<int, int>::iterator SLiter;
4877 std::map<wxString, bool>::iterator BIter;;
4878 wxString PropertyData;
4879 wxString PropertyName;
4880 wxString PropertyValue;
4881 wxString PropertyTokens;
4882 bool FirstToken = TRUE;
4883 int intPrevValue = 15;
4885 if (ProcessItemData == TRUE){
4887 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4891 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4892 *wxSPropertyDataNameOut = wxT("LOGO");
4896 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4897 intiter != SplitPoints.end(); ++intiter){
4899 SLiter = SplitLength.find(intiter->first);
4901 if (ProcessItemData == TRUE){
4903 if (FirstToken == TRUE){
4905 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4910 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4916 if (FirstToken == TRUE){
4918 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4923 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4929 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4930 PropertyName = PropertyElement.GetNextToken();
4931 PropertyValue = PropertyElement.GetNextToken();
4933 intPrevValue = intiter->second;
4935 // Process properties.
4937 // Check if there is a lock on the property value. If there is a lock then
4938 // the property value cannot be changed.
4940 if (PropertyName.IsEmpty()){
4946 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
4948 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4950 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4954 PropertyDataMap->erase(PropertyName);
4955 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4963 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
4964 *XVCardV4Value = TRUE;
4970 if (wxSProperty == wxT("X-VCARD4-SOUND")){
4972 if (ProcessItemData == TRUE){
4974 intPropertyLen = wxSPropertySeg1Chopped.Len();
4978 intPropertyLen = wxSPropertySeg1Ptr->Len();
4982 std::map<int, int> SplitPoints;
4983 std::map<int, int> SplitLength;
4984 std::map<int, int>::iterator SLiter;
4985 std::map<wxString, bool>::iterator BIter;;
4986 wxString PropertyData;
4987 wxString PropertyName;
4988 wxString PropertyValue;
4989 wxString PropertyTokens;
4990 bool FirstToken = TRUE;
4991 int intPrevValue = 16;
4993 if (ProcessItemData == TRUE){
4995 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4999 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5000 *wxSPropertyDataNameOut = wxT("SOUND");
5004 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5005 intiter != SplitPoints.end(); ++intiter){
5007 SLiter = SplitLength.find(intiter->first);
5009 if (ProcessItemData == TRUE){
5011 if (FirstToken == TRUE){
5013 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5018 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5024 if (FirstToken == TRUE){
5026 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5031 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5037 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5038 PropertyName = PropertyElement.GetNextToken();
5039 PropertyValue = PropertyElement.GetNextToken();
5041 intPrevValue = intiter->second;
5043 // Process properties.
5045 // Check if there is a lock on the property value. If there is a lock then
5046 // the property value cannot be changed.
5048 if (PropertyName.IsEmpty()){
5054 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5056 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5058 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5062 PropertyDataMap->erase(PropertyName);
5063 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5071 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5072 *XVCardV4Value = TRUE;
5078 if (wxSProperty == wxT("X-VCARD4-CALURI")){
5080 if (ProcessItemData == TRUE){
5082 intPropertyLen = wxSPropertySeg1Chopped.Len();
5086 intPropertyLen = wxSPropertySeg1Ptr->Len();
5090 std::map<int, int> SplitPoints;
5091 std::map<int, int> SplitLength;
5092 std::map<int, int>::iterator SLiter;
5093 std::map<wxString, bool>::iterator BIter;;
5094 wxString PropertyData;
5095 wxString PropertyName;
5096 wxString PropertyValue;
5097 wxString PropertyTokens;
5098 bool FirstToken = TRUE;
5099 int intPrevValue = 17;
5101 if (ProcessItemData == TRUE){
5103 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5107 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5108 *wxSPropertyDataNameOut = wxT("CALURI");
5112 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5113 intiter != SplitPoints.end(); ++intiter){
5115 SLiter = SplitLength.find(intiter->first);
5117 if (ProcessItemData == TRUE){
5119 if (FirstToken == TRUE){
5121 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5126 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5132 if (FirstToken == TRUE){
5134 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5139 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5145 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5146 PropertyName = PropertyElement.GetNextToken();
5147 PropertyValue = PropertyElement.GetNextToken();
5149 intPrevValue = intiter->second;
5151 // Process properties.
5153 // Check if there is a lock on the property value. If there is a lock then
5154 // the property value cannot be changed.
5156 if (PropertyName.IsEmpty()){
5162 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5164 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5166 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5170 PropertyDataMap->erase(PropertyName);
5171 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5179 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5180 *XVCardV4Value = TRUE;
5184 // X-VCARD4-CALADRURI
5186 if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
5188 if (ProcessItemData == TRUE){
5190 intPropertyLen = wxSPropertySeg1Chopped.Len();
5194 intPropertyLen = wxSPropertySeg1Ptr->Len();
5198 std::map<int, int> SplitPoints;
5199 std::map<int, int> SplitLength;
5200 std::map<int, int>::iterator SLiter;
5201 std::map<wxString, bool>::iterator BIter;;
5202 wxString PropertyData;
5203 wxString PropertyName;
5204 wxString PropertyValue;
5205 wxString PropertyTokens;
5206 bool FirstToken = TRUE;
5207 int intPrevValue = 20;
5209 if (ProcessItemData == TRUE){
5211 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5215 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5216 *wxSPropertyDataNameOut = wxT("CALADRURI");
5220 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5221 intiter != SplitPoints.end(); ++intiter){
5223 SLiter = SplitLength.find(intiter->first);
5225 if (ProcessItemData == TRUE){
5227 if (FirstToken == TRUE){
5229 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5234 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5240 if (FirstToken == TRUE){
5242 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5247 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5253 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5254 PropertyName = PropertyElement.GetNextToken();
5255 PropertyValue = PropertyElement.GetNextToken();
5257 intPrevValue = intiter->second;
5259 // Process properties.
5261 // Check if there is a lock on the property value. If there is a lock then
5262 // the property value cannot be changed.
5264 if (PropertyName.IsEmpty()){
5270 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5272 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5274 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5278 PropertyDataMap->erase(PropertyName);
5279 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5287 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5288 *XVCardV4Value = TRUE;
5294 if (wxSProperty == wxT("X-VCARD4-FBURL")){
5296 if (ProcessItemData == TRUE){
5298 intPropertyLen = wxSPropertySeg1Chopped.Len();
5302 intPropertyLen = wxSPropertySeg1Ptr->Len();
5306 std::map<int, int> SplitPoints;
5307 std::map<int, int> SplitLength;
5308 std::map<int, int>::iterator SLiter;
5309 std::map<wxString, bool>::iterator BIter;;
5310 wxString PropertyData;
5311 wxString PropertyName;
5312 wxString PropertyValue;
5313 wxString PropertyTokens;
5314 bool FirstToken = TRUE;
5315 int intPrevValue = 16;
5317 if (ProcessItemData == TRUE){
5319 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5323 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5324 *wxSPropertyDataNameOut = wxT("FBURL");
5328 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5329 intiter != SplitPoints.end(); ++intiter){
5331 SLiter = SplitLength.find(intiter->first);
5333 if (ProcessItemData == TRUE){
5335 if (FirstToken == TRUE){
5337 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5342 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5348 if (FirstToken == TRUE){
5350 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5355 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5361 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5362 PropertyName = PropertyElement.GetNextToken();
5363 PropertyValue = PropertyElement.GetNextToken();
5365 intPrevValue = intiter->second;
5367 // Process properties.
5369 // Check if there is a lock on the property value. If there is a lock then
5370 // the property value cannot be changed.
5372 if (PropertyName.IsEmpty()){
5378 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5380 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5382 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5386 PropertyDataMap->erase(PropertyName);
5387 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5395 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5396 *XVCardV4Value = TRUE;
5402 if (wxSProperty == wxT("X-VCARD4-KEY")){
5404 if (ProcessItemData == TRUE){
5406 intPropertyLen = wxSPropertySeg1Chopped.Len();
5410 intPropertyLen = wxSPropertySeg1Ptr->Len();
5414 std::map<int, int> SplitPoints;
5415 std::map<int, int> SplitLength;
5416 std::map<int, int>::iterator SLiter;
5417 std::map<wxString, bool>::iterator BIter;;
5418 wxString PropertyData;
5419 wxString PropertyName;
5420 wxString PropertyValue;
5421 wxString PropertyTokens;
5422 bool FirstToken = TRUE;
5423 int intPrevValue = 14;
5425 if (ProcessItemData == TRUE){
5427 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5431 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5432 *wxSPropertyDataNameOut = wxT("KEY");
5436 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5437 intiter != SplitPoints.end(); ++intiter){
5439 SLiter = SplitLength.find(intiter->first);
5441 if (ProcessItemData == TRUE){
5443 if (FirstToken == TRUE){
5445 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5450 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5456 if (FirstToken == TRUE){
5458 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5463 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5469 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5470 PropertyName = PropertyElement.GetNextToken();
5471 PropertyValue = PropertyElement.GetNextToken();
5473 intPrevValue = intiter->second;
5475 // Process properties.
5477 // Check if there is a lock on the property value. If there is a lock then
5478 // the property value cannot be changed.
5480 if (PropertyName.IsEmpty()){
5486 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5488 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5490 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5494 PropertyDataMap->erase(PropertyName);
5495 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5503 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5504 *XVCardV4Value = TRUE;
5510 if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
5512 if (ProcessItemData == TRUE){
5514 intPropertyLen = wxSPropertySeg1Chopped.Len();
5518 intPropertyLen = wxSPropertySeg1Ptr->Len();
5522 std::map<int, int> SplitPoints;
5523 std::map<int, int> SplitLength;
5524 std::map<int, int>::iterator SLiter;
5525 std::map<wxString, bool>::iterator BIter;;
5526 wxString PropertyData;
5527 wxString PropertyName;
5528 wxString PropertyValue;
5529 wxString PropertyTokens;
5530 bool FirstToken = TRUE;
5531 int intPrevValue = 14;
5533 if (ProcessItemData == TRUE){
5535 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5539 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5540 *wxSPropertyDataNameOut = wxSProperty.Mid(9);
5544 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5545 intiter != SplitPoints.end(); ++intiter){
5547 SLiter = SplitLength.find(intiter->first);
5549 if (ProcessItemData == TRUE){
5551 if (FirstToken == TRUE){
5553 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5558 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5564 if (FirstToken == TRUE){
5566 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5571 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5577 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5578 PropertyName = PropertyElement.GetNextToken();
5579 PropertyValue = PropertyElement.GetNextToken();
5581 intPrevValue = intiter->second;
5583 // Process properties.
5585 // Check if there is a lock on the property value. If there is a lock then
5586 // the property value cannot be changed.
5588 if (PropertyName.IsEmpty()){
5594 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5596 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5598 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5602 PropertyDataMap->erase(PropertyName);
5603 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5611 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5612 *XVCardV4Value = TRUE;
5616 // X-ADDRESSBOOKSERVER-KIND
5618 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
5622 if (ProcessItemData == TRUE){
5624 intPropertyLen = wxSPropertySeg1Chopped.Len();
5628 intPropertyLen = wxSPropertySeg1Ptr->Len();
5632 std::map<int, int> SplitPoints;
5633 std::map<int, int> SplitLength;
5634 std::map<int, int>::iterator SLiter;
5635 std::map<wxString, bool>::iterator BIter;;
5636 wxString PropertyData;
5637 wxString PropertyName;
5638 wxString PropertyValue;
5639 wxString PropertyTokens;
5640 bool FirstToken = TRUE;
5641 int intPrevValue = 26;
5643 if (ProcessItemData == TRUE){
5645 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5649 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5653 *wxSPropertyDataNameOut = wxT("KIND");
5655 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5656 intiter != SplitPoints.end(); ++intiter){
5658 SLiter = SplitLength.find(intiter->first);
5660 if (ProcessItemData == TRUE){
5662 if (FirstToken == TRUE){
5664 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5669 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5675 if (FirstToken == TRUE){
5677 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5682 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5688 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5689 PropertyName = PropertyElement.GetNextToken();
5690 PropertyValue = PropertyElement.GetNextToken();
5692 intPrevValue = intiter->second;
5694 // Process properties.
5696 // Check if there is a lock on the property value. If there is a lock then
5697 // the property value cannot be changed.
5699 if (PropertyName.IsEmpty()){
5705 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5707 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5709 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5713 PropertyDataMap->erase(PropertyName);
5714 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5722 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5723 *XVCardV4Value = TRUE;
5727 // X-ADDRESSBOOKSERVER-MEMBER
5729 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
5733 if (ProcessItemData == TRUE){
5735 intPropertyLen = wxSPropertySeg1Chopped.Len();
5739 intPropertyLen = wxSPropertySeg1Ptr->Len();
5743 std::map<int, int> SplitPoints;
5744 std::map<int, int> SplitLength;
5745 std::map<int, int>::iterator SLiter;
5746 std::map<wxString, bool>::iterator BIter;;
5747 wxString PropertyData;
5748 wxString PropertyName;
5749 wxString PropertyValue;
5750 wxString PropertyTokens;
5751 bool FirstToken = TRUE;
5752 int intPrevValue = 28;
5754 if (ProcessItemData == TRUE){
5756 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5760 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5764 *wxSPropertyDataNameOut = wxT("MEMBER");
5766 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5767 intiter != SplitPoints.end(); ++intiter){
5769 SLiter = SplitLength.find(intiter->first);
5771 if (ProcessItemData == TRUE){
5773 if (FirstToken == TRUE){
5775 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5780 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5786 if (FirstToken == TRUE){
5788 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5793 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5799 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5800 PropertyName = PropertyElement.GetNextToken();
5801 PropertyValue = PropertyElement.GetNextToken();
5803 intPrevValue = intiter->second;
5805 // Process properties.
5807 // Check if there is a lock on the property value. If there is a lock then
5808 // the property value cannot be changed.
5810 if (PropertyName.IsEmpty()){
5816 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5818 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5820 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5824 PropertyDataMap->erase(PropertyName);
5825 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5833 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5834 *XVCardV4Value = TRUE;
5839 // Deal with X-ABLabel specifically.
5841 if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
5843 intPropertyLen = wxSPropertySeg1Ptr->Len();
5844 std::map<int, int> SplitPoints;
5845 std::map<int, int> SplitLength;
5846 std::map<int, int>::iterator SLiter;
5847 wxString PropertyData;
5848 wxString PropertyName;
5849 wxString PropertyValue;
5850 wxString PropertyTokens;
5851 int intPrevValue = 11;
5853 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5855 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
5861 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
5863 CaptureString(strCapture, FALSE);
5867 void vCard34Conv::SplitValues(wxString *PropertyLine,
5868 std::map<int,int> *SplitPoints,
5869 std::map<int,int> *SplitLength,
5872 size_t intPropertyLen = PropertyLine->Len();
5873 int intSplitsFound = 0;
5874 int intSplitSize = 0;
5875 int intSplitSeek = 0;
5877 for (int i = intSize; i <= intPropertyLen; i++){
5881 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5882 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5884 if (intSplitsFound == 0){
5886 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5890 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5894 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
5904 if (intSplitsFound == 0){
5906 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
5907 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5911 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
5912 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5918 void vCard34Conv::SplitValuesData(wxString *PropertyLine,
5919 std::map<int,int> *SplitPoints,
5920 std::map<int,int> *SplitLength,
5922 std::map<wxString,wxString> *SplitData){
5925 wxStringTokenizer PropertyElement;
5926 wxString PropertyName;
5927 wxString PropertyValue;
5928 size_t intPropertyLen = PropertyLine->Len();
5929 int intSplitsFound = 0;
5930 int intSplitSize = 0;
5931 int intSplitSeek = (intSize - 1);
5933 for (int i = intSize; i <= intPropertyLen; i++){
5937 if (PropertyLine->Mid(i, 1) == wxT(";") &&
5938 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
5940 if (intSplitsFound == 0){
5942 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
5943 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
5947 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
5948 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
5952 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
5955 intSplitSeek = (i + 1);
5958 if (!DataStr.IsEmpty()){
5960 PropertyElement.SetString(DataStr, wxT("="));
5961 PropertyName = PropertyElement.GetNextToken();
5962 PropertyValue = PropertyElement.GetNextToken();
5963 SplitData->insert(std::make_pair(PropertyName, PropertyValue));
5968 PropertyName.clear();
5969 PropertyValue.clear();
5975 if (intSplitsFound == 0){
5977 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
5979 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
5980 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5984 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
5986 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
5987 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
5991 if (!DataStr.IsEmpty()){
5993 PropertyElement.SetString(DataStr, wxT("="));
5994 PropertyName = PropertyElement.GetNextToken();
5995 PropertyValue = PropertyElement.GetNextToken();
5996 SplitData->insert(std::make_pair(PropertyName, PropertyValue));