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 bool vCard34Conv::ConvertToV3(wxString Filename, wxString *wxSData){
30 // Load the contact into the contact editor.
33 wxString wxSContactString;
39 //wxSContactFilename = Filename;
41 // Check if we are using wxWidgets version 2.8 or less and
42 // execute the required command accordingly.
44 #if wxABI_VERSION < 20900
45 ContactFile.Open(Filename.c_str(), wxT("r"));
47 ContactFile.Open(Filename, wxT("r"));
50 if (ContactFile.IsOpened() == FALSE){
56 ContactFile.ReadAll(&wxSContactString, wxConvAuto());
60 std::map<int, wxString> ContactFileLines;
61 std::map<int, wxString>::iterator striter;
63 wxStringTokenizer wSTContactFileLines(wxSContactString, wxT("\r\n"));
65 int ContactLineSeek = 0;
67 while (wSTContactFileLines.HasMoreTokens() == TRUE){
69 ContactLine = wSTContactFileLines.GetNextToken();
70 ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLine));
77 bool QuoteMode = FALSE;
78 bool PropertyFind = TRUE;
79 bool HasExtraNicknames = FALSE;
80 bool IgnoreGender = FALSE;
81 bool ExtraLineSeek = TRUE;
82 bool BirthdayProcessed = FALSE;
83 bool AnniversaryProcessed = FALSE;
84 bool FNProcessed = FALSE;
85 bool GenderProcessed = FALSE;
86 bool NameProcessed = FALSE;
87 bool KindProcessed = FALSE;
89 bool NicknameFirst = FALSE;
90 bool TitleFirst = FALSE;
91 bool OrganisationFirst = FALSE;
92 bool NoteFirst = FALSE;
93 bool PhotoFirst = FALSE;
94 bool LogoFirst = FALSE;
95 int intExtraNickname = 0;
97 wxString wxSPropertySeg1;
98 wxString wxSPropertySeg2;
99 wxString wxSPropertyNextLine;
100 int ContactLineLen = 0;
101 int QuoteBreakPoint = 0;
104 int NicknameCount = 0;
113 int RelatedCount = 0;
118 int CategoryCount = 0;
123 int CalReqAdrCount = 0;
124 int FreeBusyCount = 0;
129 //int intValueSeek = 1;
133 // Setup the version string.
135 strVer.Append(wxT("-//Xestia//Address Book Version "));
136 strVer.Append(wxT(XSDAB_VERSION));
137 strVer.Append(wxT("//KW"));
139 ContactDatav3.AddRaw(wxT("BEGIN"), wxT("VCARD"));
140 ContactDatav3.AddRaw(wxT("VERSION"), wxT("3.0"));
141 ContactDatav3.AddRaw(wxT("PRODID"), strVer);
143 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
144 iter != ContactFileLines.end(); ++iter){
146 // Find the colon which splits the start bit from the data part.
148 ContactLine = iter->second;
150 while (ExtraLineSeek == TRUE){
152 // Check if there is extra data on the next line
153 // (indicated by space or tab at the start) and add data.
157 if (iter == ContactFileLines.end()){
164 wxSPropertyNextLine = iter->second;
167 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
169 wxSPropertyNextLine.Remove(0, 1);
170 //wxSPropertyNextLine.Trim(FALSE);
171 //ContactLine.Trim();
172 ContactLine.Append(wxSPropertyNextLine);
177 ExtraLineSeek = FALSE;
183 ContactLineLen = ContactLine.Len();
185 // Make sure we are not in quotation mode.
186 // Make sure colon does not have \ or \\ before it.
190 for (int i = 0; i <= ContactLineLen; i++){
192 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
194 PropertyFind = FALSE;
196 } else if (PropertyFind == TRUE){
198 wxSProperty.Append(ContactLine.Mid(i, 1));
202 if (ContactLine.Mid(i, 1) == wxT("\"")){
204 if (QuoteMode == TRUE){
216 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
225 // Split that line at the point into two variables (ignore the colon).
227 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
228 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
230 // Add the data into the contact editor depending on what it is.
232 if (wxSProperty == wxT("FN")){
234 int intPropertyLen = wxSPropertySeg1.Len();
235 std::map<int, int> SplitPoints;
236 std::map<int, int> SplitLength;
237 std::map<int, int>::iterator SLiter;
238 wxString PropertyData;
239 wxString PropertyName;
240 wxString PropertyValue;
241 wxString PropertyTokens;
242 bool AfterFirstToken = FALSE;
243 bool FirstToken = TRUE;
244 int intSplitsFound = 0;
245 int intSplitSize = 0;
246 int intPrevValue = 4;
249 int intSplitSeek = 0;
252 //SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
256 if (FNFirst == FALSE){
258 ContactDatav3.AddRaw(wxT("FN"), wxSPropertySeg2);
260 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
264 ContactDatav3.AddRaw(wxT("X-VCARD4-FN;X-FIRST=TRUE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
271 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
273 ContactDatav3.AddRaw(wxT("X-VCARD4-FN"), wxSPropertySeg2);
277 ContactDatav3.AddRaw(wxT("X-VCARD4-FN;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))),
284 } else if (wxSProperty == wxT("N") && NameProcessed == FALSE){
286 int intPropertyLen = wxSPropertySeg1.Len();
287 std::map<int, int> SplitPoints;
288 std::map<int, int> SplitLength;
289 std::map<int, int>::iterator SLiter;
290 wxString PropertyData;
291 wxString PropertyName;
292 wxString PropertyValue;
293 wxString PropertyTokens;
294 bool AfterFirstToken = FALSE;
295 bool FirstToken = TRUE;
296 int intSplitsFound = 0;
297 int intSplitSize = 0;
298 int intPrevValue = 3;
301 int intSplitSeek = 0;
306 ContactDatav3.AddRaw(wxT("N"), wxSPropertySeg2);
308 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
314 ContactDatav3.AddRaw(wxT("X-VCARD4-N;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
318 NameProcessed = TRUE;
320 } else if (wxSProperty == wxT("KIND") && KindProcessed == FALSE){
324 int intPropertyLen = wxSPropertySeg1.Len();
325 std::map<int, int> SplitPoints;
326 std::map<int, int> SplitLength;
327 std::map<int, int>::iterator SLiter;
328 wxString PropertyData;
329 wxString PropertyName;
330 wxString PropertyValue;
331 wxString PropertyTokens;
332 bool AfterFirstToken = FALSE;
333 bool FirstToken = TRUE;
334 int intSplitsFound = 0;
335 int intSplitSize = 0;
336 int intPrevValue = 5;
339 int intSplitSeek = 0;
344 ContactDatav3.AddRaw(wxT("X-ADDRESSBOOKSERVER-KIND"), wxSPropertySeg2);
346 KindProcessed = TRUE;
348 } else if (wxSProperty == wxT("MEMBER")){
352 int intPropertyLen = wxSPropertySeg1.Len();
353 std::map<int, int> SplitPoints;
354 std::map<int, int> SplitLength;
355 std::map<int, int>::iterator SLiter;
356 wxString PropertyData;
357 wxString PropertyName;
358 wxString PropertyValue;
359 wxString PropertyTokens;
360 bool AfterFirstToken = FALSE;
361 bool FirstToken = TRUE;
362 int intSplitsFound = 0;
363 int intSplitSize = 0;
364 int intPrevValue = 7;
367 int intSplitSeek = 0;
372 ContactDatav3.AddRaw(wxT("X-ADDRESSBOOKSERVER-MEMBER"), wxSPropertySeg2);
374 } else if (wxSProperty == wxT("NICKNAME")){
376 int intPropertyLen = wxSPropertySeg1.Len();
377 std::map<int, int> SplitPoints;
378 std::map<int, int> SplitLength;
379 std::map<int, int>::iterator SLiter;
380 wxString PropertyData;
381 wxString PropertyName;
382 wxString PropertyValue;
383 wxString PropertyTokens;
384 bool AfterFirstToken = FALSE;
385 bool FirstToken = TRUE;
386 int intSplitsFound = 0;
387 int intSplitSize = 0;
388 int intPrevValue = 10;
391 int intSplitSeek = 0;
396 if (NicknameFirst == FALSE){
398 ContactDatav3.AddRaw(wxT("NICKNAME"), wxSPropertySeg2);
400 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
404 ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME;X-FIRST=TRUE;")
405 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
408 NicknameFirst = TRUE;
413 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
415 ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME"), wxSPropertySeg2);
419 ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
427 } else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){
429 // Do PID/ALTID/LANG things.
431 int intPropertyLen = wxSPropertySeg1.Len();
432 std::map<int, int> SplitPoints;
433 std::map<int, int> SplitLength;
434 std::map<int, int>::iterator SLiter;
435 wxString PropertyData;
436 wxString PropertyName;
437 wxString PropertyValue;
438 wxString PropertyTokens;
439 bool AfterFirstToken = FALSE;
440 bool FirstToken = TRUE;;
441 int intSplitsFound = 0;
442 int intSplitSize = 0;
443 int intPrevValue = 8;
446 int intSplitSeek = 0;
451 if (wxSPropertySeg2.Mid(1, 1) == wxT(";")){
453 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
455 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;X-GENDERTEXT=\"") + wxSPropertySeg2.Mid(2) + wxT("\""), wxSPropertySeg2.Mid(0, 1));
459 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;X-GENDERTEXT=\"") + wxSPropertySeg2.Mid(2) + wxT("\";")
460 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))),
461 wxSPropertySeg2.Mid(0, 1));
467 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
469 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER"), wxSPropertySeg2);
473 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
479 GenderProcessed = TRUE;
481 } else if (wxSProperty == wxT("BDAY") && BirthdayProcessed == FALSE){
483 // Process date. Preserve the remainder in the string.
485 int intPropertyLen = wxSPropertySeg1.Len();
486 std::map<int, int> SplitPoints;
487 std::map<int, int> SplitLength;
488 std::map<int, int>::iterator SLiter;
489 wxString PropertyData;
490 wxString PropertyName;
491 wxString PropertyValue;
492 wxString PropertyTokens;
493 bool AfterFirstToken = FALSE;
494 bool BirthdayText = FALSE;
495 bool FirstToken = TRUE;
497 int intSplitsFound = 0;
498 int intSplitSize = 0;
499 int intPrevValue = 6;
502 int intSplitSeek = 0;
508 // Look for type before continuing.
510 if (wxSPropertySeg2.Mid(0, 2) == wxT("--")){
512 strResults.Append(wxT("1604-"));
515 strResults.Append(wxSPropertySeg2.Mid(2, 2) + wxT("-"));
516 strResults.Append(wxSPropertySeg2.Mid(4, 2));
520 strResults.Append(wxSPropertySeg2.Mid(0, 4) + wxT("-"));
521 strResults.Append(wxSPropertySeg2.Mid(4, 2) + wxT("-"));
522 strResults.Append(wxSPropertySeg2.Mid(6, 2));
530 ContactDatav3.AddRaw(wxT("BDAY;X-APPLE-OMIT-YEAR=1604"), strResults);
532 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
534 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY"), wxSPropertySeg2);
538 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
544 ContactDatav3.AddRaw(wxT("BDAY"), strResults);
546 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
548 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY"), wxSPropertySeg2);
552 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
558 BirthdayProcessed = TRUE;
560 } else if (wxSProperty == wxT("ANNIVERSARY") && AnniversaryProcessed == FALSE){
562 // Process date. Preserve the remainder in the string.
564 int intPropertyLen = wxSPropertySeg1.Len();
565 std::map<int, int> SplitPoints;
566 std::map<int, int> SplitLength;
567 std::map<int, int>::iterator SLiter;
568 wxString PropertyData;
569 wxString PropertyName;
570 wxString PropertyValue;
571 wxString PropertyTokens;
572 bool AfterFirstToken = FALSE;
573 bool AnniversaryText = FALSE;
574 bool FirstToken = TRUE;
575 int intSplitsFound = 0;
576 int intSplitSize = 0;
577 int intPrevValue = 13;
580 int intSplitSeek = 0;
587 // Look for type before continuing.
589 if (wxSPropertySeg2.Mid(0, 2) == wxT("--")){
591 strResults.Append(wxT("1604-"));
594 strResults.Append(wxSPropertySeg2.Mid(2, 2) + wxT("-"));
595 strResults.Append(wxSPropertySeg2.Mid(4, 2));
599 strResults.Append(wxSPropertySeg2.Mid(0, 4) + wxT("-"));
600 strResults.Append(wxSPropertySeg2.Mid(4, 2) + wxT("-"));
601 strResults.Append(wxSPropertySeg2.Mid(6, 2));
609 ContactDatav3.AddRaw(wxT("ANNIVERSARY;X-APPLE-OMIT-YEAR=1604"), strResults);
611 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
613 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY"), wxSPropertySeg2);
617 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
623 ContactDatav3.AddRaw(wxT("ANNIVERSARY"), strResults);
625 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
627 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY"), wxSPropertySeg2);
631 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
637 AnniversaryProcessed = TRUE;
639 } else if (wxSProperty == wxT("TZ")){
641 int intPropertyLen = wxSPropertySeg1.Len();
642 std::map<int, int> SplitPoints;
643 std::map<int, int> SplitLength;
644 std::map<int, int>::iterator SLiter;
645 wxString PropertyData;
646 wxString PropertyName;
647 wxString PropertyValue;
648 wxString PropertyTokens;
649 bool AfterFirstToken = FALSE;
650 bool FirstToken = TRUE;
651 int intSplitsFound = 0;
652 int intSplitSize = 0;
653 int intPrevValue = 4;
656 int intSplitSeek = 0;
661 // Look for type before continuing.
663 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
665 ContactDatav3.AddRaw(wxT("X-VCARD4-TZ"), wxSPropertySeg2);
669 ContactDatav3.AddRaw(wxT("X-VCARD4-TZ;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
673 } else if (wxSProperty == wxT("ADR")){
675 int intPropertyLen = wxSPropertySeg1.Len();
676 std::map<int, int> SplitPoints;
677 std::map<int, int> SplitLength;
678 std::map<int, int>::iterator SLiter;
679 wxString PropertyData;
680 wxString PropertyName;
681 wxString PropertyValue;
682 wxString PropertyTokens;
683 wxString AddressLabel;
684 wxString AddressLang;
685 wxString AddressAltID;
687 wxString AddressTokens;
689 wxString AddressTimezone;
690 wxString AddressType;
691 wxString AddressMediatype;
692 wxString AddressPOBox;
693 wxString AddressExtended;
694 wxString AddressStreet;
695 wxString AddressLocality;
696 wxString AddressCity;
697 wxString AddressRegion;
698 wxString AddressPostalCode;
699 wxString AddressCountry;
700 bool AfterFirstToken = FALSE;
701 bool FirstToken = TRUE;
702 int intSplitsFound = 0;
703 int intSplitSize = 0;
704 int intPrevValue = 5;
707 int intSplitSeek = 0;
712 // TODO: Check in value for X-ABLabel and use it if it is there.
714 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
716 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".ADR"), wxSPropertySeg2);
717 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Address"));
718 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-ADR"), wxSPropertySeg2);
722 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".ADR"), wxSPropertySeg2);
723 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Address"));
724 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-ADR;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
730 } else if (wxSProperty == wxT("EMAIL")){
732 // TODO: Continue from here! See ADR for good example (Replace initer with intPrevValue).
733 // Remove inserted comma for Extra Tokens in frmContactEditor.cpp
735 int intPropertyLen = wxSPropertySeg1.Len();
736 std::map<int, int> SplitPoints;
737 std::map<int, int> SplitLength;
738 std::map<int, int>::iterator SLiter;
739 std::map<int, int>::iterator SPoint;
740 wxString PropertyData;
741 wxString PropertyName;
742 wxString PropertyValue;
743 wxString PropertyTokens;
744 wxString AddressLabel;
745 wxString AddressLang;
746 wxString AddressAltID;
748 wxString AddressTokens;
750 wxString AddressTimezone;
751 wxString AddressType;
752 wxString AddressMediatype;
753 wxString AddressPOBox;
754 wxString AddressExtended;
755 wxString AddressStreet;
756 wxString AddressLocality;
757 wxString AddressCity;
758 wxString AddressRegion;
759 wxString AddressPostalCode;
760 wxString AddressCountry;
761 bool AfterFirstProperty = FALSE;
762 bool FirstToken = TRUE;
763 int intSplitSeek = 0;
764 int intSplitsFound = 0;
765 int intSplitSize = 0;
766 int intPrevValue = 7;
769 int intSplitPoint = 0;
774 // TODO: Check in value for X-ABLabel and use it if it is there.
776 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
778 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".EMAIL"), wxSPropertySeg2);
779 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("E-mail Address"));
780 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-EMAIL"), wxSPropertySeg2);
784 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".EMAIL"), wxSPropertySeg2);
785 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("E-mail Address"));
786 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-EMAIL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
792 } else if (wxSProperty == wxT("IMPP")){
794 int intPropertyLen = wxSPropertySeg1.Len();
795 std::map<int, int> SplitPoints;
796 std::map<int, int> SplitLength;
797 std::map<int, int>::iterator SLiter;
798 std::map<int, int>::iterator SPoint;
799 wxString PropertyData;
800 wxString PropertyName;
801 wxString PropertyValue;
802 wxString PropertyTokens;
804 wxString IMPPAddress;
805 bool AfterFirstProperty = FALSE;
806 bool FirstToken = TRUE;
807 int intSplitSeek = 0;
808 int intSplitsFound = 0;
809 int intSplitSize = 0;
810 int intPrevValue = 6;
813 int intSplitPoint = 0;
816 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
820 // TODO: Check in value for X-ABLabel and use it if it is there.
822 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
824 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".IMPP"), wxSPropertySeg2);
825 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Instant Message"));
826 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-IMPP"), wxSPropertySeg2);
830 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".IMPP"), wxSPropertySeg2);
831 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Instant Message"));
832 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-IMPP;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
838 } else if (wxSProperty == wxT("TEL")){
840 // Check TEL and make sure it is functioning properly.
842 int intPropertyLen = wxSPropertySeg1.Len();
843 std::map<int, int> SplitPoints;
844 std::map<int, int> SplitLength;
845 std::map<int, int> TypeSplitPoints;
846 std::map<int, int> TypeSplitLength;
847 std::map<int, int>::iterator SLiter;
848 std::map<int, int>::iterator SPoint;
849 std::map<int, int>::iterator TSLiter;
850 std::map<int, int>::iterator TSPoint;
851 wxString PropertyData;
852 wxString PropertyName;
853 wxString PropertyValue;
854 wxString PropertyTokens;
858 wxString TelTypeDetail;
860 wxString FinalFriendlyString;
861 bool AfterFirstProperty = FALSE;
862 bool FirstToken = TRUE;
863 bool SkipFirst = TRUE;
864 int intSplitSeek = 0;
865 int intSplitsFound = 0;
866 int intSplitSize = 0;
867 int intPrevValue = 5;
870 int intSplitPoint = 0;
875 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
877 // Look for type before continuing.
879 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
880 intiter != SplitPoints.end(); ++intiter){
882 SLiter = SplitLength.find(intiter->first);
884 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
886 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
887 PropertyName = PropertyElement.GetNextToken();
888 PropertyValue = PropertyElement.GetNextToken();
890 intPrevValue = intiter->second;
892 if (PropertyName == wxT("TYPE")){
894 // Process each value in type and translate each
897 // Strip out the quotes if they are there.
899 int intPropertyValueLen = PropertyValue.Len();
901 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
903 PropertyValue.Trim();
904 PropertyValue.RemoveLast();
908 if (PropertyValue.Mid(0, 1) == wxT("\"")){
910 PropertyValue.Remove(0, 1);
914 TelTypeDetail = PropertyValue;
920 for (int i = 0; i <= intPropertyValueLen; i++){
924 if (PropertyValue.Mid(i, 1) == wxT(",") && PropertyValue.Mid((i - 1), 1) != wxT("\\")){
926 if (intSplitsFound == 0){
928 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
929 TypeSplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
933 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
934 TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
947 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
948 TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
952 for (std::map<int, int>::iterator typeiter = TypeSplitPoints.begin();
953 typeiter != TypeSplitPoints.end(); ++typeiter){
955 wxString TypePropertyName;
957 TSLiter = TypeSplitLength.find(typeiter->first);
959 TypePropertyName = PropertyValue.Mid(typeiter->second, TSLiter->second);
961 if (intTypeSeek == 0){
966 TelTypeUI.Append(wxT(","));
970 if (TypePropertyName == wxT("home")){
974 } else if (TypePropertyName == wxT("work")){
980 if (TypePropertyName == wxT("text")){
982 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Text")); } else { FinalFriendlyString.Append(_("Text")); }
984 TelTypeOut.Append(wxT(";"));
985 TelTypeOut.Append(wxT("type=TEXT"));
987 } else if (TypePropertyName == wxT("voice")){
989 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Voice")); } else { FinalFriendlyString.Append(_("Voice")); }
991 TelTypeOut.Append(wxT(";"));
992 TelTypeOut.Append(wxT("type=VOICE"));
996 } else if (TypePropertyName == wxT("fax")){
998 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Fax")); } else { FinalFriendlyString.Append(_("Fax")); }
1000 TelTypeOut.Append(wxT(";"));
1001 TelTypeOut.Append(wxT("type=FAX"));
1004 } else if (TypePropertyName == wxT("cell")){
1006 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Mobile")); } else { FinalFriendlyString.Append(_("Mobile")); }
1008 TelTypeOut.Append(wxT(";"));
1009 TelTypeOut.Append(wxT("type=CELL"));
1012 } else if (TypePropertyName == wxT("video")){
1014 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Video")); } else { FinalFriendlyString.Append(_("Video")); }
1016 TelTypeOut.Append(wxT(";"));
1017 TelTypeOut.Append(wxT("type=VIDEO"));
1020 } else if (TypePropertyName == wxT("pager")){
1022 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Pager")); } else { FinalFriendlyString.Append(_("Pager")); }
1024 TelTypeOut.Append(wxT(";"));
1025 TelTypeOut.Append(wxT("type=PAGER"));
1028 } else if (TypePropertyName == wxT("textphone")){
1030 //if (!TelTypeOut.IsEmpty()){ TelTypeOut.Append(wxT(";")); }
1032 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Textphone")); } else { FinalFriendlyString.Append(_("Textphone")); }
1034 TelTypeOut.Append(wxT(";"));
1035 TelTypeOut.Append(wxT("type=TEXTPHONE"));
1052 // Remove 'tel:' if it is being used.
1054 if (wxSPropertySeg2.Mid(0, 4) == wxT("tel:")){
1056 FinalTel = wxSPropertySeg2.Mid(4);
1060 FinalTel = wxSPropertySeg2;
1064 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1066 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".TEL") + TelTypeOut, FinalTel);
1067 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), FinalFriendlyString);
1068 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-TEL"), wxSPropertySeg2);
1072 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".TEL") + TelTypeOut, FinalTel);
1073 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), FinalFriendlyString);
1074 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-TEL;") + wxSPropertySeg1.Mid(4), wxSPropertySeg2);
1080 } else if (wxSProperty == wxT("LANG")){
1082 int intPropertyLen = wxSPropertySeg1.Len();
1083 std::map<int, int> SplitPoints;
1084 std::map<int, int> SplitLength;
1085 std::map<int, int>::iterator SLiter;
1086 wxString PropertyData;
1087 wxString PropertyName;
1088 wxString PropertyValue;
1089 wxString PropertyTokens;
1090 bool AfterFirstToken = FALSE;
1091 bool FirstToken = TRUE;
1092 int intSplitsFound = 0;
1093 int intSplitSize = 0;
1094 int intPrevValue = 6;
1097 int intSplitSeek = 0;
1102 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1104 ContactDatav3.AddRaw(wxT("X-VCARD4-LANG"), wxSPropertySeg2);
1108 ContactDatav3.AddRaw(wxT("X-VCARD4-LANG;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1112 } else if (wxSProperty == wxT("GEO")){
1114 int intPropertyLen = wxSPropertySeg1.Len();
1115 std::map<int, int> SplitPoints;
1116 std::map<int, int> SplitLength;
1117 std::map<int, int>::iterator SLiter;
1118 wxString PropertyData;
1119 wxString PropertyName;
1120 wxString PropertyValue;
1121 wxString PropertyTokens;
1124 bool AfterFirstToken = FALSE;
1125 bool FirstToken = TRUE;
1126 int intSplitsFound = 0;
1127 int intSplitSize = 0;
1128 int intPrevValue = 5;
1131 int intSplitSeek = 0;
1136 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1138 wxString strFinalGeoValue;
1139 wxString strFinalType;
1141 if (wxSPropertySeg2.Mid(0, 3) == wxT("geo")){
1143 strFinalGeoValue = wxSPropertySeg2.Mid(5);
1144 strFinalType = wxT("geo");
1148 wxStringTokenizer wSTSplit(wxSPropertySeg2, wxT(":"));
1149 strFinalType = wSTSplit.GetNextToken();
1150 strFinalGeoValue = wSTSplit.GetNextToken();
1154 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1156 ContactDatav3.AddRaw(wxT("X-VCARD4-GEO;X-GEOTYPE=") + strFinalType, wxSPropertySeg2);
1160 ContactDatav3.AddRaw(wxT("X-VCARD4-GEO;X-GEOTYPE=") + strFinalType + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1164 } else if (wxSProperty == wxT("RELATED")){
1166 int intPropertyLen = wxSPropertySeg1.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 wxString RelatedType;
1175 wxString RelatedTypeOriginal;
1176 wxString RelatedName;
1177 bool AfterFirstToken = FALSE;
1178 bool FirstToken = TRUE;
1179 int intSplitsFound = 0;
1180 int intSplitSize = 0;
1181 int intPrevValue = 9;
1184 int intSplitSeek = 0;
1189 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1193 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1194 intiter != SplitPoints.end(); ++intiter){
1196 SLiter = SplitLength.find(intiter->first);
1198 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second - 1));
1200 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1201 PropertyName = PropertyElement.GetNextToken();
1202 PropertyValue = PropertyElement.GetNextToken();
1204 if (PropertyName == wxT("TYPE") && FirstToken == TRUE){
1206 if (PropertyValue == wxT("contact")){
1208 strDetail = _("Contact");
1210 } else if (PropertyValue == wxT("acquaintance")){
1212 strDetail = _("Acquaintance");
1214 } else if (PropertyValue == wxT("friend")){
1216 strDetail = _("Friend");
1218 } else if (PropertyValue == wxT("met")){
1220 strDetail = _("Met");
1222 } else if (PropertyValue == wxT("co-worker")){
1224 strDetail = _("Co-worker");
1226 } else if (PropertyValue == wxT("colleague")){
1228 strDetail = _("Colleague");
1230 } else if (PropertyValue == wxT("co-resident")){
1232 strDetail = _("Co-resident");
1234 } else if (PropertyValue == wxT("neighbor")){
1236 strDetail = _("Neighbour");
1238 } else if (PropertyValue == wxT("child")){
1240 strDetail = _("Child");
1242 } else if (PropertyValue == wxT("parent")){
1244 strDetail = _("Parent");
1246 } else if (PropertyValue == wxT("sibling")){
1248 strDetail = _("Sibling");
1250 } else if (PropertyValue == wxT("spouse")){
1252 strDetail = _("Spouse");
1254 } else if (PropertyValue == wxT("kin")){
1256 strDetail = _("Kin");
1258 } else if (PropertyValue == wxT("muse")){
1260 strDetail = _("Muse");
1262 } else if (PropertyValue == wxT("crush")){
1264 strDetail = _("Crush");
1266 } else if (PropertyValue == wxT("date")){
1268 strDetail = _("Date");
1270 } else if (PropertyValue == wxT("sweetheart")){
1272 strDetail = _("Sweetheart");
1274 } else if (PropertyValue == wxT("me")){
1276 strDetail = _("Me");
1278 } else if (PropertyValue == wxT("agent")){
1280 strDetail = _("Agent");
1282 } else if (PropertyValue == wxT("emergency")){
1284 strDetail = _("Emergency");
1288 strDetail = PropertyValue;
1298 if (strDetail.IsEmpty()){
1300 strDetail = _("Relation");
1304 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1306 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABRELATEDNAMES"), wxSPropertySeg2);
1307 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), strDetail);
1308 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-RELATED"), wxSPropertySeg2);
1312 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABRELATEDNAMES"), wxSPropertySeg2);
1313 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), strDetail);
1314 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-RELATED;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1320 } else if (wxSProperty == wxT("URL")){
1322 int intPropertyLen = wxSPropertySeg1.Len();
1323 std::map<int, int> SplitPoints;
1324 std::map<int, int> SplitLength;
1325 std::map<int, int>::iterator SLiter;
1326 wxString PropertyData;
1327 wxString PropertyName;
1328 wxString PropertyValue;
1329 wxString PropertyTokens;
1330 bool AfterFirstToken = FALSE;
1331 bool FirstToken = TRUE;
1332 int intSplitsFound = 0;
1333 int intSplitSize = 0;
1334 int intPrevValue = 5;
1337 int intSplitSeek = 0;
1342 // Todo: Check for X-ABLabel.
1344 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1346 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".URL"), wxSPropertySeg2);
1347 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("URL"));
1348 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-URL"), wxSPropertySeg2);
1352 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".URL"), wxSPropertySeg2);
1353 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("URL"));
1354 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-URL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1360 } else if (wxSProperty == wxT("TITLE")) {
1362 int intPropertyLen = wxSPropertySeg1.Len();
1363 std::map<int, int> SplitPoints;
1364 std::map<int, int> SplitLength;
1365 std::map<int, int>::iterator SLiter;
1366 wxString PropertyData;
1367 wxString PropertyName;
1368 wxString PropertyValue;
1369 wxString PropertyTokens;
1370 bool AfterFirstToken = FALSE;
1371 bool FirstToken = TRUE;
1372 int intSplitsFound = 0;
1373 int intSplitSize = 0;
1374 int intPrevValue = 7;
1377 int intSplitSeek = 0;
1382 // Look for type before continuing.
1384 if (TitleFirst == FALSE){
1386 ContactDatav3.AddRaw(wxT("TITLE"), wxSPropertySeg2);
1388 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1392 ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE;X-FIRST=TRUE;")
1393 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1401 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1403 ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE"), wxSPropertySeg2);
1407 ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1414 } else if (wxSProperty == wxT("ROLE")) {
1416 int intPropertyLen = wxSPropertySeg1.Len();
1417 std::map<int, int> SplitPoints;
1418 std::map<int, int> SplitLength;
1419 std::map<int, int>::iterator SLiter;
1420 wxString PropertyData;
1421 wxString PropertyName;
1422 wxString PropertyValue;
1423 wxString PropertyTokens;
1424 bool AfterFirstToken = FALSE;
1425 bool FirstToken = TRUE;
1426 int intSplitsFound = 0;
1427 int intSplitSize = 0;
1428 int intPrevValue = 6;
1431 int intSplitSeek = 0;
1436 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1438 ContactDatav3.AddRaw(wxT("X-VCARD4-ROLE"), wxSPropertySeg2);
1442 ContactDatav3.AddRaw(wxT("X-VCARD4-ROLE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1446 } else if (wxSProperty == wxT("ORG")) {
1448 int intPropertyLen = wxSPropertySeg1.Len();
1449 std::map<int, int> SplitPoints;
1450 std::map<int, int> SplitLength;
1451 std::map<int, int>::iterator SLiter;
1452 wxString PropertyData;
1453 wxString PropertyName;
1454 wxString PropertyValue;
1455 wxString PropertyTokens;
1456 bool AfterFirstToken = FALSE;
1457 bool FirstToken = TRUE;
1458 int intSplitsFound = 0;
1459 int intSplitSize = 0;
1460 int intPrevValue = 5;
1463 int intSplitSeek = 0;
1468 if (OrganisationFirst == FALSE){
1470 ContactDatav3.AddRaw(wxT("ORG"), wxSPropertySeg2);
1472 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1476 ContactDatav3.AddRaw(wxT("X-VCARD4-ORG;X-FIRST=TRUE;")
1477 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1480 OrganisationFirst = TRUE;
1485 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1487 ContactDatav3.AddRaw(wxT("X-VCARD4-ORG"), wxSPropertySeg2);
1491 ContactDatav3.AddRaw(wxT("X-VCARD4-ORG;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1498 } else if (wxSProperty == wxT("NOTE")) {
1500 int intPropertyLen = wxSPropertySeg1.Len();
1501 std::map<int, int> SplitPoints;
1502 std::map<int, int> SplitLength;
1503 std::map<int, int>::iterator SLiter;
1504 wxString PropertyData;
1505 wxString PropertyName;
1506 wxString PropertyValue;
1507 wxString PropertyTokens;
1508 bool AfterFirstToken = FALSE;
1509 bool FirstToken = TRUE;
1510 int intSplitsFound = 0;
1511 int intSplitSize = 0;
1512 int intPrevValue = 6;
1515 int intSplitSeek = 0;
1520 if (NoteFirst == FALSE){
1522 ContactDatav3.AddRaw(wxT("NOTE"), wxSPropertySeg2);
1524 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1528 ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE;X-FIRST=TRUE;")
1529 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1537 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1539 ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE"), wxSPropertySeg2);
1543 ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1550 } else if (wxSProperty == wxT("CATEGORIES")) {
1552 int intPropertyLen = wxSPropertySeg1.Len();
1553 std::map<int, int> SplitPoints;
1554 std::map<int, int> SplitLength;
1555 std::map<int, int>::iterator SLiter;
1556 wxString PropertyData;
1557 wxString PropertyName;
1558 wxString PropertyValue;
1559 wxString PropertyTokens;
1560 wxString PropertyType;
1561 bool AfterFirstToken = FALSE;
1562 bool FirstToken = TRUE;
1563 int intSplitsFound = 0;
1564 int intSplitSize = 0;
1565 int intPrevValue = 12;
1568 int intSplitSeek = 0;
1573 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1575 ContactDatav3.AddRaw(wxT("X-VCARD4-CATEGORIES"), wxSPropertySeg2);
1579 ContactDatav3.AddRaw(wxT("X-VCARD4-CATEGORIES;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1583 } else if (wxSProperty == wxT("PHOTO")) {
1585 int intPropertyLen = wxSPropertySeg1.Len();
1586 std::map<int, int> SplitPoints;
1587 std::map<int, int> SplitLength;
1588 std::map<int, int>::iterator SLiter;
1589 wxString PropertyData;
1590 wxString PropertyName;
1591 wxString PropertyValue;
1592 wxString PropertyTokens;
1593 bool FirstToken = TRUE;
1594 int intSplitsFound = 0;
1595 int intSplitSize = 0;
1596 int intPrevValue = 7;
1599 int intSplitSeek = 0;
1602 intPropertyLen = wxSPropertySeg2.Len();
1603 SplitPoints.clear();
1604 SplitLength.clear();
1608 CaptureString(&wxSPropertySeg2, FALSE);
1610 for (int i = 0; i <= intPropertyLen; i++){
1614 if (wxSPropertySeg2.Mid(i, 1) == wxT(";")){
1617 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
1619 if (intSplitsFound == 6){
1621 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1626 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1636 wxString wxSPhotoURI;
1637 wxString wxSPhotoMIME;
1638 wxString wxSPhotoEncoding;
1639 wxString wxSPhotoData;
1640 std::string base64enc;
1642 if (intSplitsFound = 0){
1646 std::map<int, int>::iterator striter;
1648 striter = SplitLength.find(1);
1650 wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
1652 while (wSTDataType.HasMoreTokens() == TRUE){
1654 wxSPhotoURI = wSTDataType.GetNextToken();
1655 wxSPhotoMIME = wSTDataType.GetNextToken();
1660 wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
1662 while (wSTDataInfo.HasMoreTokens() == TRUE){
1664 wxSPhotoEncoding = wSTDataInfo.GetNextToken();
1665 wxSPhotoData = wSTDataInfo.GetNextToken();
1666 base64enc = wxSPhotoData.mb_str();
1674 if (PhotoFirst == FALSE){
1676 bool PhotoKeepData = FALSE;
1678 wxString wxSPhotoMIMEF;
1680 if (wxSPhotoMIME == wxT("image/png")){
1681 wxSPhotoMIMEF = wxT("PNG");
1682 } else if (wxSPhotoMIME == wxT("image/jpeg")){
1683 wxSPhotoMIMEF = wxT("JPEG");
1684 } else if (wxSPhotoMIME == wxT("image/gif")){
1685 wxSPhotoMIMEF = wxT("GIF");
1686 } else if (wxSPhotoMIME == wxT("image/bmp")){
1687 wxSPhotoMIMEF = wxT("BMP");
1689 wxSPhotoMIMEF = wxT("UNKNOWN");
1690 PhotoKeepData = TRUE;
1693 ContactDatav3.AddRaw(wxT("PHOTO;ENCODING=b;TYPE=") + wxSPhotoMIMEF, wxSPhotoData);
1695 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1699 if (PhotoKeepData == TRUE){
1701 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;X-FIRST=TRUE;")
1702 + ContactLine.Mid((intPrevValue - 1), ((QuoteBreakPoint + 1) - (intPrevValue))), wxSPropertySeg2);
1706 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;X-FIRST=TRUE;")
1707 + ContactLine.Mid((intPrevValue - 1), ((QuoteBreakPoint + 1) - (intPrevValue))), wxT(""));
1717 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1719 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO"), wxSPropertySeg2);
1723 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1729 } else if (wxSProperty == wxT("LOGO")) {
1731 int intPropertyLen = wxSPropertySeg1.Len();
1732 std::map<int, int> SplitPoints;
1733 std::map<int, int> SplitLength;
1734 std::map<int, int>::iterator SLiter;
1735 wxString PropertyData;
1736 wxString PropertyName;
1737 wxString PropertyValue;
1738 wxString PropertyTokens;
1739 bool FirstToken = TRUE;
1740 int intSplitsFound = 0;
1741 int intSplitSize = 0;
1742 int intPrevValue = 6;
1745 int intSplitSeek = 0;
1750 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1752 ContactDatav3.AddRaw(wxT("X-VCARD4-LOGO"), wxSPropertySeg2);
1756 ContactDatav3.AddRaw(wxT("X-VCARD4-LOGO;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1760 } else if (wxSProperty == wxT("SOUND")) {
1762 int intPropertyLen = wxSPropertySeg1.Len();
1763 std::map<int, int> SplitPoints;
1764 std::map<int, int> SplitLength;
1765 std::map<int, int>::iterator SLiter;
1766 wxString PropertyData;
1767 wxString PropertyName;
1768 wxString PropertyValue;
1769 wxString PropertyTokens;
1770 bool FirstToken = TRUE;
1771 int intSplitsFound = 0;
1772 int intSplitSize = 0;
1773 int intPrevValue = 7;
1776 int intSplitSeek = 0;
1781 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1783 ContactDatav3.AddRaw(wxT("X-VCARD4-SOUND"), wxSPropertySeg2);
1787 ContactDatav3.AddRaw(wxT("X-VCARD4-SOUND;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1791 } else if (wxSProperty == wxT("CALURI")){
1793 int intPropertyLen = wxSPropertySeg1.Len();
1794 std::map<int, int> SplitPoints;
1795 std::map<int, int> SplitLength;
1796 std::map<int, int>::iterator SLiter;
1797 wxString PropertyData;
1798 wxString PropertyName;
1799 wxString PropertyValue;
1800 wxString PropertyTokens;
1801 bool AfterFirstToken = FALSE;
1802 bool FirstToken = TRUE;
1803 int intSplitsFound = 0;
1804 int intSplitSize = 0;
1805 int intPrevValue = 8;
1808 int intSplitSeek = 0;
1813 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1815 ContactDatav3.AddRaw(wxT("X-VCARD4-CALURI"), wxSPropertySeg2);
1819 ContactDatav3.AddRaw(wxT("X-VCARD4-CALURI;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1823 } else if (wxSProperty == wxT("CALADRURI")){
1825 int intPropertyLen = wxSPropertySeg1.Len();
1826 std::map<int, int> SplitPoints;
1827 std::map<int, int> SplitLength;
1828 std::map<int, int>::iterator SLiter;
1829 wxString PropertyData;
1830 wxString PropertyName;
1831 wxString PropertyValue;
1832 wxString PropertyTokens;
1833 bool AfterFirstToken = FALSE;
1834 bool FirstToken = TRUE;
1835 int intSplitsFound = 0;
1836 int intSplitSize = 0;
1837 int intPrevValue = 11;
1840 int intSplitSeek = 0;
1845 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1847 ContactDatav3.AddRaw(wxT("X-VCARD4-CALADRURI"), wxSPropertySeg2);
1851 ContactDatav3.AddRaw(wxT("X-VCARD4-CALADRURI;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1855 } else if (wxSProperty == wxT("FBURL")){
1857 int intPropertyLen = wxSPropertySeg1.Len();
1858 std::map<int, int> SplitPoints;
1859 std::map<int, int> SplitLength;
1860 std::map<int, int>::iterator SLiter;
1861 wxString PropertyData;
1862 wxString PropertyName;
1863 wxString PropertyValue;
1864 wxString PropertyTokens;
1865 bool AfterFirstToken = FALSE;
1866 bool FirstToken = TRUE;
1867 int intSplitsFound = 0;
1868 int intSplitSize = 0;
1869 int intPrevValue = 7;
1872 int intSplitSeek = 0;
1877 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1879 ContactDatav3.AddRaw(wxT("X-VCARD4-FBURL"), wxSPropertySeg2);
1883 ContactDatav3.AddRaw(wxT("X-VCARD4-FBURL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1887 } else if (wxSProperty == wxT("KEY")){
1889 int intPropertyLen = wxSPropertySeg1.Len();
1890 std::map<int, int> SplitPoints;
1891 std::map<int, int> SplitLength;
1892 std::map<int, int>::iterator SLiter;
1893 wxString PropertyData;
1894 wxString PropertyName;
1895 wxString PropertyValue;
1896 wxString PropertyTokens;
1897 bool AfterFirstToken = FALSE;
1898 bool FirstToken = TRUE;
1899 int intSplitsFound = 0;
1900 int intSplitSize = 0;
1901 int intPrevValue = 5;
1904 int intSplitSeek = 0;
1909 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1911 ContactDatav3.AddRaw(wxT("X-VCARD4-KEY"), wxSPropertySeg2);
1915 ContactDatav3.AddRaw(wxT("X-VCARD4-KEY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1919 } else if (wxSProperty == wxT("UID")){
1921 ContactDatav3.AddRaw(wxT("UID"), wxSPropertySeg2);
1923 } else if (wxSProperty.Mid(0, 3) == wxT("VND")){
1925 // Split the Vendor three ways.
1927 wxStringTokenizer wSTVendorDetails(wxSPropertySeg1, wxT("-"));
1930 wxString wxSVNDPropName;
1933 int intPrevValue = (wxSProperty.Len() + 1);
1935 while (wSTVendorDetails.HasMoreTokens() == TRUE){
1937 wSTVendorDetails.GetNextToken();
1938 wxSVNDID = wSTVendorDetails.GetNextToken();
1939 wxSVNDPropName = wSTVendorDetails.GetNextToken();
1944 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1946 ContactDatav3.AddRaw(wxT("X-VCARD4-") + wxSProperty, wxSPropertySeg2);
1950 ContactDatav3.AddRaw(wxT("X-VCARD4-") + wxSProperty + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1954 } else if (wxSProperty.Mid(0, 2) == wxT("X-")){
1958 int intPrevValue = (wxSProperty.Len() + 1);
1960 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1962 ContactDatav3.AddRaw(wxSProperty, wxSPropertySeg2);
1966 ContactDatav3.AddRaw(wxSProperty + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1972 // Reset the variables.
1975 PropertyFind = TRUE;
1976 ExtraLineSeek = TRUE;
1978 QuoteBreakPoint = 0;
1979 ContactLine.Clear();
1980 wxSProperty.Clear();
1984 ContactDatav3.AddRaw(wxT("END"), wxT("VCARD"));
1985 *wxSData = ContactDatav3.WriteString();
1991 bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
1993 std::map<int, wxString> ContactFileLines;
1994 std::map<int, bool> ContactFileProcessed;
1995 std::map<int, bool> ContactFileProcessedWorking;
1996 std::map<int, wxString>::iterator striter;
1997 std::map<int,bool>::iterator iterbool;
1998 std::map<int,bool>::iterator iterboolsub;
1999 wxString ContactLineRec;
2001 // Process the received data.
2003 wxStringTokenizer wSTContactFileLines(*wxSData, wxT("\r\n"));
2005 int ContactLineSeek = 0;
2007 while (wSTContactFileLines.HasMoreTokens() == TRUE){
2009 ContactLineRec = wSTContactFileLines.GetNextToken();
2010 ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLineRec));
2011 ContactFileProcessed.insert(std::make_pair(ContactLineSeek, FALSE));
2016 bool QuoteMode = FALSE;
2017 bool PropertyFind = TRUE;
2018 bool HasExtraNicknames = FALSE;
2019 bool IgnoreGender = FALSE;
2020 bool ExtraLineSeek = TRUE;
2021 bool ExtraLineSeekSub = TRUE;
2022 bool BirthdayProcessed = FALSE;
2023 bool AnniversaryProcessed = FALSE;
2024 bool FNProcessed = FALSE;
2025 bool GenderProcessed = FALSE;
2026 bool NameProcessed = FALSE;
2027 bool FNFirst = FALSE;
2028 bool NicknameFirst = FALSE;
2029 bool TitleFirst = FALSE;
2030 bool OrganisationFirst = FALSE;
2031 bool NoteFirst = FALSE;
2032 bool PhotoFirst = FALSE;
2033 bool LogoFirst = FALSE;
2034 bool NameFirst = FALSE;
2035 bool FoundData = FALSE;
2036 int intExtraNickname = 0;
2037 wxString wxSProperty;
2038 wxString wxSPropertyVCARD4;
2039 wxString wxSPropertySeg1;
2040 wxString wxSPropertySeg2;
2041 wxString wxSPropertyNextLine;
2042 wxString ContactLine;
2043 wxString ContactLineSub;
2044 wxString PropertyName;
2045 wxString PropertyValue;
2046 wxString PropertyDataStr;
2047 int ContactLineLen = 0;
2048 int ContactLineSubLen = 0;
2049 int QuoteBreakPoint = 0;
2050 int intPrevValueSub = 0;
2052 std::map<wxString, wxString> PropertyData;
2053 std::map<wxString, bool> PropertyLock;
2054 std::map<wxString, wxString> TempPropertyData;
2055 std::map<wxString, bool> TempPropertyLock;
2056 std::map<int, int> TempSplitPoints;
2057 std::map<int, int> TempSplitLength;
2058 std::map<int, int>::iterator SLiter;
2060 wxString PropertFindSub;
2061 wxString wxSPropertySub;
2062 wxString wxSPropertySeg1Sub;
2063 wxString wxSPropertySeg2Sub;
2064 wxString wxSPropertyValues;
2065 wxString wxSPropertyData;
2066 wxString wxSPropertyNameConv;
2067 wxString wxSPropertyXVCard4Value;
2068 wxString ItemProcString;
2070 bool XVCard4Value = FALSE;
2071 bool VCard3Value = FALSE;
2072 bool SeekItemData = FALSE;
2076 // Setup the version string.
2078 strVer.Append(wxT("-//Xestia//Address Book Version "));
2079 strVer.Append(wxT(XSDAB_VERSION));
2080 strVer.Append(wxT("//KW"));
2082 vCardOut->AddRaw(wxT("BEGIN"), wxT("VCARD"));
2083 vCardOut->AddRaw(wxT("VERSION"), wxT("4.0"));
2084 vCardOut->AddRaw(wxT("PRODID"), strVer);
2093 // Process the properties which have X-FIRST.
2095 // Clone the ContactFileProcessed into ContactFileProcessedWorking.
2097 ContactFileProcessedWorking.insert(ContactFileProcessed.begin(), ContactFileProcessed.end());
2099 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
2100 iter != ContactFileLines.end(); ++iter){
2102 ExtraLineSeek = TRUE;
2104 iterbool = ContactFileProcessed.find(iter->first);
2106 ContactLine = iter->second;
2108 // Ignore certain variables as they are not needed.
2110 if (ContactLine == wxT("BEGIN:VCARD") ||
2111 ContactLine == wxT("END:VCARD") ||
2112 ContactLine.Mid(0, 8) == wxT("VERSION:") ||
2113 ContactLine.Mid(0, 7) == wxT("PRODID:") ||
2114 ContactLine.Mid(0, 5) == wxT("X-AIM") ||
2115 ContactLine.Mid(0, 5) == wxT("X-MSN") ||
2116 ContactLine.Mid(0, 5) == wxT("X-ICQ") ||
2117 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") ||
2118 ContactLine.Mid(0, 7) == wxT("X-YAHOO") ||
2119 ContactLine.Mid(0, 7) == wxT("X-SKYPE") ||
2120 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
2121 ContactLine.Mid(0, 4) == wxT("REV:")){
2123 iterbool->second = TRUE;
2128 if (iterbool->second == TRUE){
2134 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
2140 if (ContactLine.Mid(0, 4) == wxT("item")){
2142 // Line is a itemn... so ignore.
2148 std::map<int,int> DataLineProcess;
2149 std::map<int, bool>::iterator DLSLiter;
2150 std::map<int,int> DataLineProcessOriginal;
2151 int DataLineSeek = 0;
2152 int DataLineSeekOrig = 0;
2154 std::map<int,wxString>::iterator itersub = iter;
2155 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterbool->first));
2158 while (ExtraLineSeek == TRUE){
2160 // Check if there is extra data on the next line
2161 // (indicated by space or tab at the start) and add data.
2165 if (itersub == ContactFileLines.end()){
2171 iterboolsub = ContactFileProcessed.find(itersub->first);
2173 if (iterboolsub == ContactFileProcessed.end()){
2179 if (iterboolsub->second == TRUE){
2185 wxSPropertyNextLine = itersub->second;
2187 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2189 wxSPropertyNextLine.Remove(0, 1);
2190 //wxSPropertyNextLine.Trim(FALSE);
2191 //ContactLine.Trim();
2192 ContactLine.Append(wxSPropertyNextLine);
2193 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterboolsub->first));
2195 //iterboolsub->second = TRUE;
2199 ExtraLineSeek = FALSE;
2205 ContactLineLen = ContactLine.Len();
2207 for (int i = 0; i <= ContactLineLen; i++){
2209 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2211 PropertyFind = FALSE;
2213 } else if (PropertyFind == TRUE){
2215 wxSProperty.Append(ContactLine.Mid(i, 1));
2219 if (ContactLine.Mid(i, 1) == wxT("\"")){
2221 if (QuoteMode == TRUE){
2233 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2235 QuoteBreakPoint = i;
2242 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
2243 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
2245 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
2246 wxSProperty = wxSPropertySegSplit.GetNextToken();
2248 // Check what type of property it is.
2252 if ((wxSProperty == wxT("PHOTO") && PhotoFirst == FALSE) ||
2253 (wxSProperty == wxT("NICKNAME") && NicknameFirst == FALSE) ||
2254 (wxSProperty == wxT("TITLE") && TitleFirst == FALSE) ||
2255 (wxSProperty == wxT("FN") && FNFirst == FALSE) ||
2256 (wxSProperty == wxT("ORG") && OrganisationFirst == FALSE) ||
2257 (wxSProperty == wxT("NOTE") && NoteFirst == FALSE)){
2259 wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
2260 intPrevValueSub = (wxSPropertyVCARD4.Len() + 2);
2262 for (std::map<int,wxString>::iterator itersub = ContactFileLines.begin();
2263 itersub != ContactFileLines.end(); ++itersub){
2265 //DataLineProcess = DataLineProcessOriginal;
2266 //DataLineSeek = DataLineSeekOrig;
2268 ContactLineSub = itersub->second;
2270 ExtraLineSeekSub = TRUE;
2272 iterboolsub = ContactFileProcessed.find(itersub->first);
2273 std::map<int,bool>::iterator iterorig = ContactFileProcessed.find(itersub->first);
2274 //std::map<int,bool>::iterator itersuborig;
2276 // Ignore certain variables as they are not needed.
2278 if (ContactLineSub == wxT("BEGIN:VCARD") ||
2279 ContactLineSub == wxT("END:VCARD") ||
2280 ContactLineSub.Mid(0, 8) == wxT("VERSION:") ||
2281 ContactLineSub.Mid(0, 7) == wxT("PRODID:") ||
2282 ContactLineSub.Mid(0, 5) == wxT("X-AIM") ||
2283 ContactLineSub.Mid(0, 5) == wxT("X-MSN") ||
2284 ContactLineSub.Mid(0, 5) == wxT("X-ICQ") ||
2285 ContactLineSub.Mid(0, 10) == wxT("X-GADUGADU") ||
2286 ContactLineSub.Mid(0, 7) == wxT("X-YAHOO") ||
2287 ContactLineSub.Mid(0, 7) == wxT("X-SKYPE") ||
2288 ContactLineSub.Mid(0, 8) == wxT("X-JABBER") ||
2289 ContactLineSub.Mid(0, 4) == wxT("REV:")){
2291 iterboolsub->second = TRUE;
2296 if (iterboolsub->second == TRUE){
2302 if (ContactLineSub.Mid(0, 1) == wxT(" ") || ContactLineSub.Mid(0, 1) == wxT("\t")){
2308 if (ContactLineSub.Mid(0, 4) == wxT("item")){
2310 // Line is a itemn... so ignore.
2316 //std::map<int,wxString>::iterator itersub = iter;
2318 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2323 while (ExtraLineSeekSub == TRUE){
2325 if (itersub == ContactFileLines.end()){
2333 iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2335 wxSPropertyNextLine = itersub->second;
2337 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2339 wxSPropertyNextLine.Remove(0, 1);
2340 //wxSPropertyNextLine.Trim(FALSE);
2341 //ContactLine.Trim();
2342 ContactLineSub.Append(wxSPropertyNextLine);
2343 //iterboolsub->second = TRUE;
2344 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2350 ExtraLineSeekSub = FALSE;
2356 /*while (ExtraLineSeekSub == TRUE && iterboolsub != ContactFileProcessedWorking.end()){
2358 // Check if there is extra data on the next line
2359 // (indicated by space or tab at the start) and add data.
2363 iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2365 if (iterboolsub->second == TRUE){
2371 if (itersub == ContactFileLines.end()){
2377 wxSPropertyNextLine = itersub->second;
2379 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2381 wxSPropertyNextLine.Remove(0, 1);
2382 //wxSPropertyNextLine.Trim(FALSE);
2383 //ContactLine.Trim();
2384 ContactLineSub.Append(wxSPropertyNextLine);
2385 //iterboolsub->second = TRUE;
2386 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2392 ExtraLineSeekSub = FALSE;
2396 if (iterboolsub == ContactFileProcessedWorking.end()){
2399 ExtraLineSeekSub = FALSE;
2405 ContactLineSubLen = ContactLineSub.Len();
2406 PropertyFind = TRUE;
2407 wxSPropertySub.clear();
2409 for (int i = 0; i <= ContactLineSubLen; i++){
2411 if ((ContactLineSub.Mid(i, 1) == wxT(";") || ContactLineSub.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2413 PropertyFind = FALSE;
2415 } else if (PropertyFind == TRUE){
2417 wxSPropertySub.Append(ContactLineSub.Mid(i, 1));
2421 if (ContactLineSub.Mid(i, 1) == wxT("\"")){
2423 if (QuoteMode == TRUE){
2435 if (ContactLineSub.Mid(i, 1) == wxT(":") && ContactLineSub.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2437 QuoteBreakPoint = i;
2444 if (wxSPropertySub != wxSPropertyVCARD4){
2446 wxSPropertySub.clear();
2448 DataLineProcess.clear();
2453 wxSPropertySeg1Sub = ContactLineSub.Mid(0, QuoteBreakPoint);
2454 wxSPropertySeg2Sub = ContactLineSub.Mid((QuoteBreakPoint + 1));
2456 // Split the property name data.
2458 // Strip the X-VCARD4- from the variable.
2460 wxString wxSPropertyChopped = wxSPropertySeg1Sub.Mid(9);
2462 intPrevValueSub = (wxSProperty.Len() + 2);
2464 SplitValuesData(&wxSPropertyChopped, &TempSplitPoints, &TempSplitLength, intPrevValueSub, &TempPropertyData);
2466 // Process the splitted data into temporary property data.
2468 bool FirstToken = TRUE;
2470 // Look for certain property names and the X-FIRST
2473 bool ProcessData = FALSE;
2475 // Check for X-FIRST.
2477 for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin();
2478 xfiter != TempPropertyData.end(); ++xfiter){
2480 PropertyName = xfiter->first;
2481 PropertyValue = xfiter->second;
2483 if (PropertyName == wxT("X-FIRST") && PropertyValue == wxT("TRUE")){
2487 if (wxSProperty == wxT("PHOTO")){ PhotoFirst = TRUE; }
2488 else if (wxSProperty == wxT("NICKNAME")){ NicknameFirst = TRUE; }
2489 else if (wxSProperty == wxT("TITLE")){ TitleFirst = TRUE; }
2490 else if (wxSProperty == wxT("FN")){ FNFirst = TRUE; }
2491 else if (wxSProperty == wxT("ORG")){ OrganisationFirst = TRUE; }
2492 else if (wxSProperty == wxT("NOTE")){ NoteFirst = TRUE; }
2499 if (ProcessData == FALSE){
2501 DataLineProcess.clear();
2503 TempPropertyData.clear();
2507 wxT("PHOTODANCEMATCH!");
2509 for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin();
2510 xfiter != TempPropertyData.end(); ++xfiter){
2512 PropertyName = xfiter->first;
2513 PropertyValue = xfiter->second;
2515 if (PropertyName == wxT("X-FIRST")){
2521 PropertyData.insert(std::make_pair(PropertyName, PropertyValue));
2522 PropertyLock.insert(std::make_pair(PropertyName, FALSE));
2526 // Mark all lines as processed.
2528 for (std::map<int,int>::iterator dpiter = DataLineProcess.begin();
2529 dpiter != DataLineProcess.end(); ++dpiter){
2531 DLSLiter = ContactFileProcessed.find(dpiter->second);
2532 DLSLiter->second = TRUE;
2536 for (std::map<int,int>::iterator dpoiter = DataLineProcessOriginal.begin();
2537 dpoiter != DataLineProcessOriginal.end(); ++dpoiter){
2539 DLSLiter = ContactFileProcessed.find(dpoiter->second);
2540 DLSLiter->second = TRUE;
2544 DataLineProcess.clear();
2545 DataLineProcessOriginal.clear();
2547 DataLineSeekOrig = 0;
2548 TempSplitPoints.clear();
2549 TempSplitLength.clear();
2550 TempPropertyData.clear();
2561 wxSProperty.clear();
2562 wxSPropertySub.Clear();
2563 wxSPropertySeg1.Clear();
2564 wxSPropertySeg2.Clear();
2565 wxSPropertySeg1Sub.Clear();
2566 wxSPropertySeg2Sub.Clear();
2567 wxSPropertyValues.Clear();
2568 wxSPropertyData.Clear();
2569 wxSPropertyXVCard4Value.Clear();
2570 wxSPropertyNameConv.Clear();
2571 PropertyData.clear();
2572 PropertyLock.clear();
2573 ContactLine.clear();
2574 ContactLineSub.clear();
2575 DataLineProcess.clear();
2576 DataLineProcessOriginal.clear();
2577 TempSplitPoints.clear();
2578 TempSplitLength.clear();
2579 wxSPropertyVCARD4.clear();
2581 DataLineSeekOrig = 0;
2582 XVCard4Value = FALSE;
2583 VCard3Value = FALSE;
2587 if (FoundData == FALSE){
2589 wxSProperty.clear();
2590 wxSPropertySub.Clear();
2591 wxSPropertySeg1.Clear();
2592 wxSPropertySeg2.Clear();
2593 wxSPropertySeg1Sub.Clear();
2594 wxSPropertySeg2Sub.Clear();
2595 wxSPropertyValues.Clear();
2596 wxSPropertyData.Clear();
2597 wxSPropertyXVCard4Value.Clear();
2598 wxSPropertyNameConv.Clear();
2599 PropertyData.clear();
2600 PropertyLock.clear();
2601 ContactLine.clear();
2602 ContactLineSub.clear();
2603 DataLineProcess.clear();
2604 DataLineProcessOriginal.clear();
2605 TempSplitPoints.clear();
2606 TempSplitLength.clear();
2607 wxSPropertyVCARD4.clear();
2609 DataLineSeekOrig = 0;
2610 XVCard4Value = FALSE;
2611 VCard3Value = FALSE;
2615 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2,
2616 &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value,
2617 &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
2619 wxString FinalPropertyData;
2621 FinalPropertyData.Append(wxSPropertyNameConv);
2623 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin();
2624 striter != PropertyData.end(); ++striter){
2626 FinalPropertyData.Append(wxT(";"));
2627 FinalPropertyData.Append(striter->first);
2628 FinalPropertyData.Append(wxT("="));
2629 FinalPropertyData.Append(striter->second);
2633 wxString FinalPropValue;
2635 if (wxSPropertyXVCard4Value.IsEmpty()){
2637 FinalPropValue = wxSPropertyData;
2641 if (wxSPropertyXVCard4Value != wxSPropertyData){
2643 FinalPropValue = wxSPropertyXVCard4Value;
2649 if (FinalPropertyData.IsEmpty() && FinalPropValue.IsEmpty()){
2655 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
2657 wxSProperty.clear();
2658 wxSPropertySub.Clear();
2659 wxSPropertySeg1.Clear();
2660 wxSPropertySeg2.Clear();
2661 wxSPropertySeg1Sub.Clear();
2662 wxSPropertySeg2Sub.Clear();
2663 wxSPropertyValues.Clear();
2664 wxSPropertyData.Clear();
2665 wxSPropertyXVCard4Value.Clear();
2666 wxSPropertyNameConv.Clear();
2667 //FinalPropertyData.clear();
2668 //FinalPropValue.clear();
2669 PropertyData.clear();
2670 PropertyLock.clear();
2671 ContactLine.clear();
2672 ContactLineSub.clear();
2673 DataLineProcess.clear();
2674 DataLineProcessOriginal.clear();
2675 wxSPropertyVCARD4.clear();
2677 DataLineSeekOrig = 0;
2678 XVCard4Value = FALSE;
2679 VCard3Value = FALSE;
2683 // Process the non-itemn values.
2685 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
2686 iter != ContactFileLines.end(); ++iter){
2688 ExtraLineSeek = TRUE;
2690 iterbool = ContactFileProcessed.find(iter->first);
2692 ContactLine = iter->second;
2694 // Ignore certain variables as they are not needed.
2696 if (ContactLine == wxT("BEGIN:VCARD") ||
2697 ContactLine == wxT("END:VCARD") ||
2698 ContactLine.Mid(0, 8) == wxT("VERSION:") ||
2699 ContactLine.Mid(0, 7) == wxT("PRODID:") ||
2700 ContactLine.Mid(0, 5) == wxT("X-AIM") ||
2701 ContactLine.Mid(0, 5) == wxT("X-MSN") ||
2702 ContactLine.Mid(0, 5) == wxT("X-ICQ") ||
2703 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") ||
2704 ContactLine.Mid(0, 7) == wxT("X-YAHOO") ||
2705 ContactLine.Mid(0, 7) == wxT("X-SKYPE") ||
2706 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
2707 ContactLine.Mid(0, 4) == wxT("REV:")){
2709 iterbool->second = TRUE;
2714 if (iterbool->second == TRUE){
2720 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
2726 if (ContactLine.Mid(0, 4) == wxT("item")){
2728 // Line is a itemn... so ignore.
2734 std::map<int,wxString>::iterator itersub = iter;
2736 while (ExtraLineSeek == TRUE){
2738 // Check if there is extra data on the next line
2739 // (indicated by space or tab at the start) and add data.
2741 if (itersub == ContactFileLines.end()){
2750 iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2752 if (iterboolsub == ContactFileProcessedWorking.end()){
2758 if (iterboolsub->second == TRUE){
2764 if (itersub == ContactFileLines.end()){
2770 wxSPropertyNextLine = itersub->second;
2772 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2774 wxSPropertyNextLine.Remove(0, 1);
2775 //wxSPropertyNextLine.Trim(FALSE);
2776 //ContactLine.Trim();
2777 ContactLine.Append(wxSPropertyNextLine);
2778 iterboolsub->second = TRUE;
2782 ExtraLineSeek = FALSE;
2788 ContactLineLen = ContactLine.Len();
2790 for (int i = 0; i <= ContactLineLen; i++){
2792 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2794 PropertyFind = FALSE;
2796 } else if (PropertyFind == TRUE){
2798 wxSProperty.Append(ContactLine.Mid(i, 1));
2802 if (ContactLine.Mid(i, 1) == wxT("\"")){
2804 if (QuoteMode == TRUE){
2816 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2818 QuoteBreakPoint = i;
2825 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
2826 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
2828 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
2829 wxSProperty = wxSPropertySegSplit.GetNextToken();
2831 std::map<int,int> DataLineProcess;
2832 std::map<int, bool>::iterator DLSLiter;
2833 int DataLineSeek = 0;
2835 // Look for the X-VCARD4-(variablename) equivilant.
2837 wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
2839 // Sort out remainder of the types.
2841 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2,
2842 &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value,
2843 &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
2845 wxString FinalPropertyData;
2847 FinalPropertyData.Append(wxSPropertyNameConv);
2849 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin();
2850 striter != PropertyData.end(); ++striter){
2852 FinalPropertyData.Append(wxT(";"));
2853 FinalPropertyData.Append(striter->first);
2854 FinalPropertyData.Append(wxT("="));
2855 FinalPropertyData.Append(striter->second);
2859 wxString FinalPropValue;
2861 if (wxSPropertyXVCard4Value.IsEmpty()){
2863 FinalPropValue = wxSPropertyData;
2867 if (wxSPropertyXVCard4Value != wxSPropertyData){
2869 FinalPropValue = wxSPropertyXVCard4Value;
2875 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
2877 wxSProperty.clear();
2878 wxSPropertySub.Clear();
2879 wxSPropertySeg1.Clear();
2880 wxSPropertySeg2.Clear();
2881 wxSPropertyValues.Clear();
2882 wxSPropertyData.Clear();
2883 wxSPropertyXVCard4Value.Clear();
2884 wxSPropertyNameConv.Clear();
2885 //FinalPropertyData.clear();
2886 //FinalPropValue.clear();
2887 PropertyData.clear();
2888 PropertyLock.clear();
2889 ContactLine.clear();
2890 XVCard4Value = FALSE;
2891 VCard3Value = FALSE;
2897 int NicknameCount = 0;
2906 int RelatedCount = 0;
2911 int CategoryCount = 0;
2915 int CalAdrCount = 0;
2916 int CalReqAdrCount = 0;
2917 int FreeBusyCount = 0;
2919 int VendorCount = 0;
2920 int XTokenCount = 0;
2922 int MaxItemNumber = 0;
2923 int ItemOrdered = 0;
2924 int ItemUnordered = 0;
2926 int ItemStringSeekLen = 0;
2927 int ItemSeekSub = 0;
2928 int ItemSeekSecSub = 0;
2929 //int intValueSeek = 1;
2931 std::map<int, wxString> NumberedName;
2932 std::map<int, wxString> NumberedData;
2933 std::map<int, wxString> NumberedPropValues;
2934 std::map<int, wxString> NumberedPropOldValue;
2936 std::map<int, wxString> UnNumberedName;
2937 std::map<int, wxString> UnNumberedData;
2938 std::map<int, wxString> UnNumberedPropValues;
2939 std::map<int, wxString> UnNumberedPropOldValue;
2941 // Part 1: Get the itemn number.
2943 std::map<int,bool>::iterator iterboolsecsub;
2944 std::map<int,wxString>::iterator itersub;
2945 std::map<int, wxString> TempData;
2946 PropertyData.clear();
2947 PropertyLock.clear();
2948 wxString ItemString;
2949 wxString ItemStringSeek;
2950 wxString ItemPropName;
2951 ContactLineSeek = 0;
2953 ContactLineSub.clear();
2954 ExtraLineSeekSub = 0;
2955 wxString wxSPropertyNextLineSub;
2956 ContactLineSubLen = 0;
2957 int ContactLineSeekSub = 0;
2959 PropertFindSub.clear();
2960 wxSPropertySub.clear();
2961 wxSPropertySeg1Sub.clear();
2962 wxSPropertySeg2Sub.clear();
2963 wxSPropertyValues.clear();
2964 wxSPropertyData.clear();
2965 wxSPropertyNameConv.clear();
2966 wxSPropertyXVCard4Value.clear();
2967 ItemProcString.clear();
2969 XVCard4Value = FALSE;
2970 VCard3Value = FALSE;
2971 SeekItemData = FALSE;
2973 std::map<wxString, void*> ItemMapIndex;
2974 //std::map<wxString, wxString> ItemNameIndex;
2976 // Look for item in the initial line, process into a proper line then
2977 // look for other lines with the same item association.
2979 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
2980 iter != ContactFileLines.end(); ++iter){
2982 ExtraLineSeek = TRUE;
2984 iterbool = ContactFileProcessed.find(iter->first);
2986 if (iterbool->second == TRUE){
2992 ContactLine = iter->second;
2994 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
3000 if (ContactLine.Mid(0, 4) != wxT("item")){
3008 //ContactLineSeekSub = ContactLineSeek;
3009 std::map<int,wxString>::iterator itersub = iter;
3011 while (ExtraLineSeek == TRUE){
3013 // Check if there is extra data on the next line
3014 // (indicated by space or tab at the start) and add data.
3017 iterboolsub = ContactFileProcessed.find(itersub->first);
3019 if (iterboolsub == ContactFileProcessed.end()){
3025 if (iterboolsub->second == TRUE){
3031 if (itersub == ContactFileLines.end()){
3037 wxSPropertyNextLine = itersub->second;
3039 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
3041 wxSPropertyNextLine.Remove(0, 1);
3042 //wxSPropertyNextLine.Trim(FALSE);
3043 //ContactLine.Trim();
3044 ContactLine.Append(wxSPropertyNextLine);
3045 iterboolsub->second = TRUE;
3049 ExtraLineSeek = FALSE;
3055 ContactLineLen = ContactLine.Len();
3057 for (int i = 0; i <= ContactLineLen; i++){
3059 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
3061 PropertyFind = FALSE;
3063 } else if (PropertyFind == TRUE){
3065 wxSProperty.Append(ContactLine.Mid(i, 1));
3069 if (ContactLine.Mid(i, 1) == wxT("\"")){
3071 if (QuoteMode == TRUE){
3083 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
3085 QuoteBreakPoint = i;
3092 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
3093 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
3095 // Go through the lines and collect the lines like itemn.
3097 std::map<int,wxString> *ItemListData;
3098 ItemListData = new std::map<int,wxString>;
3100 wxStringTokenizer ItemData(wxSPropertySeg1, wxT("."));
3102 ItemString = ItemData.GetNextToken();
3103 ItemStringSeek = wxT("item") + ItemString.Mid(4);
3105 wxStringTokenizer ItemPropSplit(ItemData.GetNextToken(), wxT(";"));
3107 ItemPropName = ItemPropSplit.GetNextToken();
3109 ItemStringSeekLen = ItemStringSeek.Len();
3113 for (std::map<int,wxString>::iterator itersec = ContactFileLines.begin();
3114 itersec != ContactFileLines.end(); ++itersec){
3116 ExtraLineSeek = TRUE;
3118 iterboolsub = ContactFileProcessed.find(itersec->first);
3120 if (iterboolsub->second == TRUE){
3126 ContactLineSub = itersec->second;
3128 wxStringTokenizer ItemProcData(ContactLineSub, wxT("."));
3129 ItemProcString = ItemData.GetNextToken();
3131 if (ItemStringSeek != ContactLineSub.Mid(0, ItemStringSeekLen)){
3139 ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
3141 iterboolsub->second = TRUE;
3145 //ItemNameIndex.insert(std::make_pair(ItemStringSeek, ItemPropName));
3146 ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
3147 ItemMapIndex.insert(std::make_pair(ItemStringSeek, ItemListData));
3151 // Process each itemn set.
3153 for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
3154 iter != ItemMapIndex.end(); ++iter){
3156 std::map<int, wxString> *ItemDataPtr;
3158 ItemDataPtr = (std::map<int,wxString>*)iter->second;
3160 for (std::map<int,wxString>::iterator itersub = ItemDataPtr->begin();
3161 itersub != ItemDataPtr->end(); ++itersub){
3163 ContactLine = itersub->second;
3165 ContactLineLen = ContactLine.Len();
3167 for (int i = 0; i <= ContactLineLen; i++){
3169 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
3171 PropertyFind = FALSE;
3173 } else if (PropertyFind == TRUE){
3175 wxSProperty.Append(ContactLine.Mid(i, 1));
3179 if (ContactLine.Mid(i, 1) == wxT("\"")){
3181 if (QuoteMode == TRUE){
3193 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
3195 QuoteBreakPoint = i;
3202 wxSPropertySeg1Sub = ContactLine.Mid(0, QuoteBreakPoint);
3203 wxSPropertySeg2Sub = ContactLine.Mid((QuoteBreakPoint + 1));
3205 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1Sub, wxT(";"));
3206 wxSProperty = wxSPropertySegSplit.GetNextToken();
3208 // Sort out remainder of the types.
3210 // Skip certain X-* IM variables as they are processed via
3213 if (wxSProperty == wxT("X-AIM") || wxSProperty == wxT("X-MSN") ||
3214 wxSProperty == wxT("X-ICQ") || wxSProperty == wxT("X-GADUGADU") ||
3215 wxSProperty == wxT("X-YAHOO") || wxSProperty == wxT("X-SKYPE") ||
3216 wxSProperty == wxT("X-JABBER")){
3218 wxSProperty.clear();
3219 wxSPropertySub.Clear();
3220 wxSPropertySeg1.Clear();
3221 wxSPropertySeg2.Clear();
3222 wxSPropertyValues.Clear();
3223 wxSPropertyData.Clear();
3224 wxSPropertyXVCard4Value.Clear();
3225 wxSPropertyNameConv.Clear();
3226 //FinalPropertyData.clear();
3227 //FinalPropValue.clear();
3228 PropertyData.clear();
3229 PropertyLock.clear();
3230 ContactLine.clear();
3231 XVCard4Value = FALSE;
3232 VCard3Value = FALSE;
3237 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1Sub, &wxSPropertySeg2Sub,
3238 &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value,
3239 &wxSPropertyNameConv, &PropertyData, &PropertyLock, TRUE, &VCard3Value, &XVCard4Value);
3243 if (wxSPropertyNameConv.IsEmpty()){
3245 wxSProperty.clear();
3246 wxSPropertySub.Clear();
3247 wxSPropertySeg1.Clear();
3248 wxSPropertySeg2.Clear();
3249 wxSPropertyValues.Clear();
3250 wxSPropertyData.Clear();
3251 wxSPropertyXVCard4Value.Clear();
3252 wxSPropertyNameConv.Clear();
3253 //FinalPropertyData.clear();
3254 //FinalPropValue.clear();
3255 PropertyData.clear();
3256 PropertyLock.clear();
3257 ContactLine.clear();
3258 XVCard4Value = FALSE;
3259 VCard3Value = FALSE;
3264 wxString FinalPropertyData;
3266 FinalPropertyData.Append(wxSPropertyNameConv);
3268 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin();
3269 striter != PropertyData.end(); ++striter){
3271 FinalPropertyData.Append(wxT(";"));
3272 FinalPropertyData.Append(striter->first);
3273 FinalPropertyData.Append(wxT("="));
3274 FinalPropertyData.Append(striter->second);
3278 wxString FinalPropValue;
3280 if (wxSPropertyXVCard4Value.IsEmpty()){
3282 FinalPropValue = wxSPropertyData;
3286 if (wxSPropertyXVCard4Value != wxSPropertyData){
3288 FinalPropValue = wxSPropertyData;
3292 FinalPropValue = wxSPropertyXVCard4Value;
3298 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
3300 wxSProperty.clear();
3301 wxSPropertySub.Clear();
3302 wxSPropertySeg1Sub.Clear();
3303 wxSPropertySeg2Sub.Clear();
3304 wxSPropertyValues.Clear();
3305 wxSPropertyData.Clear();
3306 wxSPropertyXVCard4Value.Clear();
3307 wxSPropertyNameConv.Clear();
3308 FinalPropertyData.clear();
3309 FinalPropValue.clear();
3310 PropertyData.clear();
3311 PropertyLock.clear();
3312 ContactLine.clear();
3313 XVCard4Value = FALSE;
3314 VCard3Value = FALSE;
3317 //PropertyData.clear();
3318 //PropertyLock.clear();
3324 std::map<int, wxString> *ItemEraseData;
3326 for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
3327 iter != ItemMapIndex.end(); ++iter){
3329 ItemEraseData = (std::map<int,wxString>*)iter->second;
3331 delete ItemEraseData;
3332 ItemEraseData = NULL;
3336 ItemMapIndex.clear();
3338 vCardOut->AddRaw(wxT("END"), wxT("VCARD"));
3344 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
3345 wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr,
3346 wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut,
3347 wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
3348 std::map<wxString,wxString> *PropertyDataMap,
3349 std::map<wxString,bool> *PropertyLockMap,
3350 bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
3352 wxString wxSProperty;
3353 wxString wxSPropertySeg1Chopped;
3355 if (ProcessItemData == TRUE){
3357 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
3359 wxSPropertySplit.GetNextToken();
3360 wxSProperty = wxSPropertySplit.GetNextToken();
3362 // Look for . in wxSPropertySeg1Ptr and remove all data before
3365 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
3366 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
3371 wxSProperty = *wxSPropertyName;
3376 // Go through each of the vCard 3.0 properties.
3380 if (wxSProperty == wxT("EMAIL")){
3384 if (ProcessItemData == TRUE){
3386 intPropertyLen = wxSPropertySeg1Chopped.Len();
3390 intPropertyLen = wxSPropertySeg1Ptr->Len();
3394 std::map<int, int> SplitPoints;
3395 std::map<int, int> SplitLength;
3396 std::map<int, int>::iterator SLiter;
3397 wxString PropertyData;
3398 wxString PropertyName;
3399 wxString PropertyValue;
3400 wxString PropertyTokens;
3401 bool AfterFirstToken = FALSE;
3402 bool FirstToken = TRUE;
3403 int intSplitsFound = 0;
3404 int intSplitSize = 0;
3405 int intPrevValue = 7;
3408 int intSplitSeek = 0;
3411 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3412 *wxSPropertyDataNameOut = wxT("EMAIL");
3413 *VCardV3Value = TRUE;
3415 if (ProcessItemData == TRUE){
3417 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3421 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3425 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3426 intiter != SplitPoints.end(); ++intiter){
3428 SLiter = SplitLength.find(intiter->first);
3430 if (ProcessItemData == TRUE){
3432 if (FirstToken == TRUE){
3434 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3439 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3445 if (FirstToken == TRUE){
3447 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3452 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3458 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3459 PropertyName = PropertyElement.GetNextToken();
3460 PropertyValue = PropertyElement.GetNextToken();
3462 //ProcessCaptureStrings(&PropertyValue);
3464 intPrevValue = intiter->second;
3466 if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
3470 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3472 if (ProcessItemData == FALSE){
3473 PropertyName = wxT("PREF");
3474 PropertyValue = wxT("50");
3481 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3482 PropertyValue = wxT("home");
3485 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3486 PropertyValue = wxT("work");
3489 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3490 PropertyName = wxT("X-TYPE");
3491 PropertyValue = wxT("other");
3494 // Process properties.
3496 if (PropertyName.IsEmpty()){
3502 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3504 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3505 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3509 PropertyDataMap->erase(PropertyName);
3510 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3511 PropertyLockMap->erase(PropertyName);
3512 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3522 if (wxSProperty == wxT("ADR")){
3526 if (ProcessItemData == TRUE){
3528 intPropertyLen = wxSPropertySeg1Chopped.Len();
3532 intPropertyLen = wxSPropertySeg1Ptr->Len();
3536 std::map<int, int> SplitPoints;
3537 std::map<int, int> SplitLength;
3538 std::map<int, int>::iterator SLiter;
3539 wxString PropertyData;
3540 wxString PropertyName;
3541 wxString PropertyValue;
3542 wxString PropertyTokens;
3543 bool AfterFirstToken = FALSE;
3544 bool FirstToken = TRUE;
3545 int intSplitsFound = 0;
3546 int intSplitSize = 0;
3547 int intPrevValue = 5;
3550 int intSplitSeek = 0;
3553 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3554 *wxSPropertyDataNameOut = wxT("ADR");
3555 *VCardV3Value = TRUE;
3557 if (ProcessItemData == TRUE){
3559 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3563 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3567 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3568 intiter != SplitPoints.end(); ++intiter){
3570 SLiter = SplitLength.find(intiter->first);
3572 if (ProcessItemData == TRUE){
3574 if (FirstToken == TRUE){
3576 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3581 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3587 if (FirstToken == TRUE){
3589 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3594 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3600 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3601 PropertyName = PropertyElement.GetNextToken();
3602 PropertyValue = PropertyElement.GetNextToken();
3604 //ProcessCaptureStrings(&PropertyValue);
3606 intPrevValue = intiter->second;
3608 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3610 if (ProcessItemData == FALSE){
3611 PropertyName = wxT("PREF");
3612 PropertyValue = wxT("50");
3619 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3620 PropertyValue = wxT("home");
3623 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3624 PropertyValue = wxT("work");
3627 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3628 PropertyName = wxT("X-TYPE");
3629 PropertyValue = wxT("other");
3632 // Process properties.
3634 if (PropertyName.IsEmpty()){
3640 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3642 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3643 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3647 PropertyDataMap->erase(PropertyName);
3648 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3649 PropertyLockMap->erase(PropertyName);
3650 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3660 if (wxSProperty == wxT("LABEL")){
3664 if (ProcessItemData == TRUE){
3666 intPropertyLen = wxSPropertySeg1Chopped.Len();
3670 intPropertyLen = wxSPropertySeg1Ptr->Len();
3674 std::map<int, int> SplitPoints;
3675 std::map<int, int> SplitLength;
3676 std::map<int, int>::iterator SLiter;
3677 wxString PropertyData;
3678 wxString PropertyName;
3679 wxString PropertyValue;
3680 wxString PropertyTokens;
3681 bool AfterFirstToken = FALSE;
3682 bool FirstToken = TRUE;
3683 int intSplitsFound = 0;
3684 int intSplitSize = 0;
3685 int intPrevValue = 7;
3688 int intSplitSeek = 0;
3691 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3692 *wxSPropertyDataNameOut = wxT("ADR");
3693 *VCardV3Value = TRUE;
3695 if (ProcessItemData == TRUE){
3697 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3701 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3705 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3706 intiter != SplitPoints.end(); ++intiter){
3708 SLiter = SplitLength.find(intiter->first);
3710 if (ProcessItemData == TRUE){
3712 if (FirstToken == TRUE){
3714 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3719 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3725 if (FirstToken == TRUE){
3727 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3732 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3738 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3739 PropertyName = PropertyElement.GetNextToken();
3740 PropertyValue = PropertyElement.GetNextToken();
3742 //ProcessCaptureStrings(&PropertyValue);
3744 intPrevValue = intiter->second;
3746 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3750 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3751 PropertyValue = wxT("home");
3754 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3755 PropertyValue = wxT("work");
3758 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3759 PropertyName = wxT("X-TYPE");
3760 PropertyValue = wxT("other");
3763 // Process properties.
3765 if (PropertyName.IsEmpty()){
3771 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3773 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3774 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3778 PropertyDataMap->erase(PropertyName);
3779 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3780 PropertyLockMap->erase(PropertyName);
3781 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3787 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
3793 if (wxSProperty == wxT("IMPP")){
3797 if (ProcessItemData == TRUE){
3799 intPropertyLen = wxSPropertySeg1Chopped.Len();
3803 intPropertyLen = wxSPropertySeg1Ptr->Len();
3807 std::map<int, int> SplitPoints;
3808 std::map<int, int> SplitLength;
3809 std::map<int, int>::iterator SLiter;
3810 wxString PropertyData;
3811 wxString PropertyName;
3812 wxString PropertyValue;
3813 wxString PropertyTokens;
3814 bool AfterFirstToken = FALSE;
3815 bool FirstToken = TRUE;
3816 int intSplitsFound = 0;
3817 int intSplitSize = 0;
3818 int intPrevValue = 6;
3821 int intSplitSeek = 0;
3824 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
3828 IMPPType = IMPPSplit.GetNextToken();
3830 if (IMPPSplit.HasMoreTokens()){
3832 IMPPData = IMPPSplit.GetNextToken();
3834 if (IMPPType == wxT("ymsgr")){
3836 IMPPType = wxT("yahoo");
3840 *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
3844 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3845 *wxSPropertyDataNameOut = wxT("IMPP");
3846 *VCardV3Value = TRUE;
3848 if (ProcessItemData == TRUE){
3850 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3854 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3858 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3859 intiter != SplitPoints.end(); ++intiter){
3861 SLiter = SplitLength.find(intiter->first);
3863 if (ProcessItemData == TRUE){
3865 if (FirstToken == TRUE){
3867 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3872 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3878 if (FirstToken == TRUE){
3880 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3885 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3891 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3892 PropertyName = PropertyElement.GetNextToken();
3893 PropertyValue = PropertyElement.GetNextToken();
3895 //ProcessCaptureStrings(&PropertyValue);
3897 intPrevValue = intiter->second;
3899 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3903 if (PropertyName == wxT("X-SERVICE-TYPE")){
3907 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3908 PropertyValue = wxT("home");
3911 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3912 PropertyValue = wxT("work");
3915 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3916 PropertyName = wxT("X-TYPE");
3917 PropertyValue = wxT("other");
3920 // Process properties.
3922 if (PropertyName.IsEmpty()){
3928 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3930 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3931 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3935 PropertyDataMap->erase(PropertyName);
3936 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3937 PropertyLockMap->erase(PropertyName);
3938 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3948 if (wxSProperty == wxT("TEL")){
3952 if (ProcessItemData == TRUE){
3954 intPropertyLen = wxSPropertySeg1Chopped.Len();
3958 intPropertyLen = wxSPropertySeg1Ptr->Len();
3962 std::map<int, int> SplitPoints;
3963 std::map<int, int> SplitLength;
3964 std::map<int, int>::iterator SLiter;
3965 std::map<wxString, wxString> TelType;
3966 wxString PropertyData;
3967 wxString PropertyName;
3968 wxString PropertyValue;
3969 wxString PropertyTokens;
3970 bool AfterFirstToken = FALSE;
3971 bool FirstToken = TRUE;
3972 int intSplitsFound = 0;
3973 int intSplitSize = 0;
3974 int intPrevValue = 5;
3977 int intSplitSeek = 0;
3980 wxSPropertyDataOut->Append(wxT("tel:"));
3981 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3982 *wxSPropertyDataNameOut = wxT("TEL");
3983 *VCardV3Value = TRUE;
3985 if (ProcessItemData == TRUE){
3987 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3991 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3995 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3996 intiter != SplitPoints.end(); ++intiter){
3998 SLiter = SplitLength.find(intiter->first);
4000 if (ProcessItemData == TRUE){
4002 if (FirstToken == TRUE){
4004 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4009 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4015 if (FirstToken == TRUE){
4017 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4022 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4028 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4029 PropertyName = PropertyElement.GetNextToken();
4030 PropertyValue = PropertyElement.GetNextToken();
4032 //ProcessCaptureStrings(&PropertyValue);
4034 intPrevValue = intiter->second;
4036 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
4040 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
4041 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
4045 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
4046 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
4050 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
4051 PropertyName = wxT("X-TYPE");
4052 PropertyValue = wxT("other");
4055 // Process the telephone type options.
4059 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
4060 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
4066 if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
4067 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
4073 if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
4074 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
4080 if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
4081 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
4087 if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
4088 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
4094 if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
4095 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
4101 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
4102 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
4106 if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
4107 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
4108 wxString TypeSplitData;
4109 while (TypeSplit.HasMoreTokens()){
4111 TypeSplitData = TypeSplit.GetNextToken();
4112 TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
4113 TypeSplitData.clear();
4119 // Process properties.
4121 if (PropertyName.IsEmpty()){
4127 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4129 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4130 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4134 PropertyDataMap->erase(PropertyName);
4135 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4136 PropertyLockMap->erase(PropertyName);
4137 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4143 wxString TelFinalString;
4144 bool TelFirstToken = TRUE;
4146 for (std::map<wxString, wxString>::iterator intiter = TelType.begin();
4147 intiter != TelType.end(); ++intiter){
4149 // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
4151 if (TelFirstToken == TRUE){
4153 TelFinalString.Append(wxT("\""));
4154 TelFinalString.Append(intiter->first);
4155 TelFirstToken = FALSE;
4159 TelFinalString.Append(wxT(","));
4160 TelFinalString.Append(intiter->first);
4166 if (TelFirstToken == FALSE){
4168 TelFinalString.Append(wxT("\""));
4172 if (!TelFinalString.IsEmpty()){
4174 if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
4176 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
4177 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
4181 PropertyDataMap->erase(PropertyName);
4182 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
4183 PropertyLockMap->erase(PropertyName);
4184 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
4194 if (wxSProperty == wxT("X-ABRELATEDNAMES")){
4198 if (ProcessItemData == TRUE){
4200 intPropertyLen = wxSPropertySeg1Chopped.Len();
4204 intPropertyLen = wxSPropertySeg1Ptr->Len();
4208 std::map<int, int> SplitPoints;
4209 std::map<int, int> SplitLength;
4210 std::map<int, int>::iterator SLiter;
4211 wxString PropertyData;
4212 wxString PropertyName;
4213 wxString PropertyValue;
4214 wxString PropertyTokens;
4215 bool AfterFirstToken = FALSE;
4216 bool FirstToken = TRUE;
4217 int intSplitsFound = 0;
4218 int intSplitSize = 0;
4219 int intPrevValue = 18;
4222 int intSplitSeek = 0;
4225 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4226 *wxSPropertyDataNameOut = wxT("RELATED");
4227 *VCardV3Value = TRUE;
4229 if (ProcessItemData == TRUE){
4231 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4235 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4239 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4240 intiter != SplitPoints.end(); ++intiter){
4242 SLiter = SplitLength.find(intiter->first);
4244 if (ProcessItemData == TRUE){
4246 if (FirstToken == TRUE){
4248 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4253 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4259 if (FirstToken == TRUE){
4261 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4266 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4272 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4273 PropertyName = PropertyElement.GetNextToken();
4274 PropertyValue = PropertyElement.GetNextToken();
4276 //ProcessCaptureStrings(&PropertyValue);
4278 intPrevValue = intiter->second;
4280 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
4284 // Process properties.
4286 if (PropertyName.IsEmpty()){
4292 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4294 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4295 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4299 PropertyDataMap->erase(PropertyName);
4300 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4301 PropertyLockMap->erase(PropertyName);
4302 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4312 if (wxSProperty == wxT("URL")){
4316 if (ProcessItemData == TRUE){
4318 intPropertyLen = wxSPropertySeg1Chopped.Len();
4322 intPropertyLen = wxSPropertySeg1Ptr->Len();
4326 std::map<int, int> SplitPoints;
4327 std::map<int, int> SplitLength;
4328 std::map<int, int>::iterator SLiter;
4329 wxString PropertyData;
4330 wxString PropertyName;
4331 wxString PropertyValue;
4332 wxString PropertyTokens;
4333 bool AfterFirstToken = FALSE;
4334 bool FirstToken = TRUE;
4335 int intSplitsFound = 0;
4336 int intSplitSize = 0;
4337 int intPrevValue = 5;
4340 int intSplitSeek = 0;
4343 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4344 *wxSPropertyDataNameOut = wxT("URL");
4345 *VCardV3Value = TRUE;
4347 if (ProcessItemData == TRUE){
4349 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4353 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4357 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4358 intiter != SplitPoints.end(); ++intiter){
4360 SLiter = SplitLength.find(intiter->first);
4362 if (ProcessItemData == TRUE){
4364 if (FirstToken == TRUE){
4366 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4371 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4377 if (FirstToken == TRUE){
4379 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4384 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4390 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4391 PropertyName = PropertyElement.GetNextToken();
4392 PropertyValue = PropertyElement.GetNextToken();
4394 //ProcessCaptureStrings(&PropertyValue);
4396 intPrevValue = intiter->second;
4398 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
4402 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
4403 PropertyValue = wxT("home");
4406 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
4407 PropertyValue = wxT("work");
4410 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
4411 PropertyName = wxT("X-TYPE");
4412 PropertyValue = wxT("other");
4415 // Process properties.
4417 if (PropertyName.IsEmpty()){
4423 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4425 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4426 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4430 PropertyDataMap->erase(PropertyName);
4431 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4432 PropertyLockMap->erase(PropertyName);
4433 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4443 if (wxSProperty == wxT("TITLE")){
4447 if (ProcessItemData == TRUE){
4449 intPropertyLen = wxSPropertySeg1Chopped.Len();
4453 intPropertyLen = wxSPropertySeg1Ptr->Len();
4457 std::map<int, int> SplitPoints;
4458 std::map<int, int> SplitLength;
4459 std::map<int, int>::iterator SLiter;
4460 wxString PropertyData;
4461 wxString PropertyName;
4462 wxString PropertyValue;
4463 wxString PropertyTokens;
4464 bool AfterFirstToken = FALSE;
4465 bool FirstToken = TRUE;
4466 int intSplitsFound = 0;
4467 int intSplitSize = 0;
4468 int intPrevValue = 7;
4471 int intSplitSeek = 0;
4474 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4475 *wxSPropertyDataNameOut = wxT("TITLE");
4476 *VCardV3Value = TRUE;
4478 if (ProcessItemData == TRUE){
4480 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4484 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4488 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4489 intiter != SplitPoints.end(); ++intiter){
4491 SLiter = SplitLength.find(intiter->first);
4493 if (ProcessItemData == TRUE){
4495 if (FirstToken == TRUE){
4497 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4502 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4508 if (FirstToken == TRUE){
4510 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4515 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4521 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4522 PropertyName = PropertyElement.GetNextToken();
4523 PropertyValue = PropertyElement.GetNextToken();
4525 //ProcessCaptureStrings(&PropertyValue);
4527 intPrevValue = intiter->second;
4529 // Process properties.
4531 if (PropertyName.IsEmpty()){
4537 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4539 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4540 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4544 PropertyDataMap->erase(PropertyName);
4545 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4546 PropertyLockMap->erase(PropertyName);
4547 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4557 if (wxSProperty == wxT("FN")){
4561 if (ProcessItemData == TRUE){
4563 intPropertyLen = wxSPropertySeg1Chopped.Len();
4567 intPropertyLen = wxSPropertySeg1Ptr->Len();
4571 std::map<int, int> SplitPoints;
4572 std::map<int, int> SplitLength;
4573 std::map<int, int>::iterator SLiter;
4574 wxString PropertyData;
4575 wxString PropertyName;
4576 wxString PropertyValue;
4577 wxString PropertyTokens;
4578 bool AfterFirstToken = FALSE;
4579 bool FirstToken = TRUE;
4580 int intSplitsFound = 0;
4581 int intSplitSize = 0;
4582 int intPrevValue = 4;
4585 int intSplitSeek = 0;
4588 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4589 *wxSPropertyDataNameOut = wxT("FN");
4590 *VCardV3Value = TRUE;
4592 if (ProcessItemData == TRUE){
4594 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4598 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4602 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4603 intiter != SplitPoints.end(); ++intiter){
4605 SLiter = SplitLength.find(intiter->first);
4607 if (ProcessItemData == TRUE){
4609 if (FirstToken == TRUE){
4611 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4616 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4622 if (FirstToken == TRUE){
4624 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4629 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4635 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4636 PropertyName = PropertyElement.GetNextToken();
4637 PropertyValue = PropertyElement.GetNextToken();
4639 //ProcessCaptureStrings(&PropertyValue);
4641 intPrevValue = intiter->second;
4643 // Process properties.
4645 if (PropertyName.IsEmpty()){
4651 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4653 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4654 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4658 PropertyDataMap->erase(PropertyName);
4659 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4660 PropertyLockMap->erase(PropertyName);
4661 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4671 if (wxSProperty == wxT("N")){
4675 if (ProcessItemData == TRUE){
4677 intPropertyLen = wxSPropertySeg1Chopped.Len();
4681 intPropertyLen = wxSPropertySeg1Ptr->Len();
4685 std::map<int, int> SplitPoints;
4686 std::map<int, int> SplitLength;
4687 std::map<int, int>::iterator SLiter;
4688 wxString PropertyData;
4689 wxString PropertyName;
4690 wxString PropertyValue;
4691 wxString PropertyTokens;
4692 bool AfterFirstToken = FALSE;
4693 bool FirstToken = TRUE;
4694 int intSplitsFound = 0;
4695 int intSplitSize = 0;
4696 int intPrevValue = 3;
4699 int intSplitSeek = 0;
4702 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4703 *wxSPropertyDataNameOut = wxT("N");
4704 *VCardV3Value = TRUE;
4706 if (ProcessItemData == TRUE){
4708 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4712 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4716 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4717 intiter != SplitPoints.end(); ++intiter){
4719 SLiter = SplitLength.find(intiter->first);
4721 if (ProcessItemData == TRUE){
4723 if (FirstToken == TRUE){
4725 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4730 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4736 if (FirstToken == TRUE){
4738 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4743 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4749 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4750 PropertyName = PropertyElement.GetNextToken();
4751 PropertyValue = PropertyElement.GetNextToken();
4753 //ProcessCaptureStrings(&PropertyValue);
4755 intPrevValue = intiter->second;
4757 // Process properties.
4759 if (PropertyName.IsEmpty()){
4765 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4767 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4768 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4772 PropertyDataMap->erase(PropertyName);
4773 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4774 PropertyLockMap->erase(PropertyName);
4775 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4785 if (wxSProperty == wxT("UID")){
4789 if (ProcessItemData == TRUE){
4791 intPropertyLen = wxSPropertySeg1Chopped.Len();
4795 intPropertyLen = wxSPropertySeg1Ptr->Len();
4799 std::map<int, int> SplitPoints;
4800 std::map<int, int> SplitLength;
4801 std::map<int, int>::iterator SLiter;
4802 wxString PropertyData;
4803 wxString PropertyName;
4804 wxString PropertyValue;
4805 wxString PropertyTokens;
4806 bool AfterFirstToken = FALSE;
4807 bool FirstToken = TRUE;
4808 int intSplitsFound = 0;
4809 int intSplitSize = 0;
4810 int intPrevValue = 5;
4813 int intSplitSeek = 0;
4816 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4817 *wxSPropertyDataNameOut = wxT("UID");
4818 *VCardV3Value = TRUE;
4820 if (ProcessItemData == TRUE){
4822 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4826 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4830 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4831 intiter != SplitPoints.end(); ++intiter){
4833 SLiter = SplitLength.find(intiter->first);
4835 if (ProcessItemData == TRUE){
4837 if (FirstToken == TRUE){
4839 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4844 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4850 if (FirstToken == TRUE){
4852 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4857 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4863 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4864 PropertyName = PropertyElement.GetNextToken();
4865 PropertyValue = PropertyElement.GetNextToken();
4867 //ProcessCaptureStrings(&PropertyValue);
4869 intPrevValue = intiter->second;
4871 // Process properties.
4873 if (PropertyName.IsEmpty()){
4879 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4881 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4882 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4886 PropertyDataMap->erase(PropertyName);
4887 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4888 PropertyLockMap->erase(PropertyName);
4889 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4899 if (wxSProperty == wxT("NICKNAME")){
4903 if (ProcessItemData == TRUE){
4905 intPropertyLen = wxSPropertySeg1Chopped.Len();
4909 intPropertyLen = wxSPropertySeg1Ptr->Len();
4913 std::map<int, int> SplitPoints;
4914 std::map<int, int> SplitLength;
4915 std::map<int, int>::iterator SLiter;
4916 wxString PropertyData;
4917 wxString PropertyName;
4918 wxString PropertyValue;
4919 wxString PropertyTokens;
4920 bool AfterFirstToken = FALSE;
4921 bool FirstToken = TRUE;
4922 int intSplitsFound = 0;
4923 int intSplitSize = 0;
4924 int intPrevValue = 10;
4927 int intSplitSeek = 0;
4930 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4931 *wxSPropertyDataNameOut = wxT("NICKNAME");
4932 *VCardV3Value = TRUE;
4934 if (ProcessItemData == TRUE){
4936 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4940 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4944 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4945 intiter != SplitPoints.end(); ++intiter){
4947 SLiter = SplitLength.find(intiter->first);
4949 if (ProcessItemData == TRUE){
4951 if (FirstToken == TRUE){
4953 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4958 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4964 if (FirstToken == TRUE){
4966 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4971 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4977 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4978 PropertyName = PropertyElement.GetNextToken();
4979 PropertyValue = PropertyElement.GetNextToken();
4981 //ProcessCaptureStrings(&PropertyValue);
4983 intPrevValue = intiter->second;
4985 // Process properties.
4987 if (PropertyName.IsEmpty()){
4993 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4995 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4996 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5000 PropertyDataMap->erase(PropertyName);
5001 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5002 PropertyLockMap->erase(PropertyName);
5003 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5013 if (wxSProperty == wxT("GENDER")){
5017 if (ProcessItemData == TRUE){
5019 intPropertyLen = wxSPropertySeg1Chopped.Len();
5023 intPropertyLen = wxSPropertySeg1Ptr->Len();
5027 std::map<int, int> SplitPoints;
5028 std::map<int, int> SplitLength;
5029 std::map<int, int>::iterator SLiter;
5030 wxString PropertyData;
5031 wxString PropertyName;
5032 wxString PropertyValue;
5033 wxString PropertyTokens;
5034 bool AfterFirstToken = FALSE;
5035 bool FirstToken = TRUE;
5036 int intSplitsFound = 0;
5037 int intSplitSize = 0;
5038 int intPrevValue = 8;
5041 int intSplitSeek = 0;
5044 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5045 *wxSPropertyDataNameOut = wxT("GENDER");
5046 *VCardV3Value = TRUE;
5048 if (ProcessItemData == TRUE){
5050 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5054 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5058 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5059 intiter != SplitPoints.end(); ++intiter){
5061 SLiter = SplitLength.find(intiter->first);
5063 if (ProcessItemData == TRUE){
5065 if (FirstToken == TRUE){
5067 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5072 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5078 if (FirstToken == TRUE){
5080 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5085 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5091 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5092 PropertyName = PropertyElement.GetNextToken();
5093 PropertyValue = PropertyElement.GetNextToken();
5095 //ProcessCaptureStrings(&PropertyValue);
5097 intPrevValue = intiter->second;
5099 // Process properties.
5101 if (PropertyName.IsEmpty()){
5107 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5109 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5110 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5114 PropertyDataMap->erase(PropertyName);
5115 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5116 PropertyLockMap->erase(PropertyName);
5117 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5127 if (wxSProperty == wxT("BDAY")){
5131 if (ProcessItemData == TRUE){
5133 intPropertyLen = wxSPropertySeg1Chopped.Len();
5137 intPropertyLen = wxSPropertySeg1Ptr->Len();
5141 std::map<int, int> SplitPoints;
5142 std::map<int, int> SplitLength;
5143 std::map<int, int>::iterator SLiter;
5144 wxString PropertyData;
5145 wxString PropertyName;
5146 wxString PropertyValue;
5147 wxString PropertyTokens;
5148 wxString PropertyXOmitYear;
5149 bool AfterFirstToken = FALSE;
5150 bool FirstToken = TRUE;
5151 int intSplitsFound = 0;
5152 int intSplitSize = 0;
5153 int intPrevValue = 6;
5156 int intSplitSeek = 0;
5159 *wxSPropertyDataNameOut = wxT("BDAY");
5160 *VCardV3Value = TRUE;
5162 if (ProcessItemData == TRUE){
5164 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5168 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5172 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5173 intiter != SplitPoints.end(); ++intiter){
5175 SLiter = SplitLength.find(intiter->first);
5177 if (ProcessItemData == TRUE){
5179 if (FirstToken == TRUE){
5181 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5186 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5192 if (FirstToken == TRUE){
5194 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5199 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5205 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5206 PropertyName = PropertyElement.GetNextToken();
5207 PropertyValue = PropertyElement.GetNextToken();
5209 //ProcessCaptureStrings(&PropertyValue);
5211 intPrevValue = intiter->second;
5213 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
5214 PropertyXOmitYear = PropertyValue;
5217 // Process properties.
5219 if (PropertyName.IsEmpty()){
5225 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5227 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5228 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5232 PropertyDataMap->erase(PropertyName);
5233 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5234 PropertyLockMap->erase(PropertyName);
5235 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5241 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
5242 // year matches the X-APPLE-OMIT-YEAR value.
5244 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
5249 DateProc = DateSplit.GetNextToken();
5251 if (DateProc == PropertyXOmitYear){
5253 FinalDate.Append(wxT("--"));
5257 FinalDate.Append(DateProc);
5262 DateProc = DateSplit.GetNextToken();
5264 FinalDate.Append(DateProc);
5267 DateProc = DateSplit.GetNextToken();
5269 FinalDate.Append(DateProc);
5271 wxSPropertyDataOut->Append(FinalDate);
5277 if (wxSProperty == wxT("ANNIVERSARY")){
5281 if (ProcessItemData == TRUE){
5283 intPropertyLen = wxSPropertySeg1Chopped.Len();
5287 intPropertyLen = wxSPropertySeg1Ptr->Len();
5291 std::map<int, int> SplitPoints;
5292 std::map<int, int> SplitLength;
5293 std::map<int, int>::iterator SLiter;
5294 wxString PropertyData;
5295 wxString PropertyName;
5296 wxString PropertyValue;
5297 wxString PropertyTokens;
5298 wxString PropertyXOmitYear;
5299 bool AfterFirstToken = FALSE;
5300 bool FirstToken = TRUE;
5301 int intSplitsFound = 0;
5302 int intSplitSize = 0;
5303 int intPrevValue = 13;
5306 int intSplitSeek = 0;
5309 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
5310 *VCardV3Value = TRUE;
5312 if (ProcessItemData == TRUE){
5314 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5318 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5322 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5323 intiter != SplitPoints.end(); ++intiter){
5325 SLiter = SplitLength.find(intiter->first);
5327 if (ProcessItemData == TRUE){
5329 if (FirstToken == TRUE){
5331 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5336 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5342 if (FirstToken == TRUE){
5344 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5349 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5355 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5356 PropertyName = PropertyElement.GetNextToken();
5357 PropertyValue = PropertyElement.GetNextToken();
5359 //ProcessCaptureStrings(&PropertyValue);
5361 intPrevValue = intiter->second;
5363 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
5364 PropertyXOmitYear = PropertyValue;
5367 // Process properties.
5369 if (PropertyName.IsEmpty()){
5375 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5377 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5378 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5382 PropertyDataMap->erase(PropertyName);
5383 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5384 PropertyLockMap->erase(PropertyName);
5385 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5391 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
5392 // year matches the X-APPLE-OMIT-YEAR value.
5394 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
5399 DateProc = DateSplit.GetNextToken();
5401 if (DateProc == PropertyXOmitYear){
5403 FinalDate.Append(wxT("--"));
5407 FinalDate.Append(DateProc);
5412 DateProc = DateSplit.GetNextToken();
5414 FinalDate.Append(DateProc);
5417 DateProc = DateSplit.GetNextToken();
5419 FinalDate.Append(DateProc);
5421 wxSPropertyDataOut->Append(FinalDate);
5425 // TZ - Not sure how to process this correctly. So data
5426 // is kept as X-VCARD3-TZ for the time being.
5428 if (wxSProperty == wxT("TZ")){
5432 if (ProcessItemData == TRUE){
5434 intPropertyLen = wxSPropertySeg1Chopped.Len();
5438 intPropertyLen = wxSPropertySeg1Ptr->Len();
5442 std::map<int, int> SplitPoints;
5443 std::map<int, int> SplitLength;
5444 std::map<int, int>::iterator SLiter;
5445 wxString PropertyData;
5446 wxString PropertyName;
5447 wxString PropertyValue;
5448 wxString PropertyTokens;
5449 wxString PropertyXOmitYear;
5450 bool AfterFirstToken = FALSE;
5451 bool FirstToken = TRUE;
5452 int intSplitsFound = 0;
5453 int intSplitSize = 0;
5454 int intPrevValue = 4;
5457 int intSplitSeek = 0;
5460 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5461 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
5462 *VCardV3Value = TRUE;
5464 if (ProcessItemData == TRUE){
5466 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5470 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5474 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5475 intiter != SplitPoints.end(); ++intiter){
5477 SLiter = SplitLength.find(intiter->first);
5479 if (ProcessItemData == TRUE){
5481 if (FirstToken == TRUE){
5483 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5488 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5494 if (FirstToken == TRUE){
5496 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5501 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5507 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5508 PropertyName = PropertyElement.GetNextToken();
5509 PropertyValue = PropertyElement.GetNextToken();
5511 //ProcessCaptureStrings(&PropertyValue);
5513 intPrevValue = intiter->second;
5515 // Process properties.
5517 if (PropertyName.IsEmpty()){
5523 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5525 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5526 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5530 PropertyDataMap->erase(PropertyName);
5531 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5532 PropertyLockMap->erase(PropertyName);
5533 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5543 if (wxSProperty == wxT("ROLE")){
5547 if (ProcessItemData == TRUE){
5549 intPropertyLen = wxSPropertySeg1Chopped.Len();
5553 intPropertyLen = wxSPropertySeg1Ptr->Len();
5557 std::map<int, int> SplitPoints;
5558 std::map<int, int> SplitLength;
5559 std::map<int, int>::iterator SLiter;
5560 wxString PropertyData;
5561 wxString PropertyName;
5562 wxString PropertyValue;
5563 wxString PropertyTokens;
5564 wxString PropertyXOmitYear;
5565 bool AfterFirstToken = FALSE;
5566 bool FirstToken = TRUE;
5567 int intSplitsFound = 0;
5568 int intSplitSize = 0;
5569 int intPrevValue = 6;
5572 int intSplitSeek = 0;
5575 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5576 *wxSPropertyDataNameOut = wxT("ROLE");
5577 *VCardV3Value = TRUE;
5579 if (ProcessItemData == TRUE){
5581 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5585 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5589 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5590 intiter != SplitPoints.end(); ++intiter){
5592 SLiter = SplitLength.find(intiter->first);
5594 if (ProcessItemData == TRUE){
5596 if (FirstToken == TRUE){
5598 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5603 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5609 if (FirstToken == TRUE){
5611 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5616 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5622 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5623 PropertyName = PropertyElement.GetNextToken();
5624 PropertyValue = PropertyElement.GetNextToken();
5626 //ProcessCaptureStrings(&PropertyValue);
5628 intPrevValue = intiter->second;
5630 // Process properties.
5632 if (PropertyName.IsEmpty()){
5638 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5640 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5641 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5645 PropertyDataMap->erase(PropertyName);
5646 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5647 PropertyLockMap->erase(PropertyName);
5648 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5658 if (wxSProperty == wxT("ORG")){
5662 if (ProcessItemData == TRUE){
5664 intPropertyLen = wxSPropertySeg1Chopped.Len();
5668 intPropertyLen = wxSPropertySeg1Ptr->Len();
5672 std::map<int, int> SplitPoints;
5673 std::map<int, int> SplitLength;
5674 std::map<int, int>::iterator SLiter;
5675 wxString PropertyData;
5676 wxString PropertyName;
5677 wxString PropertyValue;
5678 wxString PropertyTokens;
5679 wxString PropertyXOmitYear;
5680 bool AfterFirstToken = FALSE;
5681 bool FirstToken = TRUE;
5682 int intSplitsFound = 0;
5683 int intSplitSize = 0;
5684 int intPrevValue = 5;
5687 int intSplitSeek = 0;
5690 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5691 *wxSPropertyDataNameOut = wxT("ORG");
5692 *VCardV3Value = TRUE;
5694 if (ProcessItemData == TRUE){
5696 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5700 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5704 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5705 intiter != SplitPoints.end(); ++intiter){
5707 SLiter = SplitLength.find(intiter->first);
5709 if (ProcessItemData == TRUE){
5711 if (FirstToken == TRUE){
5713 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5718 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5724 if (FirstToken == TRUE){
5726 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5731 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5737 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5738 PropertyName = PropertyElement.GetNextToken();
5739 PropertyValue = PropertyElement.GetNextToken();
5741 //ProcessCaptureStrings(&PropertyValue);
5743 intPrevValue = intiter->second;
5745 // Process properties.
5747 if (PropertyName.IsEmpty()){
5753 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5755 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5756 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5760 PropertyDataMap->erase(PropertyName);
5761 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5762 PropertyLockMap->erase(PropertyName);
5763 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5773 if (wxSProperty == wxT("NOTE")){
5777 if (ProcessItemData == TRUE){
5779 intPropertyLen = wxSPropertySeg1Chopped.Len();
5783 intPropertyLen = wxSPropertySeg1Ptr->Len();
5787 std::map<int, int> SplitPoints;
5788 std::map<int, int> SplitLength;
5789 std::map<int, int>::iterator SLiter;
5790 wxString PropertyData;
5791 wxString PropertyName;
5792 wxString PropertyValue;
5793 wxString PropertyTokens;
5794 wxString PropertyXOmitYear;
5795 bool AfterFirstToken = FALSE;
5796 bool FirstToken = TRUE;
5797 int intSplitsFound = 0;
5798 int intSplitSize = 0;
5799 int intPrevValue = 6;
5802 int intSplitSeek = 0;
5805 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5806 *wxSPropertyDataNameOut = wxT("NOTE");
5807 *VCardV3Value = TRUE;
5809 if (ProcessItemData == TRUE){
5811 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5815 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5819 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5820 intiter != SplitPoints.end(); ++intiter){
5822 SLiter = SplitLength.find(intiter->first);
5824 if (ProcessItemData == TRUE){
5826 if (FirstToken == TRUE){
5828 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5833 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5839 if (FirstToken == TRUE){
5841 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5846 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5852 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5853 PropertyName = PropertyElement.GetNextToken();
5854 PropertyValue = PropertyElement.GetNextToken();
5856 //ProcessCaptureStrings(&PropertyValue);
5858 intPrevValue = intiter->second;
5860 // Process properties.
5862 if (PropertyName.IsEmpty()){
5868 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5870 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5871 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5875 PropertyDataMap->erase(PropertyName);
5876 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5877 PropertyLockMap->erase(PropertyName);
5878 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5888 if (wxSProperty == wxT("PHOTO")){
5892 if (ProcessItemData == TRUE){
5894 intPropertyLen = wxSPropertySeg1Chopped.Len();
5898 intPropertyLen = wxSPropertySeg1Ptr->Len();
5902 std::map<int, int> SplitPoints;
5903 std::map<int, int> SplitLength;
5904 std::map<int, int>::iterator SLiter;
5905 std::map<wxString, wxString> SplitData;
5906 wxString PropertyData;
5907 wxString PropertyName;
5908 wxString PropertyValue;
5909 wxString PropertyTokens;
5910 wxString PropertyXOmitYear;
5911 bool AfterFirstToken = FALSE;
5912 bool FirstToken = TRUE;
5913 int intSplitsFound = 0;
5914 int intSplitSize = 0;
5915 int intPrevValue = 7;
5918 int intSplitSeek = 0;
5921 *wxSPropertyDataNameOut = wxT("PHOTO");
5922 *VCardV3Value = TRUE;
5924 if (ProcessItemData == TRUE){
5926 SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
5930 SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
5934 wxString wxSMIMEType;
5935 wxString wxSEncType;
5937 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
5938 intiter != SplitData.end(); ++intiter){
5940 PropertyName = intiter->first;
5941 PropertyValue = intiter->second;
5943 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
5944 wxSEncType = wxT("base64");
5948 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
5949 wxSMIMEType = wxT("image/png");
5951 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
5952 wxSMIMEType = wxT("image/jpeg");
5954 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
5955 wxSMIMEType = wxT("image/gif");
5957 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
5958 wxSMIMEType = wxT("image/bmp");
5960 } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
5961 wxSMIMEType = wxT("image/unknown");
5965 //intPrevValue = intiter->second;
5967 // Process properties.
5969 if (PropertyName.IsEmpty()){
5975 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5977 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5978 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5982 PropertyDataMap->erase(PropertyName);
5983 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5984 PropertyLockMap->erase(PropertyName);
5985 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5991 wxSPropertyDataOut->Append(wxT("data:"));
5992 wxSPropertyDataOut->Append(wxSMIMEType);
5993 wxSPropertyDataOut->Append(wxT(";"));
5994 wxSPropertyDataOut->Append(wxSEncType);
5995 wxSPropertyDataOut->Append(wxT(","));
5996 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
6002 if (wxSProperty == wxT("SOUND")){
6006 if (ProcessItemData == TRUE){
6008 intPropertyLen = wxSPropertySeg1Chopped.Len();
6012 intPropertyLen = wxSPropertySeg1Ptr->Len();
6016 std::map<int, int> SplitPoints;
6017 std::map<int, int> SplitLength;
6018 std::map<int, int>::iterator SLiter;
6019 wxString PropertyData;
6020 wxString PropertyName;
6021 wxString PropertyValue;
6022 wxString PropertyTokens;
6023 wxString PropertyXOmitYear;
6024 bool AfterFirstToken = FALSE;
6025 bool FirstToken = TRUE;
6026 int intSplitsFound = 0;
6027 int intSplitSize = 0;
6028 int intPrevValue = 7;
6031 int intSplitSeek = 0;
6034 *wxSPropertyDataNameOut = wxT("SOUND");
6035 *VCardV3Value = TRUE;
6037 if (ProcessItemData == TRUE){
6039 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6043 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6047 wxString wxSMIMEType;
6048 wxString wxSEncType;
6050 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6051 intiter != SplitPoints.end(); ++intiter){
6053 SLiter = SplitLength.find(intiter->first);
6055 if (ProcessItemData == TRUE){
6057 if (FirstToken == TRUE){
6059 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6064 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6070 if (FirstToken == TRUE){
6072 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6077 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6083 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6084 PropertyName = PropertyElement.GetNextToken();
6085 PropertyValue = PropertyElement.GetNextToken();
6087 //ProcessCaptureStrings(&PropertyValue);
6089 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
6090 wxSEncType = wxT("base64");
6094 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
6095 wxSMIMEType = PropertyValue;
6099 intPrevValue = intiter->second;
6101 // Process properties.
6103 if (PropertyName.IsEmpty()){
6109 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6111 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6112 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
6116 PropertyDataMap->erase(PropertyName);
6117 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6118 PropertyLockMap->erase(PropertyName);
6119 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
6125 wxSPropertyDataOut->Append(wxT("data:"));
6126 wxSPropertyDataOut->Append(wxSMIMEType);
6127 wxSPropertyDataOut->Append(wxT(";"));
6128 wxSPropertyDataOut->Append(wxSEncType);
6129 wxSPropertyDataOut->Append(wxT(","));
6130 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
6134 // Look for backward compatability vCard 4.0 properties.
6138 if (wxSProperty == wxT("X-VCARD4-FN")){
6142 if (ProcessItemData == TRUE){
6144 intPropertyLen = wxSPropertySeg1Chopped.Len();
6148 intPropertyLen = wxSPropertySeg1Ptr->Len();
6149 *wxSPropertyDataNameOut = wxT("FN");
6153 std::map<int, int> SplitPoints;
6154 std::map<int, int> SplitLength;
6155 std::map<int, int>::iterator SLiter;
6156 std::map<wxString, bool>::iterator BIter;;
6157 wxString PropertyData;
6158 wxString PropertyName;
6159 wxString PropertyValue;
6160 wxString PropertyTokens;
6161 bool AfterFirstToken = FALSE;
6162 bool FirstToken = TRUE;
6163 int intSplitsFound = 0;
6164 int intSplitSize = 0;
6165 int intPrevValue = 13;
6168 int intSplitSeek = 0;
6171 if (ProcessItemData == TRUE){
6173 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6177 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6181 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6182 intiter != SplitPoints.end(); ++intiter){
6184 SLiter = SplitLength.find(intiter->first);
6186 if (ProcessItemData == TRUE){
6188 if (FirstToken == TRUE){
6190 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6195 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6201 if (FirstToken == TRUE){
6203 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6208 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6214 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6215 PropertyName = PropertyElement.GetNextToken();
6216 PropertyValue = PropertyElement.GetNextToken();
6218 //ProcessCaptureStrings(&PropertyValue);
6220 intPrevValue = intiter->second;
6222 // Process properties.
6224 // Check if there is a lock on the property value. If there is a lock then
6225 // the property value cannot be changed.
6227 if (PropertyName.IsEmpty()){
6233 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6235 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6237 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6241 PropertyDataMap->erase(PropertyName);
6242 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6248 //wxSPropertyPropValuesOut->Append(wxT(";"));
6249 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6253 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6254 *XVCardV4Value = TRUE;
6260 if (wxSProperty == wxT("X-VCARD4-N")){
6264 if (ProcessItemData == TRUE){
6266 intPropertyLen = wxSPropertySeg1Chopped.Len();
6270 intPropertyLen = wxSPropertySeg1Ptr->Len();
6274 std::map<int, int> SplitPoints;
6275 std::map<int, int> SplitLength;
6276 std::map<int, int>::iterator SLiter;
6277 std::map<wxString, bool>::iterator BIter;;
6278 wxString PropertyData;
6279 wxString PropertyName;
6280 wxString PropertyValue;
6281 wxString PropertyTokens;
6282 bool AfterFirstToken = FALSE;
6283 bool FirstToken = TRUE;
6284 int intSplitsFound = 0;
6285 int intSplitSize = 0;
6286 int intPrevValue = 12;
6289 int intSplitSeek = 0;
6292 if (ProcessItemData == TRUE){
6294 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6298 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6299 *wxSPropertyDataNameOut = wxT("N");
6303 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6304 intiter != SplitPoints.end(); ++intiter){
6306 SLiter = SplitLength.find(intiter->first);
6308 if (ProcessItemData == TRUE){
6310 if (FirstToken == TRUE){
6312 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6317 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6323 if (FirstToken == TRUE){
6325 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6330 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6336 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6337 PropertyName = PropertyElement.GetNextToken();
6338 PropertyValue = PropertyElement.GetNextToken();
6340 //ProcessCaptureStrings(&PropertyValue);
6342 intPrevValue = intiter->second;
6344 // Process properties.
6346 // Check if there is a lock on the property value. If there is a lock then
6347 // the property value cannot be changed.
6349 if (PropertyName.IsEmpty()){
6355 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6357 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6359 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6363 PropertyDataMap->erase(PropertyName);
6364 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6370 //wxSPropertyPropValuesOut->Append(wxT(";"));
6371 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6375 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6376 *XVCardV4Value = TRUE;
6380 // X-VCARD4-NICKNAME
6382 if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
6386 if (ProcessItemData == TRUE){
6388 intPropertyLen = wxSPropertySeg1Chopped.Len();
6392 intPropertyLen = wxSPropertySeg1Ptr->Len();
6396 std::map<int, int> SplitPoints;
6397 std::map<int, int> SplitLength;
6398 std::map<int, int>::iterator SLiter;
6399 std::map<wxString, bool>::iterator BIter;;
6400 wxString PropertyData;
6401 wxString PropertyName;
6402 wxString PropertyValue;
6403 wxString PropertyTokens;
6404 bool AfterFirstToken = FALSE;
6405 bool FirstToken = TRUE;
6406 int intSplitsFound = 0;
6407 int intSplitSize = 0;
6408 int intPrevValue = 19;
6411 int intSplitSeek = 0;
6414 if (ProcessItemData == TRUE){
6416 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6420 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6421 *wxSPropertyDataNameOut = wxT("NICKNAME");
6425 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6426 intiter != SplitPoints.end(); ++intiter){
6428 SLiter = SplitLength.find(intiter->first);
6430 if (ProcessItemData == TRUE){
6432 if (FirstToken == TRUE){
6434 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6439 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6445 if (FirstToken == TRUE){
6447 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6452 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6458 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6459 PropertyName = PropertyElement.GetNextToken();
6460 PropertyValue = PropertyElement.GetNextToken();
6462 //ProcessCaptureStrings(&PropertyValue);
6464 intPrevValue = intiter->second;
6466 // Process properties.
6468 // Check if there is a lock on the property value. If there is a lock then
6469 // the property value cannot be changed.
6471 if (PropertyName.IsEmpty()){
6477 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6479 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6481 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6485 PropertyDataMap->erase(PropertyName);
6486 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6492 //wxSPropertyPropValuesOut->Append(wxT(";"));
6493 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6497 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6498 *XVCardV4Value = TRUE;
6504 if (wxSProperty == wxT("X-VCARD4-GENDER")){
6508 if (ProcessItemData == TRUE){
6510 intPropertyLen = wxSPropertySeg1Chopped.Len();
6514 intPropertyLen = wxSPropertySeg1Ptr->Len();
6518 std::map<int, int> SplitPoints;
6519 std::map<int, int> SplitLength;
6520 std::map<int, int>::iterator SLiter;
6521 std::map<wxString, bool>::iterator BIter;;
6522 wxString PropertyData;
6523 wxString PropertyName;
6524 wxString PropertyValue;
6525 wxString PropertyTokens;
6526 bool AfterFirstToken = FALSE;
6527 bool FirstToken = TRUE;
6528 int intSplitsFound = 0;
6529 int intSplitSize = 0;
6530 int intPrevValue = 17;
6533 int intSplitSeek = 0;
6536 if (ProcessItemData == TRUE){
6538 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6542 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6543 *wxSPropertyDataNameOut = wxT("GENDER");
6547 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6548 intiter != SplitPoints.end(); ++intiter){
6550 SLiter = SplitLength.find(intiter->first);
6552 if (ProcessItemData == TRUE){
6554 if (FirstToken == TRUE){
6556 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6561 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6567 if (FirstToken == TRUE){
6569 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6574 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6580 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6581 PropertyName = PropertyElement.GetNextToken();
6582 PropertyValue = PropertyElement.GetNextToken();
6584 //ProcessCaptureStrings(&PropertyValue);
6586 intPrevValue = intiter->second;
6588 // Process properties.
6590 // Check if there is a lock on the property value. If there is a lock then
6591 // the property value cannot be changed.
6593 if (PropertyName.IsEmpty()){
6599 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6601 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6603 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6607 PropertyDataMap->erase(PropertyName);
6608 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6614 //wxSPropertyPropValuesOut->Append(wxT(";"));
6615 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6619 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6620 *XVCardV4Value = TRUE;
6626 if (wxSProperty == wxT("X-VCARD4-BDAY")){
6630 if (ProcessItemData == TRUE){
6632 intPropertyLen = wxSPropertySeg1Chopped.Len();
6636 intPropertyLen = wxSPropertySeg1Ptr->Len();
6640 std::map<int, int> SplitPoints;
6641 std::map<int, int> SplitLength;
6642 std::map<int, int>::iterator SLiter;
6643 std::map<wxString, bool>::iterator BIter;;
6644 wxString PropertyData;
6645 wxString PropertyName;
6646 wxString PropertyValue;
6647 wxString PropertyTokens;
6648 bool AfterFirstToken = FALSE;
6649 bool FirstToken = TRUE;
6650 int intSplitsFound = 0;
6651 int intSplitSize = 0;
6652 int intPrevValue = 15;
6655 int intSplitSeek = 0;
6658 if (ProcessItemData == TRUE){
6660 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6664 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6665 *wxSPropertyDataNameOut = wxT("BDAY");
6669 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6670 intiter != SplitPoints.end(); ++intiter){
6672 SLiter = SplitLength.find(intiter->first);
6674 if (ProcessItemData == TRUE){
6676 if (FirstToken == TRUE){
6678 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6683 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6689 if (FirstToken == TRUE){
6691 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6696 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6702 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6703 PropertyName = PropertyElement.GetNextToken();
6704 PropertyValue = PropertyElement.GetNextToken();
6706 //ProcessCaptureStrings(&PropertyValue);
6708 intPrevValue = intiter->second;
6710 // Process properties.
6712 // Check if there is a lock on the property value. If there is a lock then
6713 // the property value cannot be changed.
6715 if (PropertyName.IsEmpty()){
6721 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6723 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6725 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6729 PropertyDataMap->erase(PropertyName);
6730 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6736 //wxSPropertyPropValuesOut->Append(wxT(";"));
6737 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6741 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6742 *XVCardV4Value = TRUE;
6746 // X-VCARD4-ANNIVERSARY
6748 if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
6752 if (ProcessItemData == TRUE){
6754 intPropertyLen = wxSPropertySeg1Chopped.Len();
6758 intPropertyLen = wxSPropertySeg1Ptr->Len();
6762 std::map<int, int> SplitPoints;
6763 std::map<int, int> SplitLength;
6764 std::map<int, int>::iterator SLiter;
6765 std::map<wxString, bool>::iterator BIter;;
6766 wxString PropertyData;
6767 wxString PropertyName;
6768 wxString PropertyValue;
6769 wxString PropertyTokens;
6770 bool AfterFirstToken = FALSE;
6771 bool FirstToken = TRUE;
6772 int intSplitsFound = 0;
6773 int intSplitSize = 0;
6774 int intPrevValue = 22;
6777 int intSplitSeek = 0;
6780 if (ProcessItemData == TRUE){
6782 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6786 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6787 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
6791 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6792 intiter != SplitPoints.end(); ++intiter){
6794 SLiter = SplitLength.find(intiter->first);
6796 if (ProcessItemData == TRUE){
6798 if (FirstToken == TRUE){
6800 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6805 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6811 if (FirstToken == TRUE){
6813 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6818 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6824 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6825 PropertyName = PropertyElement.GetNextToken();
6826 PropertyValue = PropertyElement.GetNextToken();
6828 //ProcessCaptureStrings(&PropertyValue);
6830 intPrevValue = intiter->second;
6832 // Process properties.
6834 // Check if there is a lock on the property value. If there is a lock then
6835 // the property value cannot be changed.
6837 if (PropertyName.IsEmpty()){
6843 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6845 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6847 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6851 PropertyDataMap->erase(PropertyName);
6852 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6858 //wxSPropertyPropValuesOut->Append(wxT(";"));
6859 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6863 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6864 *XVCardV4Value = TRUE;
6870 if (wxSProperty == wxT("X-VCARD4-TZ")){
6874 if (ProcessItemData == TRUE){
6876 intPropertyLen = wxSPropertySeg1Chopped.Len();
6880 intPropertyLen = wxSPropertySeg1Ptr->Len();
6884 std::map<int, int> SplitPoints;
6885 std::map<int, int> SplitLength;
6886 std::map<int, int>::iterator SLiter;
6887 std::map<wxString, bool>::iterator BIter;;
6888 wxString PropertyData;
6889 wxString PropertyName;
6890 wxString PropertyValue;
6891 wxString PropertyTokens;
6892 bool AfterFirstToken = FALSE;
6893 bool FirstToken = TRUE;
6894 int intSplitsFound = 0;
6895 int intSplitSize = 0;
6896 int intPrevValue = 13;
6899 int intSplitSeek = 0;
6902 if (ProcessItemData == TRUE){
6904 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6908 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6909 *wxSPropertyDataNameOut = wxT("TZ");
6913 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6914 intiter != SplitPoints.end(); ++intiter){
6916 SLiter = SplitLength.find(intiter->first);
6918 if (ProcessItemData == TRUE){
6920 if (FirstToken == TRUE){
6922 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6927 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6933 if (FirstToken == TRUE){
6935 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6940 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6946 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6947 PropertyName = PropertyElement.GetNextToken();
6948 PropertyValue = PropertyElement.GetNextToken();
6950 //ProcessCaptureStrings(&PropertyValue);
6952 intPrevValue = intiter->second;
6954 // Process properties.
6956 // Check if there is a lock on the property value. If there is a lock then
6957 // the property value cannot be changed.
6959 if (PropertyName.IsEmpty()){
6965 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6967 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6969 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6973 PropertyDataMap->erase(PropertyName);
6974 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6980 //wxSPropertyPropValuesOut->Append(wxT(";"));
6981 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6985 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6986 *XVCardV4Value = TRUE;
6992 if (wxSProperty == wxT("X-VCARD4-ADR")){
6996 if (ProcessItemData == TRUE){
6998 intPropertyLen = wxSPropertySeg1Chopped.Len();
7002 intPropertyLen = wxSPropertySeg1Ptr->Len();
7006 std::map<int, int> SplitPoints;
7007 std::map<int, int> SplitLength;
7008 std::map<int, int>::iterator SLiter;
7009 std::map<wxString, bool>::iterator BIter;;
7010 wxString PropertyData;
7011 wxString PropertyName;
7012 wxString PropertyValue;
7013 wxString PropertyTokens;
7014 bool AfterFirstToken = FALSE;
7015 bool FirstToken = TRUE;
7016 int intSplitsFound = 0;
7017 int intSplitSize = 0;
7018 int intPrevValue = 14;
7021 int intSplitSeek = 0;
7024 if (ProcessItemData == TRUE){
7026 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7030 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7031 *wxSPropertyDataNameOut = wxT("ADR");
7035 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7036 intiter != SplitPoints.end(); ++intiter){
7038 SLiter = SplitLength.find(intiter->first);
7040 if (ProcessItemData == TRUE){
7042 if (FirstToken == TRUE){
7044 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7049 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7055 if (FirstToken == TRUE){
7057 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7062 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7068 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7069 PropertyName = PropertyElement.GetNextToken();
7070 PropertyValue = PropertyElement.GetNextToken();
7072 //ProcessCaptureStrings(&PropertyValue);
7074 intPrevValue = intiter->second;
7076 // Process properties.
7078 // Check if there is a lock on the property value. If there is a lock then
7079 // the property value cannot be changed.
7081 if (PropertyName.IsEmpty()){
7087 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7089 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7091 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7095 PropertyDataMap->erase(PropertyName);
7096 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7102 //wxSPropertyPropValuesOut->Append(wxT(";"));
7103 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7107 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7108 *XVCardV4Value = TRUE;
7114 if (wxSProperty == wxT("X-VCARD4-EMAIL")){
7118 if (ProcessItemData == TRUE){
7120 intPropertyLen = wxSPropertySeg1Chopped.Len();
7124 intPropertyLen = wxSPropertySeg1Ptr->Len();
7128 std::map<int, int> SplitPoints;
7129 std::map<int, int> SplitLength;
7130 std::map<int, int>::iterator SLiter;
7131 std::map<wxString, bool>::iterator BIter;;
7132 wxString PropertyData;
7133 wxString PropertyName;
7134 wxString PropertyValue;
7135 wxString PropertyTokens;
7136 bool AfterFirstToken = FALSE;
7137 bool FirstToken = TRUE;
7138 int intSplitsFound = 0;
7139 int intSplitSize = 0;
7140 int intPrevValue = 16;
7143 int intSplitSeek = 0;
7146 if (ProcessItemData == TRUE){
7148 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7152 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7153 *wxSPropertyDataNameOut = wxT("EMAIL");
7157 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7158 intiter != SplitPoints.end(); ++intiter){
7160 SLiter = SplitLength.find(intiter->first);
7162 if (ProcessItemData == TRUE){
7164 if (FirstToken == TRUE){
7166 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7171 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7177 if (FirstToken == TRUE){
7179 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7184 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7190 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7191 PropertyName = PropertyElement.GetNextToken();
7192 PropertyValue = PropertyElement.GetNextToken();
7194 //ProcessCaptureStrings(&PropertyValue);
7196 intPrevValue = intiter->second;
7198 // Process properties.
7200 // Check if there is a lock on the property value. If there is a lock then
7201 // the property value cannot be changed.
7203 if (PropertyName.IsEmpty()){
7209 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7211 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7213 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7217 PropertyDataMap->erase(PropertyName);
7218 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7224 //wxSPropertyPropValuesOut->Append(wxT(";"));
7225 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7229 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7230 *XVCardV4Value = TRUE;
7236 if (wxSProperty == wxT("X-VCARD4-IMPP")){
7240 if (ProcessItemData == TRUE){
7242 intPropertyLen = wxSPropertySeg1Chopped.Len();
7246 intPropertyLen = wxSPropertySeg1Ptr->Len();
7250 std::map<int, int> SplitPoints;
7251 std::map<int, int> SplitLength;
7252 std::map<int, int>::iterator SLiter;
7253 std::map<wxString, bool>::iterator BIter;;
7254 wxString PropertyData;
7255 wxString PropertyName;
7256 wxString PropertyValue;
7257 wxString PropertyTokens;
7258 bool AfterFirstToken = FALSE;
7259 bool FirstToken = TRUE;
7260 int intSplitsFound = 0;
7261 int intSplitSize = 0;
7262 int intPrevValue = 15;
7265 int intSplitSeek = 0;
7268 if (ProcessItemData == TRUE){
7270 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7274 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7275 *wxSPropertyDataNameOut = wxT("IMPP");
7279 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7280 intiter != SplitPoints.end(); ++intiter){
7282 SLiter = SplitLength.find(intiter->first);
7284 if (ProcessItemData == TRUE){
7286 if (FirstToken == TRUE){
7288 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7293 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7299 if (FirstToken == TRUE){
7301 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7306 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7312 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7313 PropertyName = PropertyElement.GetNextToken();
7314 PropertyValue = PropertyElement.GetNextToken();
7316 //ProcessCaptureStrings(&PropertyValue);
7318 intPrevValue = intiter->second;
7320 // Process properties.
7322 // Check if there is a lock on the property value. If there is a lock then
7323 // the property value cannot be changed.
7325 if (PropertyName.IsEmpty()){
7331 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7333 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7335 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7339 PropertyDataMap->erase(PropertyName);
7340 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7346 //wxSPropertyPropValuesOut->Append(wxT(";"));
7347 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7351 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7352 *XVCardV4Value = TRUE;
7358 if (wxSProperty == wxT("X-VCARD4-TEL")){
7362 if (ProcessItemData == TRUE){
7364 intPropertyLen = wxSPropertySeg1Chopped.Len();
7368 intPropertyLen = wxSPropertySeg1Ptr->Len();
7372 std::map<int, int> SplitPoints;
7373 std::map<int, int> SplitLength;
7374 std::map<int, int>::iterator SLiter;
7375 std::map<wxString, bool>::iterator BIter;;
7376 wxString PropertyData;
7377 wxString PropertyName;
7378 wxString PropertyValue;
7379 wxString PropertyTokens;
7380 bool AfterFirstToken = FALSE;
7381 bool FirstToken = TRUE;
7382 int intSplitsFound = 0;
7383 int intSplitSize = 0;
7384 int intPrevValue = 14;
7387 int intSplitSeek = 0;
7390 if (ProcessItemData == TRUE){
7392 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7396 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7397 *wxSPropertyDataNameOut = wxT("TEL");
7401 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7402 intiter != SplitPoints.end(); ++intiter){
7404 SLiter = SplitLength.find(intiter->first);
7406 if (ProcessItemData == TRUE){
7408 if (FirstToken == TRUE){
7410 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7415 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7421 if (FirstToken == TRUE){
7423 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7428 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7434 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7435 PropertyName = PropertyElement.GetNextToken();
7436 PropertyValue = PropertyElement.GetNextToken();
7438 //ProcessCaptureStrings(&PropertyValue);
7440 intPrevValue = intiter->second;
7442 // Process properties.
7444 // Check if there is a lock on the property value. If there is a lock then
7445 // the property value cannot be changed.
7447 if (PropertyName.IsEmpty()){
7453 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7455 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7457 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7461 PropertyDataMap->erase(PropertyName);
7462 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7468 //wxSPropertyPropValuesOut->Append(wxT(";"));
7469 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7473 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7474 *XVCardV4Value = TRUE;
7480 if (wxSProperty == wxT("X-VCARD4-LANG")){
7484 if (ProcessItemData == TRUE){
7486 intPropertyLen = wxSPropertySeg1Chopped.Len();
7490 intPropertyLen = wxSPropertySeg1Ptr->Len();
7494 std::map<int, int> SplitPoints;
7495 std::map<int, int> SplitLength;
7496 std::map<int, int>::iterator SLiter;
7497 std::map<wxString, bool>::iterator BIter;;
7498 wxString PropertyData;
7499 wxString PropertyName;
7500 wxString PropertyValue;
7501 wxString PropertyTokens;
7502 bool AfterFirstToken = FALSE;
7503 bool FirstToken = TRUE;
7504 int intSplitsFound = 0;
7505 int intSplitSize = 0;
7506 int intPrevValue = 15;
7509 int intSplitSeek = 0;
7512 if (ProcessItemData == TRUE){
7514 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7518 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7519 *wxSPropertyDataNameOut = wxT("LANG");
7523 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7524 intiter != SplitPoints.end(); ++intiter){
7526 SLiter = SplitLength.find(intiter->first);
7528 if (ProcessItemData == TRUE){
7530 if (FirstToken == TRUE){
7532 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7537 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7543 if (FirstToken == TRUE){
7545 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7550 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7556 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7557 PropertyName = PropertyElement.GetNextToken();
7558 PropertyValue = PropertyElement.GetNextToken();
7560 //ProcessCaptureStrings(&PropertyValue);
7562 intPrevValue = intiter->second;
7564 // Process properties.
7566 // Check if there is a lock on the property value. If there is a lock then
7567 // the property value cannot be changed.
7569 if (PropertyName.IsEmpty()){
7575 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7577 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7579 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7583 PropertyDataMap->erase(PropertyName);
7584 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7590 //wxSPropertyPropValuesOut->Append(wxT(";"));
7591 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7595 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7596 *XVCardV4Value = TRUE;
7602 if (wxSProperty == wxT("X-VCARD4-GEO")){
7606 if (ProcessItemData == TRUE){
7608 intPropertyLen = wxSPropertySeg1Chopped.Len();
7612 intPropertyLen = wxSPropertySeg1Ptr->Len();
7616 std::map<int, int> SplitPoints;
7617 std::map<int, int> SplitLength;
7618 std::map<int, int>::iterator SLiter;
7619 std::map<wxString, bool>::iterator BIter;;
7620 wxString PropertyData;
7621 wxString PropertyName;
7622 wxString PropertyValue;
7623 wxString PropertyTokens;
7624 bool AfterFirstToken = FALSE;
7625 bool FirstToken = TRUE;
7626 int intSplitsFound = 0;
7627 int intSplitSize = 0;
7628 int intPrevValue = 14;
7631 int intSplitSeek = 0;
7634 if (ProcessItemData == TRUE){
7636 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7640 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7641 *wxSPropertyDataNameOut = wxT("GEO");
7645 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7646 intiter != SplitPoints.end(); ++intiter){
7648 SLiter = SplitLength.find(intiter->first);
7650 if (ProcessItemData == TRUE){
7652 if (FirstToken == TRUE){
7654 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7659 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7665 if (FirstToken == TRUE){
7667 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7672 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7678 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7679 PropertyName = PropertyElement.GetNextToken();
7680 PropertyValue = PropertyElement.GetNextToken();
7682 //ProcessCaptureStrings(&PropertyValue);
7684 intPrevValue = intiter->second;
7686 // Process properties.
7688 // Check if there is a lock on the property value. If there is a lock then
7689 // the property value cannot be changed.
7691 if (PropertyName.IsEmpty()){
7697 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7699 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7701 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7705 PropertyDataMap->erase(PropertyName);
7706 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7712 //wxSPropertyPropValuesOut->Append(wxT(";"));
7713 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7717 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7718 *XVCardV4Value = TRUE;
7724 if (wxSProperty == wxT("X-VCARD4-RELATED")){
7728 if (ProcessItemData == TRUE){
7730 intPropertyLen = wxSPropertySeg1Chopped.Len();
7734 intPropertyLen = wxSPropertySeg1Ptr->Len();
7738 std::map<int, int> SplitPoints;
7739 std::map<int, int> SplitLength;
7740 std::map<int, int>::iterator SLiter;
7741 std::map<wxString, bool>::iterator BIter;;
7742 wxString PropertyData;
7743 wxString PropertyName;
7744 wxString PropertyValue;
7745 wxString PropertyTokens;
7746 bool AfterFirstToken = FALSE;
7747 bool FirstToken = TRUE;
7748 int intSplitsFound = 0;
7749 int intSplitSize = 0;
7750 int intPrevValue = 18;
7753 int intSplitSeek = 0;
7756 if (ProcessItemData == TRUE){
7758 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7762 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7763 *wxSPropertyDataNameOut = wxT("RELATED");
7767 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7768 intiter != SplitPoints.end(); ++intiter){
7770 SLiter = SplitLength.find(intiter->first);
7772 if (ProcessItemData == TRUE){
7774 if (FirstToken == TRUE){
7776 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7781 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7787 if (FirstToken == TRUE){
7789 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7794 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7800 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7801 PropertyName = PropertyElement.GetNextToken();
7802 PropertyValue = PropertyElement.GetNextToken();
7804 //ProcessCaptureStrings(&PropertyValue);
7806 intPrevValue = intiter->second;
7808 // Process properties.
7810 // Check if there is a lock on the property value. If there is a lock then
7811 // the property value cannot be changed.
7813 if (PropertyName.IsEmpty()){
7819 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7821 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7823 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7827 PropertyDataMap->erase(PropertyName);
7828 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7834 //wxSPropertyPropValuesOut->Append(wxT(";"));
7835 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7839 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7840 *XVCardV4Value = TRUE;
7846 if (wxSProperty == wxT("X-VCARD4-URL")){
7850 if (ProcessItemData == TRUE){
7852 intPropertyLen = wxSPropertySeg1Chopped.Len();
7856 intPropertyLen = wxSPropertySeg1Ptr->Len();
7860 std::map<int, int> SplitPoints;
7861 std::map<int, int> SplitLength;
7862 std::map<int, int>::iterator SLiter;
7863 std::map<wxString, bool>::iterator BIter;;
7864 wxString PropertyData;
7865 wxString PropertyName;
7866 wxString PropertyValue;
7867 wxString PropertyTokens;
7868 bool AfterFirstToken = FALSE;
7869 bool FirstToken = TRUE;
7870 int intSplitsFound = 0;
7871 int intSplitSize = 0;
7872 int intPrevValue = 14;
7875 int intSplitSeek = 0;
7878 if (ProcessItemData == TRUE){
7880 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7884 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7885 *wxSPropertyDataNameOut = wxT("URL");
7889 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7890 intiter != SplitPoints.end(); ++intiter){
7892 SLiter = SplitLength.find(intiter->first);
7894 if (ProcessItemData == TRUE){
7896 if (FirstToken == TRUE){
7898 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7903 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7909 if (FirstToken == TRUE){
7911 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7916 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7922 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7923 PropertyName = PropertyElement.GetNextToken();
7924 PropertyValue = PropertyElement.GetNextToken();
7926 //ProcessCaptureStrings(&PropertyValue);
7928 intPrevValue = intiter->second;
7930 // Process properties.
7932 // Check if there is a lock on the property value. If there is a lock then
7933 // the property value cannot be changed.
7935 if (PropertyName.IsEmpty()){
7941 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7943 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7945 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7949 PropertyDataMap->erase(PropertyName);
7950 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7956 //wxSPropertyPropValuesOut->Append(wxT(";"));
7957 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7961 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7962 *XVCardV4Value = TRUE;
7968 if (wxSProperty == wxT("X-VCARD4-TITLE")){
7972 if (ProcessItemData == TRUE){
7974 intPropertyLen = wxSPropertySeg1Chopped.Len();
7978 intPropertyLen = wxSPropertySeg1Ptr->Len();
7982 std::map<int, int> SplitPoints;
7983 std::map<int, int> SplitLength;
7984 std::map<int, int>::iterator SLiter;
7985 std::map<wxString, bool>::iterator BIter;;
7986 wxString PropertyData;
7987 wxString PropertyName;
7988 wxString PropertyValue;
7989 wxString PropertyTokens;
7990 bool AfterFirstToken = FALSE;
7991 bool FirstToken = TRUE;
7992 int intSplitsFound = 0;
7993 int intSplitSize = 0;
7994 int intPrevValue = 16;
7997 int intSplitSeek = 0;
8000 if (ProcessItemData == TRUE){
8002 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8006 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8007 *wxSPropertyDataNameOut = wxT("TITLE");
8011 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8012 intiter != SplitPoints.end(); ++intiter){
8014 SLiter = SplitLength.find(intiter->first);
8016 if (ProcessItemData == TRUE){
8018 if (FirstToken == TRUE){
8020 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8025 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8031 if (FirstToken == TRUE){
8033 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8038 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8044 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8045 PropertyName = PropertyElement.GetNextToken();
8046 PropertyValue = PropertyElement.GetNextToken();
8048 //ProcessCaptureStrings(&PropertyValue);
8050 intPrevValue = intiter->second;
8052 // Process properties.
8054 // Check if there is a lock on the property value. If there is a lock then
8055 // the property value cannot be changed.
8057 if (PropertyName.IsEmpty()){
8063 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8065 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8067 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8071 PropertyDataMap->erase(PropertyName);
8072 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8078 //wxSPropertyPropValuesOut->Append(wxT(";"));
8079 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8083 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8084 *XVCardV4Value = TRUE;
8090 if (wxSProperty == wxT("X-VCARD4-ROLE")){
8094 if (ProcessItemData == TRUE){
8096 intPropertyLen = wxSPropertySeg1Chopped.Len();
8100 intPropertyLen = wxSPropertySeg1Ptr->Len();
8104 std::map<int, int> SplitPoints;
8105 std::map<int, int> SplitLength;
8106 std::map<int, int>::iterator SLiter;
8107 std::map<wxString, bool>::iterator BIter;;
8108 wxString PropertyData;
8109 wxString PropertyName;
8110 wxString PropertyValue;
8111 wxString PropertyTokens;
8112 bool AfterFirstToken = FALSE;
8113 bool FirstToken = TRUE;
8114 int intSplitsFound = 0;
8115 int intSplitSize = 0;
8116 int intPrevValue = 15;
8119 int intSplitSeek = 0;
8122 if (ProcessItemData == TRUE){
8124 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8128 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8129 *wxSPropertyDataNameOut = wxT("ROLE");
8133 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8134 intiter != SplitPoints.end(); ++intiter){
8136 SLiter = SplitLength.find(intiter->first);
8138 if (ProcessItemData == TRUE){
8140 if (FirstToken == TRUE){
8142 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8147 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8153 if (FirstToken == TRUE){
8155 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8160 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8166 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8167 PropertyName = PropertyElement.GetNextToken();
8168 PropertyValue = PropertyElement.GetNextToken();
8170 //ProcessCaptureStrings(&PropertyValue);
8172 intPrevValue = intiter->second;
8174 // Process properties.
8176 // Check if there is a lock on the property value. If there is a lock then
8177 // the property value cannot be changed.
8179 if (PropertyName.IsEmpty()){
8185 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8187 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8189 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8193 PropertyDataMap->erase(PropertyName);
8194 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8200 //wxSPropertyPropValuesOut->Append(wxT(";"));
8201 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8205 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8206 *XVCardV4Value = TRUE;
8212 if (wxSProperty == wxT("X-VCARD4-ORG")){
8216 if (ProcessItemData == TRUE){
8218 intPropertyLen = wxSPropertySeg1Chopped.Len();
8222 intPropertyLen = wxSPropertySeg1Ptr->Len();
8226 std::map<int, int> SplitPoints;
8227 std::map<int, int> SplitLength;
8228 std::map<int, int>::iterator SLiter;
8229 std::map<wxString, bool>::iterator BIter;;
8230 wxString PropertyData;
8231 wxString PropertyName;
8232 wxString PropertyValue;
8233 wxString PropertyTokens;
8234 bool AfterFirstToken = FALSE;
8235 bool FirstToken = TRUE;
8236 int intSplitsFound = 0;
8237 int intSplitSize = 0;
8238 int intPrevValue = 14;
8241 int intSplitSeek = 0;
8244 if (ProcessItemData == TRUE){
8246 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8250 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8251 *wxSPropertyDataNameOut = wxT("ORG");
8255 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8256 intiter != SplitPoints.end(); ++intiter){
8258 SLiter = SplitLength.find(intiter->first);
8260 if (ProcessItemData == TRUE){
8262 if (FirstToken == TRUE){
8264 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8269 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8275 if (FirstToken == TRUE){
8277 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8282 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8288 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8289 PropertyName = PropertyElement.GetNextToken();
8290 PropertyValue = PropertyElement.GetNextToken();
8292 //ProcessCaptureStrings(&PropertyValue);
8294 intPrevValue = intiter->second;
8296 // Process properties.
8298 // Check if there is a lock on the property value. If there is a lock then
8299 // the property value cannot be changed.
8301 if (PropertyName.IsEmpty()){
8307 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8309 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8311 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8315 PropertyDataMap->erase(PropertyName);
8316 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8322 //wxSPropertyPropValuesOut->Append(wxT(";"));
8323 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8327 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8328 *XVCardV4Value = TRUE;
8334 if (wxSProperty == wxT("X-VCARD4-NOTE")){
8338 if (ProcessItemData == TRUE){
8340 intPropertyLen = wxSPropertySeg1Chopped.Len();
8344 intPropertyLen = wxSPropertySeg1Ptr->Len();
8348 std::map<int, int> SplitPoints;
8349 std::map<int, int> SplitLength;
8350 std::map<int, int>::iterator SLiter;
8351 std::map<wxString, bool>::iterator BIter;;
8352 wxString PropertyData;
8353 wxString PropertyName;
8354 wxString PropertyValue;
8355 wxString PropertyTokens;
8356 bool AfterFirstToken = FALSE;
8357 bool FirstToken = TRUE;
8358 int intSplitsFound = 0;
8359 int intSplitSize = 0;
8360 int intPrevValue = 15;
8363 int intSplitSeek = 0;
8366 if (ProcessItemData == TRUE){
8368 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8372 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8373 *wxSPropertyDataNameOut = wxT("NOTE");
8377 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8378 intiter != SplitPoints.end(); ++intiter){
8380 SLiter = SplitLength.find(intiter->first);
8382 if (ProcessItemData == TRUE){
8384 if (FirstToken == TRUE){
8386 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8391 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8397 if (FirstToken == TRUE){
8399 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8404 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8410 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8411 PropertyName = PropertyElement.GetNextToken();
8412 PropertyValue = PropertyElement.GetNextToken();
8414 //ProcessCaptureStrings(&PropertyValue);
8416 intPrevValue = intiter->second;
8418 // Process properties.
8420 // Check if there is a lock on the property value. If there is a lock then
8421 // the property value cannot be changed.
8423 if (PropertyName.IsEmpty()){
8429 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8431 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8433 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8437 PropertyDataMap->erase(PropertyName);
8438 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8444 //wxSPropertyPropValuesOut->Append(wxT(";"));
8445 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8449 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8450 *XVCardV4Value = TRUE;
8454 // X-VCARD4-CATEGORIES
8456 if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
8460 if (ProcessItemData == TRUE){
8462 intPropertyLen = wxSPropertySeg1Chopped.Len();
8466 intPropertyLen = wxSPropertySeg1Ptr->Len();
8470 std::map<int, int> SplitPoints;
8471 std::map<int, int> SplitLength;
8472 std::map<int, int>::iterator SLiter;
8473 std::map<wxString, bool>::iterator BIter;;
8474 wxString PropertyData;
8475 wxString PropertyName;
8476 wxString PropertyValue;
8477 wxString PropertyTokens;
8478 bool AfterFirstToken = FALSE;
8479 bool FirstToken = TRUE;
8480 int intSplitsFound = 0;
8481 int intSplitSize = 0;
8482 int intPrevValue = 21;
8485 int intSplitSeek = 0;
8488 if (ProcessItemData == TRUE){
8490 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8494 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8495 *wxSPropertyDataNameOut = wxT("CATEGORIES");
8499 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8500 intiter != SplitPoints.end(); ++intiter){
8502 SLiter = SplitLength.find(intiter->first);
8504 if (ProcessItemData == TRUE){
8506 if (FirstToken == TRUE){
8508 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8513 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8519 if (FirstToken == TRUE){
8521 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8526 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8532 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8533 PropertyName = PropertyElement.GetNextToken();
8534 PropertyValue = PropertyElement.GetNextToken();
8536 //ProcessCaptureStrings(&PropertyValue);
8538 intPrevValue = intiter->second;
8540 // Process properties.
8542 // Check if there is a lock on the property value. If there is a lock then
8543 // the property value cannot be changed.
8545 if (PropertyName.IsEmpty()){
8551 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8553 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8555 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8559 PropertyDataMap->erase(PropertyName);
8560 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8566 //wxSPropertyPropValuesOut->Append(wxT(";"));
8567 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8571 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8572 *XVCardV4Value = TRUE;
8578 if (wxSProperty == wxT("X-VCARD4-PHOTO")){
8582 if (ProcessItemData == TRUE){
8584 intPropertyLen = wxSPropertySeg1Chopped.Len();
8588 intPropertyLen = wxSPropertySeg1Ptr->Len();
8592 std::map<int, int> SplitPoints;
8593 std::map<int, int> SplitLength;
8594 std::map<int, int>::iterator SLiter;
8595 std::map<wxString, bool>::iterator BIter;;
8596 wxString PropertyData;
8597 wxString PropertyName;
8598 wxString PropertyValue;
8599 wxString PropertyTokens;
8600 bool AfterFirstToken = FALSE;
8601 bool FirstToken = TRUE;
8602 int intSplitsFound = 0;
8603 int intSplitSize = 0;
8604 int intPrevValue = 16;
8607 int intSplitSeek = 0;
8610 if (ProcessItemData == TRUE){
8612 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8616 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8617 *wxSPropertyDataNameOut = wxT("PHOTO");
8621 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8622 intiter != SplitPoints.end(); ++intiter){
8624 SLiter = SplitLength.find(intiter->first);
8626 if (ProcessItemData == TRUE){
8628 if (FirstToken == TRUE){
8630 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8635 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8641 if (FirstToken == TRUE){
8643 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8648 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8654 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8655 PropertyName = PropertyElement.GetNextToken();
8656 PropertyValue = PropertyElement.GetNextToken();
8658 //ProcessCaptureStrings(&PropertyValue);
8660 intPrevValue = intiter->second;
8662 // Process properties.
8664 // Check if there is a lock on the property value. If there is a lock then
8665 // the property value cannot be changed.
8667 if (PropertyName.IsEmpty()){
8673 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8675 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8677 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8681 PropertyDataMap->erase(PropertyName);
8682 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8688 //wxSPropertyPropValuesOut->Append(wxT(";"));
8689 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8693 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8694 *XVCardV4Value = TRUE;
8700 if (wxSProperty == wxT("X-VCARD4-LOGO")){
8704 if (ProcessItemData == TRUE){
8706 intPropertyLen = wxSPropertySeg1Chopped.Len();
8710 intPropertyLen = wxSPropertySeg1Ptr->Len();
8714 std::map<int, int> SplitPoints;
8715 std::map<int, int> SplitLength;
8716 std::map<int, int>::iterator SLiter;
8717 std::map<wxString, bool>::iterator BIter;;
8718 wxString PropertyData;
8719 wxString PropertyName;
8720 wxString PropertyValue;
8721 wxString PropertyTokens;
8722 bool AfterFirstToken = FALSE;
8723 bool FirstToken = TRUE;
8724 int intSplitsFound = 0;
8725 int intSplitSize = 0;
8726 int intPrevValue = 15;
8729 int intSplitSeek = 0;
8732 if (ProcessItemData == TRUE){
8734 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8738 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8739 *wxSPropertyDataNameOut = wxT("LOGO");
8743 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8744 intiter != SplitPoints.end(); ++intiter){
8746 SLiter = SplitLength.find(intiter->first);
8748 if (ProcessItemData == TRUE){
8750 if (FirstToken == TRUE){
8752 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8757 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8763 if (FirstToken == TRUE){
8765 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8770 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8776 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8777 PropertyName = PropertyElement.GetNextToken();
8778 PropertyValue = PropertyElement.GetNextToken();
8780 //ProcessCaptureStrings(&PropertyValue);
8782 intPrevValue = intiter->second;
8784 // Process properties.
8786 // Check if there is a lock on the property value. If there is a lock then
8787 // the property value cannot be changed.
8789 if (PropertyName.IsEmpty()){
8795 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8797 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8799 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8803 PropertyDataMap->erase(PropertyName);
8804 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8810 //wxSPropertyPropValuesOut->Append(wxT(";"));
8811 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8815 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8816 *XVCardV4Value = TRUE;
8822 if (wxSProperty == wxT("X-VCARD4-SOUND")){
8826 if (ProcessItemData == TRUE){
8828 intPropertyLen = wxSPropertySeg1Chopped.Len();
8832 intPropertyLen = wxSPropertySeg1Ptr->Len();
8836 std::map<int, int> SplitPoints;
8837 std::map<int, int> SplitLength;
8838 std::map<int, int>::iterator SLiter;
8839 std::map<wxString, bool>::iterator BIter;;
8840 wxString PropertyData;
8841 wxString PropertyName;
8842 wxString PropertyValue;
8843 wxString PropertyTokens;
8844 bool AfterFirstToken = FALSE;
8845 bool FirstToken = TRUE;
8846 int intSplitsFound = 0;
8847 int intSplitSize = 0;
8848 int intPrevValue = 16;
8851 int intSplitSeek = 0;
8854 if (ProcessItemData == TRUE){
8856 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8860 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8861 *wxSPropertyDataNameOut = wxT("SOUND");
8865 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8866 intiter != SplitPoints.end(); ++intiter){
8868 SLiter = SplitLength.find(intiter->first);
8870 if (ProcessItemData == TRUE){
8872 if (FirstToken == TRUE){
8874 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8879 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8885 if (FirstToken == TRUE){
8887 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8892 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8898 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8899 PropertyName = PropertyElement.GetNextToken();
8900 PropertyValue = PropertyElement.GetNextToken();
8902 //ProcessCaptureStrings(&PropertyValue);
8904 intPrevValue = intiter->second;
8906 // Process properties.
8908 // Check if there is a lock on the property value. If there is a lock then
8909 // the property value cannot be changed.
8911 if (PropertyName.IsEmpty()){
8917 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8919 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8921 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8925 PropertyDataMap->erase(PropertyName);
8926 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8932 //wxSPropertyPropValuesOut->Append(wxT(";"));
8933 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8937 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8938 *XVCardV4Value = TRUE;
8944 if (wxSProperty == wxT("X-VCARD4-CALURI")){
8948 if (ProcessItemData == TRUE){
8950 intPropertyLen = wxSPropertySeg1Chopped.Len();
8954 intPropertyLen = wxSPropertySeg1Ptr->Len();
8958 std::map<int, int> SplitPoints;
8959 std::map<int, int> SplitLength;
8960 std::map<int, int>::iterator SLiter;
8961 std::map<wxString, bool>::iterator BIter;;
8962 wxString PropertyData;
8963 wxString PropertyName;
8964 wxString PropertyValue;
8965 wxString PropertyTokens;
8966 bool AfterFirstToken = FALSE;
8967 bool FirstToken = TRUE;
8968 int intSplitsFound = 0;
8969 int intSplitSize = 0;
8970 int intPrevValue = 17;
8973 int intSplitSeek = 0;
8976 if (ProcessItemData == TRUE){
8978 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8982 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8983 *wxSPropertyDataNameOut = wxT("CALURI");
8987 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8988 intiter != SplitPoints.end(); ++intiter){
8990 SLiter = SplitLength.find(intiter->first);
8992 if (ProcessItemData == TRUE){
8994 if (FirstToken == TRUE){
8996 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9001 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9007 if (FirstToken == TRUE){
9009 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9014 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9020 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9021 PropertyName = PropertyElement.GetNextToken();
9022 PropertyValue = PropertyElement.GetNextToken();
9024 //ProcessCaptureStrings(&PropertyValue);
9026 intPrevValue = intiter->second;
9028 // Process properties.
9030 // Check if there is a lock on the property value. If there is a lock then
9031 // the property value cannot be changed.
9033 if (PropertyName.IsEmpty()){
9039 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9041 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9043 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9047 PropertyDataMap->erase(PropertyName);
9048 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9054 //wxSPropertyPropValuesOut->Append(wxT(";"));
9055 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9059 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9060 *XVCardV4Value = TRUE;
9064 // X-VCARD4-CALADRURI
9066 if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
9070 if (ProcessItemData == TRUE){
9072 intPropertyLen = wxSPropertySeg1Chopped.Len();
9076 intPropertyLen = wxSPropertySeg1Ptr->Len();
9080 std::map<int, int> SplitPoints;
9081 std::map<int, int> SplitLength;
9082 std::map<int, int>::iterator SLiter;
9083 std::map<wxString, bool>::iterator BIter;;
9084 wxString PropertyData;
9085 wxString PropertyName;
9086 wxString PropertyValue;
9087 wxString PropertyTokens;
9088 bool AfterFirstToken = FALSE;
9089 bool FirstToken = TRUE;
9090 int intSplitsFound = 0;
9091 int intSplitSize = 0;
9092 int intPrevValue = 20;
9095 int intSplitSeek = 0;
9098 if (ProcessItemData == TRUE){
9100 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9104 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9105 *wxSPropertyDataNameOut = wxT("CALADRURI");
9109 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
9110 intiter != SplitPoints.end(); ++intiter){
9112 SLiter = SplitLength.find(intiter->first);
9114 if (ProcessItemData == TRUE){
9116 if (FirstToken == TRUE){
9118 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9123 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9129 if (FirstToken == TRUE){
9131 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9136 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9142 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9143 PropertyName = PropertyElement.GetNextToken();
9144 PropertyValue = PropertyElement.GetNextToken();
9146 //ProcessCaptureStrings(&PropertyValue);
9148 intPrevValue = intiter->second;
9150 // Process properties.
9152 // Check if there is a lock on the property value. If there is a lock then
9153 // the property value cannot be changed.
9155 if (PropertyName.IsEmpty()){
9161 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9163 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9165 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9169 PropertyDataMap->erase(PropertyName);
9170 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9176 //wxSPropertyPropValuesOut->Append(wxT(";"));
9177 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9181 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9182 *XVCardV4Value = TRUE;
9188 if (wxSProperty == wxT("X-VCARD4-FBURL")){
9192 if (ProcessItemData == TRUE){
9194 intPropertyLen = wxSPropertySeg1Chopped.Len();
9198 intPropertyLen = wxSPropertySeg1Ptr->Len();
9202 std::map<int, int> SplitPoints;
9203 std::map<int, int> SplitLength;
9204 std::map<int, int>::iterator SLiter;
9205 std::map<wxString, bool>::iterator BIter;;
9206 wxString PropertyData;
9207 wxString PropertyName;
9208 wxString PropertyValue;
9209 wxString PropertyTokens;
9210 bool AfterFirstToken = FALSE;
9211 bool FirstToken = TRUE;
9212 int intSplitsFound = 0;
9213 int intSplitSize = 0;
9214 int intPrevValue = 16;
9217 int intSplitSeek = 0;
9220 if (ProcessItemData == TRUE){
9222 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9226 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9227 *wxSPropertyDataNameOut = wxT("FBURL");
9231 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
9232 intiter != SplitPoints.end(); ++intiter){
9234 SLiter = SplitLength.find(intiter->first);
9236 if (ProcessItemData == TRUE){
9238 if (FirstToken == TRUE){
9240 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9245 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9251 if (FirstToken == TRUE){
9253 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9258 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9264 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9265 PropertyName = PropertyElement.GetNextToken();
9266 PropertyValue = PropertyElement.GetNextToken();
9268 //ProcessCaptureStrings(&PropertyValue);
9270 intPrevValue = intiter->second;
9272 // Process properties.
9274 // Check if there is a lock on the property value. If there is a lock then
9275 // the property value cannot be changed.
9277 if (PropertyName.IsEmpty()){
9283 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9285 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9287 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9291 PropertyDataMap->erase(PropertyName);
9292 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9298 //wxSPropertyPropValuesOut->Append(wxT(";"));
9299 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9303 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9304 *XVCardV4Value = TRUE;
9310 if (wxSProperty == wxT("X-VCARD4-KEY")){
9314 if (ProcessItemData == TRUE){
9316 intPropertyLen = wxSPropertySeg1Chopped.Len();
9320 intPropertyLen = wxSPropertySeg1Ptr->Len();
9324 std::map<int, int> SplitPoints;
9325 std::map<int, int> SplitLength;
9326 std::map<int, int>::iterator SLiter;
9327 std::map<wxString, bool>::iterator BIter;;
9328 wxString PropertyData;
9329 wxString PropertyName;
9330 wxString PropertyValue;
9331 wxString PropertyTokens;
9332 bool AfterFirstToken = FALSE;
9333 bool FirstToken = TRUE;
9334 int intSplitsFound = 0;
9335 int intSplitSize = 0;
9336 int intPrevValue = 14;
9339 int intSplitSeek = 0;
9342 if (ProcessItemData == TRUE){
9344 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9348 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9349 *wxSPropertyDataNameOut = wxT("KEY");
9353 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
9354 intiter != SplitPoints.end(); ++intiter){
9356 SLiter = SplitLength.find(intiter->first);
9358 if (ProcessItemData == TRUE){
9360 if (FirstToken == TRUE){
9362 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9367 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9373 if (FirstToken == TRUE){
9375 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9380 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9386 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9387 PropertyName = PropertyElement.GetNextToken();
9388 PropertyValue = PropertyElement.GetNextToken();
9390 //ProcessCaptureStrings(&PropertyValue);
9392 intPrevValue = intiter->second;
9394 // Process properties.
9396 // Check if there is a lock on the property value. If there is a lock then
9397 // the property value cannot be changed.
9399 if (PropertyName.IsEmpty()){
9405 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9407 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9409 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9413 PropertyDataMap->erase(PropertyName);
9414 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9420 //wxSPropertyPropValuesOut->Append(wxT(";"));
9421 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9425 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9426 *XVCardV4Value = TRUE;
9432 if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
9436 if (ProcessItemData == TRUE){
9438 intPropertyLen = wxSPropertySeg1Chopped.Len();
9442 intPropertyLen = wxSPropertySeg1Ptr->Len();
9446 std::map<int, int> SplitPoints;
9447 std::map<int, int> SplitLength;
9448 std::map<int, int>::iterator SLiter;
9449 std::map<wxString, bool>::iterator BIter;;
9450 wxString PropertyData;
9451 wxString PropertyName;
9452 wxString PropertyValue;
9453 wxString PropertyTokens;
9454 bool AfterFirstToken = FALSE;
9455 bool FirstToken = TRUE;
9456 int intSplitsFound = 0;
9457 int intSplitSize = 0;
9458 int intPrevValue = 14;
9461 int intSplitSeek = 0;
9464 if (ProcessItemData == TRUE){
9466 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9470 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9471 *wxSPropertyDataNameOut = wxSProperty.Mid(9);
9475 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
9476 intiter != SplitPoints.end(); ++intiter){
9478 SLiter = SplitLength.find(intiter->first);
9480 if (ProcessItemData == TRUE){
9482 if (FirstToken == TRUE){
9484 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9489 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9495 if (FirstToken == TRUE){
9497 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9502 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9508 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9509 PropertyName = PropertyElement.GetNextToken();
9510 PropertyValue = PropertyElement.GetNextToken();
9512 //ProcessCaptureStrings(&PropertyValue);
9514 intPrevValue = intiter->second;
9516 // Process properties.
9518 // Check if there is a lock on the property value. If there is a lock then
9519 // the property value cannot be changed.
9521 if (PropertyName.IsEmpty()){
9527 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9529 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9531 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9535 PropertyDataMap->erase(PropertyName);
9536 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9542 //wxSPropertyPropValuesOut->Append(wxT(";"));
9543 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9547 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9548 *XVCardV4Value = TRUE;
9552 // X-ADDRESSBOOKSERVER-KIND
9554 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
9560 if (ProcessItemData == TRUE){
9562 intPropertyLen = wxSPropertySeg1Chopped.Len();
9566 intPropertyLen = wxSPropertySeg1Ptr->Len();
9570 std::map<int, int> SplitPoints;
9571 std::map<int, int> SplitLength;
9572 std::map<int, int>::iterator SLiter;
9573 std::map<wxString, bool>::iterator BIter;;
9574 wxString PropertyData;
9575 wxString PropertyName;
9576 wxString PropertyValue;
9577 wxString PropertyTokens;
9578 bool AfterFirstToken = FALSE;
9579 bool FirstToken = TRUE;
9580 int intSplitsFound = 0;
9581 int intSplitSize = 0;
9582 int intPrevValue = 26;
9585 int intSplitSeek = 0;
9588 if (ProcessItemData == TRUE){
9590 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9594 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9598 *wxSPropertyDataNameOut = wxT("KIND");
9600 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
9601 intiter != SplitPoints.end(); ++intiter){
9603 SLiter = SplitLength.find(intiter->first);
9605 if (ProcessItemData == TRUE){
9607 if (FirstToken == TRUE){
9609 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9614 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9620 if (FirstToken == TRUE){
9622 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9627 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9633 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9634 PropertyName = PropertyElement.GetNextToken();
9635 PropertyValue = PropertyElement.GetNextToken();
9637 //ProcessCaptureStrings(&PropertyValue);
9639 intPrevValue = intiter->second;
9641 // Process properties.
9643 // Check if there is a lock on the property value. If there is a lock then
9644 // the property value cannot be changed.
9646 if (PropertyName.IsEmpty()){
9652 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9654 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9656 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9660 PropertyDataMap->erase(PropertyName);
9661 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9667 //wxSPropertyPropValuesOut->Append(wxT(";"));
9668 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9672 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9673 *XVCardV4Value = TRUE;
9677 // X-ADDRESSBOOKSERVER-MEMBER
9679 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
9685 if (ProcessItemData == TRUE){
9687 intPropertyLen = wxSPropertySeg1Chopped.Len();
9691 intPropertyLen = wxSPropertySeg1Ptr->Len();
9695 std::map<int, int> SplitPoints;
9696 std::map<int, int> SplitLength;
9697 std::map<int, int>::iterator SLiter;
9698 std::map<wxString, bool>::iterator BIter;;
9699 wxString PropertyData;
9700 wxString PropertyName;
9701 wxString PropertyValue;
9702 wxString PropertyTokens;
9703 bool AfterFirstToken = FALSE;
9704 bool FirstToken = TRUE;
9705 int intSplitsFound = 0;
9706 int intSplitSize = 0;
9707 int intPrevValue = 28;
9710 int intSplitSeek = 0;
9713 if (ProcessItemData == TRUE){
9715 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
9719 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9723 *wxSPropertyDataNameOut = wxT("MEMBER");
9725 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
9726 intiter != SplitPoints.end(); ++intiter){
9728 SLiter = SplitLength.find(intiter->first);
9730 if (ProcessItemData == TRUE){
9732 if (FirstToken == TRUE){
9734 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9739 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9745 if (FirstToken == TRUE){
9747 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9752 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9758 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9759 PropertyName = PropertyElement.GetNextToken();
9760 PropertyValue = PropertyElement.GetNextToken();
9762 //ProcessCaptureStrings(&PropertyValue);
9764 intPrevValue = intiter->second;
9766 // Process properties.
9768 // Check if there is a lock on the property value. If there is a lock then
9769 // the property value cannot be changed.
9771 if (PropertyName.IsEmpty()){
9777 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9779 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9781 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9785 PropertyDataMap->erase(PropertyName);
9786 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9792 //wxSPropertyPropValuesOut->Append(wxT(";"));
9793 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9797 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9798 *XVCardV4Value = TRUE;
9803 // Deal with X-ABLabel specifically.
9805 if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
9807 int intPropertyLen = wxSPropertySeg1Ptr->Len();
9808 std::map<int, int> SplitPoints;
9809 std::map<int, int> SplitLength;
9810 std::map<int, int>::iterator SLiter;
9811 wxString PropertyData;
9812 wxString PropertyName;
9813 wxString PropertyValue;
9814 wxString PropertyTokens;
9815 bool AfterFirstToken = FALSE;
9816 bool FirstToken = TRUE;
9817 int intSplitsFound = 0;
9818 int intSplitSize = 0;
9819 int intPrevValue = 11;
9822 int intSplitSeek = 0;
9825 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9827 //EscapeString(wxSPropertySeg2Ptr, FALSE);
9828 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
9834 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
9836 CaptureString(strCapture, FALSE);
9840 void vCard34Conv::SplitValues(wxString *PropertyLine,
9841 std::map<int,int> *SplitPoints,
9842 std::map<int,int> *SplitLength,
9845 int intPropertyLen = PropertyLine->Len();
9846 int intSplitsFound = 0;
9847 int intSplitSize = 0;
9848 int intSplitSeek = 0;
9850 for (int i = intSize; i <= intPropertyLen; i++){
9854 if (PropertyLine->Mid(i, 1) == wxT(";") &&
9855 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
9857 if (intSplitsFound == 0){
9859 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
9863 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
9867 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
9877 if (intSplitsFound == 0){
9879 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
9880 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9884 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
9885 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9891 void vCard34Conv::SplitValuesData(wxString *PropertyLine,
9892 std::map<int,int> *SplitPoints,
9893 std::map<int,int> *SplitLength,
9895 std::map<wxString,wxString> *SplitData){
9898 wxStringTokenizer PropertyElement;
9899 wxString PropertyName;
9900 wxString PropertyValue;
9901 int intPropertyLen = PropertyLine->Len();
9902 int intSplitsFound = 0;
9903 int intSplitSize = 0;
9904 int intSplitSeek = (intSize - 1);
9906 for (int i = intSize; i <= intPropertyLen; i++){
9910 if (PropertyLine->Mid(i, 1) == wxT(";") &&
9911 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
9913 if (intSplitsFound == 0){
9915 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
9916 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
9920 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
9921 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
9925 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
9928 intSplitSeek = (i + 1);
9931 if (!DataStr.IsEmpty()){
9933 PropertyElement.SetString(DataStr, wxT("="));
9934 PropertyName = PropertyElement.GetNextToken();
9935 PropertyValue = PropertyElement.GetNextToken();
9936 SplitData->insert(std::make_pair(PropertyName, PropertyValue));
9941 PropertyName.clear();
9942 PropertyValue.clear();
9948 if (intSplitsFound == 0){
9950 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
9952 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
9953 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9957 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
9959 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
9960 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9964 if (!DataStr.IsEmpty()){
9966 PropertyElement.SetString(DataStr, wxT("="));
9967 PropertyName = PropertyElement.GetNextToken();
9968 PropertyValue = PropertyElement.GetNextToken();
9969 SplitData->insert(std::make_pair(PropertyName, PropertyValue));