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 size_t 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 std::map<int, int> SplitPoints;
235 std::map<int, int> SplitLength;
236 std::map<int, int>::iterator SLiter;
237 wxString PropertyData;
238 wxString PropertyName;
239 wxString PropertyValue;
240 wxString PropertyTokens;
241 int intPrevValue = 4;
243 //SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
247 if (FNFirst == FALSE){
249 ContactDatav3.AddRaw(wxT("FN"), wxSPropertySeg2);
251 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
255 ContactDatav3.AddRaw(wxT("X-VCARD4-FN;X-FIRST=TRUE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
262 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
264 ContactDatav3.AddRaw(wxT("X-VCARD4-FN"), wxSPropertySeg2);
268 ContactDatav3.AddRaw(wxT("X-VCARD4-FN;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))),
275 } else if (wxSProperty == wxT("N") && NameProcessed == FALSE){
277 std::map<int, int> SplitPoints;
278 std::map<int, int> SplitLength;
279 std::map<int, int>::iterator SLiter;
280 wxString PropertyData;
281 wxString PropertyName;
282 wxString PropertyValue;
283 wxString PropertyTokens;
284 int intPrevValue = 3;
288 ContactDatav3.AddRaw(wxT("N"), wxSPropertySeg2);
290 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
296 ContactDatav3.AddRaw(wxT("X-VCARD4-N;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
300 NameProcessed = TRUE;
302 } else if (wxSProperty == wxT("KIND") && KindProcessed == FALSE){
306 std::map<int, int> SplitPoints;
307 std::map<int, int> SplitLength;
308 std::map<int, int>::iterator SLiter;
309 wxString PropertyData;
310 wxString PropertyName;
311 wxString PropertyValue;
312 wxString PropertyTokens;
313 int intPrevValue = 5;
317 ContactDatav3.AddRaw(wxT("X-ADDRESSBOOKSERVER-KIND"), wxSPropertySeg2);
319 KindProcessed = TRUE;
321 } else if (wxSProperty == wxT("MEMBER")){
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 int intPrevValue = 7;
336 ContactDatav3.AddRaw(wxT("X-ADDRESSBOOKSERVER-MEMBER"), wxSPropertySeg2);
338 } else if (wxSProperty == wxT("NICKNAME")){
340 std::map<int, int> SplitPoints;
341 std::map<int, int> SplitLength;
342 std::map<int, int>::iterator SLiter;
343 wxString PropertyData;
344 wxString PropertyName;
345 wxString PropertyValue;
346 wxString PropertyTokens;
347 int intPrevValue = 10;
351 if (NicknameFirst == FALSE){
353 ContactDatav3.AddRaw(wxT("NICKNAME"), wxSPropertySeg2);
355 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
359 ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME;X-FIRST=TRUE;")
360 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
363 NicknameFirst = TRUE;
368 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
370 ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME"), wxSPropertySeg2);
374 ContactDatav3.AddRaw(wxT("X-VCARD4-NICKNAME;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
382 } else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){
384 // Do PID/ALTID/LANG things.
386 std::map<int, int> SplitPoints;
387 std::map<int, int> SplitLength;
388 std::map<int, int>::iterator SLiter;
389 wxString PropertyData;
390 wxString PropertyName;
391 wxString PropertyValue;
392 wxString PropertyTokens;
393 int intPrevValue = 8;
398 if (wxSPropertySeg2.Mid(1, 1) == wxT(";")){
400 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
402 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;X-GENDERTEXT=\"") + wxSPropertySeg2.Mid(2) + wxT("\""), wxSPropertySeg2.Mid(0, 1));
406 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;X-GENDERTEXT=\"") + wxSPropertySeg2.Mid(2) + wxT("\";")
407 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))),
408 wxSPropertySeg2.Mid(0, 1));
414 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
416 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER"), wxSPropertySeg2);
420 ContactDatav3.AddRaw(wxT("X-VCARD4-GENDER;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
426 GenderProcessed = TRUE;
428 } else if (wxSProperty == wxT("BDAY") && BirthdayProcessed == FALSE){
430 // Process date. Preserve the remainder in the string.
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;
440 int intPrevValue = 6;
446 // Look for type before continuing.
448 if (wxSPropertySeg2.Mid(0, 2) == wxT("--")){
450 strResults.Append(wxT("1604-"));
453 strResults.Append(wxSPropertySeg2.Mid(2, 2) + wxT("-"));
454 strResults.Append(wxSPropertySeg2.Mid(4, 2));
458 strResults.Append(wxSPropertySeg2.Mid(0, 4) + wxT("-"));
459 strResults.Append(wxSPropertySeg2.Mid(4, 2) + wxT("-"));
460 strResults.Append(wxSPropertySeg2.Mid(6, 2));
468 ContactDatav3.AddRaw(wxT("BDAY;X-APPLE-OMIT-YEAR=1604"), strResults);
470 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
472 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY"), wxSPropertySeg2);
476 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
482 ContactDatav3.AddRaw(wxT("BDAY"), strResults);
484 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
486 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY"), wxSPropertySeg2);
490 ContactDatav3.AddRaw(wxT("X-VCARD4-BDAY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
496 BirthdayProcessed = TRUE;
498 } else if (wxSProperty == wxT("ANNIVERSARY") && AnniversaryProcessed == FALSE){
500 // Process date. Preserve the remainder in the string.
502 std::map<int, int> SplitPoints;
503 std::map<int, int> SplitLength;
504 std::map<int, int>::iterator SLiter;
505 wxString PropertyData;
506 wxString PropertyName;
507 wxString PropertyValue;
508 wxString PropertyTokens;
509 int intPrevValue = 13;
516 // Look for type before continuing.
518 if (wxSPropertySeg2.Mid(0, 2) == wxT("--")){
520 strResults.Append(wxT("1604-"));
523 strResults.Append(wxSPropertySeg2.Mid(2, 2) + wxT("-"));
524 strResults.Append(wxSPropertySeg2.Mid(4, 2));
528 strResults.Append(wxSPropertySeg2.Mid(0, 4) + wxT("-"));
529 strResults.Append(wxSPropertySeg2.Mid(4, 2) + wxT("-"));
530 strResults.Append(wxSPropertySeg2.Mid(6, 2));
536 ContactDatav3.AddRaw(wxT("ANNIVERSARY;X-APPLE-OMIT-YEAR=1604"), strResults);
538 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
540 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY"), wxSPropertySeg2);
544 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
550 ContactDatav3.AddRaw(wxT("ANNIVERSARY"), strResults);
552 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
554 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY"), wxSPropertySeg2);
558 ContactDatav3.AddRaw(wxT("X-VCARD4-ANNIVERSARY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
564 AnniversaryProcessed = TRUE;
566 } else if (wxSProperty == wxT("TZ")){
568 std::map<int, int> SplitPoints;
569 std::map<int, int> SplitLength;
570 std::map<int, int>::iterator SLiter;
571 wxString PropertyData;
572 wxString PropertyName;
573 wxString PropertyValue;
574 wxString PropertyTokens;
575 int intPrevValue = 4;
579 // Look for type before continuing.
581 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
583 ContactDatav3.AddRaw(wxT("X-VCARD4-TZ"), wxSPropertySeg2);
587 ContactDatav3.AddRaw(wxT("X-VCARD4-TZ;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
591 } else if (wxSProperty == wxT("ADR")){
593 std::map<int, int> SplitPoints;
594 std::map<int, int> SplitLength;
595 std::map<int, int>::iterator SLiter;
596 wxString PropertyData;
597 wxString PropertyName;
598 wxString PropertyValue;
599 wxString PropertyTokens;
600 wxString AddressLabel;
601 wxString AddressLang;
602 wxString AddressAltID;
604 wxString AddressTokens;
606 wxString AddressTimezone;
607 wxString AddressType;
608 wxString AddressMediatype;
609 wxString AddressPOBox;
610 wxString AddressExtended;
611 wxString AddressStreet;
612 wxString AddressLocality;
613 wxString AddressCity;
614 wxString AddressRegion;
615 wxString AddressPostalCode;
616 wxString AddressCountry;
617 int intPrevValue = 5;
621 // TODO: Check in value for X-ABLabel and use it if it is there.
623 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
625 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".ADR"), wxSPropertySeg2);
626 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Address"));
627 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-ADR"), wxSPropertySeg2);
631 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".ADR"), wxSPropertySeg2);
632 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Address"));
633 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-ADR;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
639 } else if (wxSProperty == wxT("EMAIL")){
641 // TODO: Continue from here! See ADR for good example (Replace initer with intPrevValue).
642 // Remove inserted comma for Extra Tokens in frmContactEditor.cpp
644 std::map<int, int> SplitPoints;
645 std::map<int, int> SplitLength;
646 std::map<int, int>::iterator SLiter;
647 std::map<int, int>::iterator SPoint;
648 wxString PropertyData;
649 wxString PropertyName;
650 wxString PropertyValue;
651 wxString PropertyTokens;
652 wxString AddressLabel;
653 wxString AddressLang;
654 wxString AddressAltID;
656 wxString AddressTokens;
658 wxString AddressTimezone;
659 wxString AddressType;
660 wxString AddressMediatype;
661 wxString AddressPOBox;
662 wxString AddressExtended;
663 wxString AddressStreet;
664 wxString AddressLocality;
665 wxString AddressCity;
666 wxString AddressRegion;
667 wxString AddressPostalCode;
668 wxString AddressCountry;
669 int intPrevValue = 7;
673 // TODO: Check in value for X-ABLabel and use it if it is there.
675 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
677 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".EMAIL"), wxSPropertySeg2);
678 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("E-mail Address"));
679 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-EMAIL"), wxSPropertySeg2);
683 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".EMAIL"), wxSPropertySeg2);
684 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("E-mail Address"));
685 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-EMAIL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
691 } else if (wxSProperty == wxT("IMPP")){
693 std::map<int, int> SplitPoints;
694 std::map<int, int> SplitLength;
695 std::map<int, int>::iterator SLiter;
696 std::map<int, int>::iterator SPoint;
697 wxString PropertyData;
698 wxString PropertyName;
699 wxString PropertyValue;
700 wxString PropertyTokens;
702 wxString IMPPAddress;
703 int intPrevValue = 6;
705 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
709 // TODO: Check in value for X-ABLabel and use it if it is there.
711 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
713 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".IMPP"), wxSPropertySeg2);
714 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Instant Message"));
715 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-IMPP"), wxSPropertySeg2);
719 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".IMPP"), wxSPropertySeg2);
720 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("Instant Message"));
721 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-IMPP;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
727 } else if (wxSProperty == wxT("TEL")){
729 // Check TEL and make sure it is functioning properly.
731 std::map<int, int> SplitPoints;
732 std::map<int, int> SplitLength;
733 std::map<int, int> TypeSplitPoints;
734 std::map<int, int> TypeSplitLength;
735 std::map<int, int>::iterator SLiter;
736 std::map<int, int>::iterator SPoint;
737 std::map<int, int>::iterator TSLiter;
738 std::map<int, int>::iterator TSPoint;
739 wxString PropertyData;
740 wxString PropertyName;
741 wxString PropertyValue;
742 wxString PropertyTokens;
746 wxString TelTypeDetail;
748 wxString FinalFriendlyString;
749 int intSplitsFound = 0;
750 int intSplitSize = 0;
751 int intPrevValue = 5;
753 int intSplitPoint = 0;
757 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
759 // Look for type before continuing.
761 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
762 intiter != SplitPoints.end(); ++intiter){
764 SLiter = SplitLength.find(intiter->first);
766 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second));
768 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
769 PropertyName = PropertyElement.GetNextToken();
770 PropertyValue = PropertyElement.GetNextToken();
772 intPrevValue = intiter->second;
774 if (PropertyName == wxT("TYPE")){
776 // Process each value in type and translate each
779 // Strip out the quotes if they are there.
781 size_t intPropertyValueLen = PropertyValue.Len();
783 if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){
785 PropertyValue.Trim();
786 PropertyValue.RemoveLast();
790 if (PropertyValue.Mid(0, 1) == wxT("\"")){
792 PropertyValue.Remove(0, 1);
796 TelTypeDetail = PropertyValue;
802 for (int i = 0; i <= intPropertyValueLen; i++){
806 if (PropertyValue.Mid(i, 1) == wxT(",") && PropertyValue.Mid((i - 1), 1) != wxT("\\")){
808 if (intSplitsFound == 0){
810 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
811 TypeSplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
815 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
816 TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
829 TypeSplitPoints.insert(std::make_pair(intSplitsFound, intSplitPoint));
830 TypeSplitLength.insert(std::make_pair(intSplitsFound, intSplitSize));
834 for (std::map<int, int>::iterator typeiter = TypeSplitPoints.begin();
835 typeiter != TypeSplitPoints.end(); ++typeiter){
837 wxString TypePropertyName;
839 TSLiter = TypeSplitLength.find(typeiter->first);
841 TypePropertyName = PropertyValue.Mid(typeiter->second, TSLiter->second);
843 if (intTypeSeek == 0){
848 TelTypeUI.Append(wxT(","));
852 if (TypePropertyName == wxT("home")){
856 } else if (TypePropertyName == wxT("work")){
862 if (TypePropertyName == wxT("text")){
864 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Text")); } else { FinalFriendlyString.Append(_("Text")); }
866 TelTypeOut.Append(wxT(";"));
867 TelTypeOut.Append(wxT("type=TEXT"));
869 } else if (TypePropertyName == wxT("voice")){
871 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Voice")); } else { FinalFriendlyString.Append(_("Voice")); }
873 TelTypeOut.Append(wxT(";"));
874 TelTypeOut.Append(wxT("type=VOICE"));
878 } else if (TypePropertyName == wxT("fax")){
880 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Fax")); } else { FinalFriendlyString.Append(_("Fax")); }
882 TelTypeOut.Append(wxT(";"));
883 TelTypeOut.Append(wxT("type=FAX"));
886 } else if (TypePropertyName == wxT("cell")){
888 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Mobile")); } else { FinalFriendlyString.Append(_("Mobile")); }
890 TelTypeOut.Append(wxT(";"));
891 TelTypeOut.Append(wxT("type=CELL"));
894 } else if (TypePropertyName == wxT("video")){
896 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Video")); } else { FinalFriendlyString.Append(_("Video")); }
898 TelTypeOut.Append(wxT(";"));
899 TelTypeOut.Append(wxT("type=VIDEO"));
902 } else if (TypePropertyName == wxT("pager")){
904 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Pager")); } else { FinalFriendlyString.Append(_("Pager")); }
906 TelTypeOut.Append(wxT(";"));
907 TelTypeOut.Append(wxT("type=PAGER"));
910 } else if (TypePropertyName == wxT("textphone")){
912 //if (!TelTypeOut.IsEmpty()){ TelTypeOut.Append(wxT(";")); }
914 if (!FinalFriendlyString.IsEmpty()){ FinalFriendlyString.Append(_(", Textphone")); } else { FinalFriendlyString.Append(_("Textphone")); }
916 TelTypeOut.Append(wxT(";"));
917 TelTypeOut.Append(wxT("type=TEXTPHONE"));
934 // Remove 'tel:' if it is being used.
936 if (wxSPropertySeg2.Mid(0, 4) == wxT("tel:")){
938 FinalTel = wxSPropertySeg2.Mid(4);
942 FinalTel = wxSPropertySeg2;
946 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
948 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".TEL") + TelTypeOut, FinalTel);
949 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), FinalFriendlyString);
950 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-TEL"), wxSPropertySeg2);
954 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".TEL") + TelTypeOut, FinalTel);
955 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), FinalFriendlyString);
956 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-TEL;") + wxSPropertySeg1.Mid(4), wxSPropertySeg2);
962 } else if (wxSProperty == wxT("LANG")){
964 std::map<int, int> SplitPoints;
965 std::map<int, int> SplitLength;
966 std::map<int, int>::iterator SLiter;
967 wxString PropertyData;
968 wxString PropertyName;
969 wxString PropertyValue;
970 wxString PropertyTokens;
971 int intPrevValue = 6;
975 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
977 ContactDatav3.AddRaw(wxT("X-VCARD4-LANG"), wxSPropertySeg2);
981 ContactDatav3.AddRaw(wxT("X-VCARD4-LANG;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
985 } else if (wxSProperty == wxT("GEO")){
987 std::map<int, int> SplitPoints;
988 std::map<int, int> SplitLength;
989 std::map<int, int>::iterator SLiter;
990 wxString PropertyData;
991 wxString PropertyName;
992 wxString PropertyValue;
993 wxString PropertyTokens;
996 int intPrevValue = 5;
1000 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1002 wxString strFinalGeoValue;
1003 wxString strFinalType;
1005 if (wxSPropertySeg2.Mid(0, 3) == wxT("geo")){
1007 strFinalGeoValue = wxSPropertySeg2.Mid(5);
1008 strFinalType = wxT("geo");
1012 wxStringTokenizer wSTSplit(wxSPropertySeg2, wxT(":"));
1013 strFinalType = wSTSplit.GetNextToken();
1014 strFinalGeoValue = wSTSplit.GetNextToken();
1018 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1020 ContactDatav3.AddRaw(wxT("X-VCARD4-GEO;X-GEOTYPE=") + strFinalType, wxSPropertySeg2);
1024 ContactDatav3.AddRaw(wxT("X-VCARD4-GEO;X-GEOTYPE=") + strFinalType + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1028 } else if (wxSProperty == wxT("RELATED")){
1030 std::map<int, int> SplitPoints;
1031 std::map<int, int> SplitLength;
1032 std::map<int, int>::iterator SLiter;
1033 wxString PropertyData;
1034 wxString PropertyName;
1035 wxString PropertyValue;
1036 wxString PropertyTokens;
1037 wxString RelatedType;
1038 wxString RelatedTypeOriginal;
1039 wxString RelatedName;
1040 bool FirstToken = TRUE;
1041 int intPrevValue = 9;
1045 SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
1049 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
1050 intiter != SplitPoints.end(); ++intiter){
1052 SLiter = SplitLength.find(intiter->first);
1054 PropertyData = wxSPropertySeg1.Mid(intPrevValue, (SLiter->second - 1));
1056 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
1057 PropertyName = PropertyElement.GetNextToken();
1058 PropertyValue = PropertyElement.GetNextToken();
1060 if (PropertyName == wxT("TYPE") && FirstToken == TRUE){
1062 if (PropertyValue == wxT("contact")){
1064 strDetail = _("Contact");
1066 } else if (PropertyValue == wxT("acquaintance")){
1068 strDetail = _("Acquaintance");
1070 } else if (PropertyValue == wxT("friend")){
1072 strDetail = _("Friend");
1074 } else if (PropertyValue == wxT("met")){
1076 strDetail = _("Met");
1078 } else if (PropertyValue == wxT("co-worker")){
1080 strDetail = _("Co-worker");
1082 } else if (PropertyValue == wxT("colleague")){
1084 strDetail = _("Colleague");
1086 } else if (PropertyValue == wxT("co-resident")){
1088 strDetail = _("Co-resident");
1090 } else if (PropertyValue == wxT("neighbor")){
1092 strDetail = _("Neighbour");
1094 } else if (PropertyValue == wxT("child")){
1096 strDetail = _("Child");
1098 } else if (PropertyValue == wxT("parent")){
1100 strDetail = _("Parent");
1102 } else if (PropertyValue == wxT("sibling")){
1104 strDetail = _("Sibling");
1106 } else if (PropertyValue == wxT("spouse")){
1108 strDetail = _("Spouse");
1110 } else if (PropertyValue == wxT("kin")){
1112 strDetail = _("Kin");
1114 } else if (PropertyValue == wxT("muse")){
1116 strDetail = _("Muse");
1118 } else if (PropertyValue == wxT("crush")){
1120 strDetail = _("Crush");
1122 } else if (PropertyValue == wxT("date")){
1124 strDetail = _("Date");
1126 } else if (PropertyValue == wxT("sweetheart")){
1128 strDetail = _("Sweetheart");
1130 } else if (PropertyValue == wxT("me")){
1132 strDetail = _("Me");
1134 } else if (PropertyValue == wxT("agent")){
1136 strDetail = _("Agent");
1138 } else if (PropertyValue == wxT("emergency")){
1140 strDetail = _("Emergency");
1144 strDetail = PropertyValue;
1154 if (strDetail.IsEmpty()){
1156 strDetail = _("Relation");
1160 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1162 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABRELATEDNAMES"), wxSPropertySeg2);
1163 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), strDetail);
1164 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-RELATED"), wxSPropertySeg2);
1168 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABRELATEDNAMES"), wxSPropertySeg2);
1169 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), strDetail);
1170 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-RELATED;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1176 } else if (wxSProperty == wxT("URL")){
1178 std::map<int, int> SplitPoints;
1179 std::map<int, int> SplitLength;
1180 std::map<int, int>::iterator SLiter;
1181 wxString PropertyData;
1182 wxString PropertyName;
1183 wxString PropertyValue;
1184 wxString PropertyTokens;
1185 int intPrevValue = 5;
1189 // Todo: Check for X-ABLabel.
1191 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1193 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".URL"), wxSPropertySeg2);
1194 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("URL"));
1195 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-URL"), wxSPropertySeg2);
1199 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".URL"), wxSPropertySeg2);
1200 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-ABLabel"), _("URL"));
1201 ContactDatav3.AddRaw(wxT("item") + wxString::Format(wxT("%i"), ItemSeek) + wxT(".X-VCARD4-URL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1207 } else if (wxSProperty == wxT("TITLE")) {
1209 std::map<int, int> SplitPoints;
1210 std::map<int, int> SplitLength;
1211 std::map<int, int>::iterator SLiter;
1212 wxString PropertyData;
1213 wxString PropertyName;
1214 wxString PropertyValue;
1215 wxString PropertyTokens;
1216 int intPrevValue = 7;
1220 // Look for type before continuing.
1222 if (TitleFirst == FALSE){
1224 ContactDatav3.AddRaw(wxT("TITLE"), wxSPropertySeg2);
1226 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1230 ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE;X-FIRST=TRUE;")
1231 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1239 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1241 ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE"), wxSPropertySeg2);
1245 ContactDatav3.AddRaw(wxT("X-VCARD4-TITLE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1252 } else if (wxSProperty == wxT("ROLE")) {
1254 std::map<int, int> SplitPoints;
1255 std::map<int, int> SplitLength;
1256 std::map<int, int>::iterator SLiter;
1257 wxString PropertyData;
1258 wxString PropertyName;
1259 wxString PropertyValue;
1260 wxString PropertyTokens;
1261 int intPrevValue = 6;
1265 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1267 ContactDatav3.AddRaw(wxT("X-VCARD4-ROLE"), wxSPropertySeg2);
1271 ContactDatav3.AddRaw(wxT("X-VCARD4-ROLE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1275 } else if (wxSProperty == wxT("ORG")) {
1277 std::map<int, int> SplitPoints;
1278 std::map<int, int> SplitLength;
1279 std::map<int, int>::iterator SLiter;
1280 wxString PropertyData;
1281 wxString PropertyName;
1282 wxString PropertyValue;
1283 wxString PropertyTokens;
1284 int intPrevValue = 5;
1288 if (OrganisationFirst == FALSE){
1290 ContactDatav3.AddRaw(wxT("ORG"), wxSPropertySeg2);
1292 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1296 ContactDatav3.AddRaw(wxT("X-VCARD4-ORG;X-FIRST=TRUE;")
1297 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1300 OrganisationFirst = TRUE;
1305 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1307 ContactDatav3.AddRaw(wxT("X-VCARD4-ORG"), wxSPropertySeg2);
1311 ContactDatav3.AddRaw(wxT("X-VCARD4-ORG;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1318 } else if (wxSProperty == wxT("NOTE")) {
1320 std::map<int, int> SplitPoints;
1321 std::map<int, int> SplitLength;
1322 std::map<int, int>::iterator SLiter;
1323 wxString PropertyData;
1324 wxString PropertyName;
1325 wxString PropertyValue;
1326 wxString PropertyTokens;
1327 int intPrevValue = 6;
1331 if (NoteFirst == FALSE){
1333 ContactDatav3.AddRaw(wxT("NOTE"), wxSPropertySeg2);
1335 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1339 ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE;X-FIRST=TRUE;")
1340 + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxT(""));
1348 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1350 ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE"), wxSPropertySeg2);
1354 ContactDatav3.AddRaw(wxT("X-VCARD4-NOTE;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1361 } else if (wxSProperty == wxT("CATEGORIES")) {
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 wxString PropertyType;
1371 int intPrevValue = 12;
1375 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1377 ContactDatav3.AddRaw(wxT("X-VCARD4-CATEGORIES"), wxSPropertySeg2);
1381 ContactDatav3.AddRaw(wxT("X-VCARD4-CATEGORIES;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1385 } else if (wxSProperty == wxT("PHOTO")) {
1387 size_t intPropertyLen = wxSPropertySeg1.Len();
1388 std::map<int, int> SplitPoints;
1389 std::map<int, int> SplitLength;
1390 std::map<int, int>::iterator SLiter;
1391 wxString PropertyData;
1392 wxString PropertyName;
1393 wxString PropertyValue;
1394 wxString PropertyTokens;
1395 int intSplitsFound = 0;
1396 int intSplitSize = 0;
1397 int intPrevValue = 7;
1399 intPropertyLen = wxSPropertySeg2.Len();
1400 SplitPoints.clear();
1401 SplitLength.clear();
1405 CaptureString(&wxSPropertySeg2, FALSE);
1407 for (int i = 0; i <= intPropertyLen; i++){
1411 if (wxSPropertySeg2.Mid(i, 1) == wxT(";")){
1414 SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1)));
1416 if (intSplitsFound == 6){
1418 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1423 SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
1433 wxString wxSPhotoURI;
1434 wxString wxSPhotoMIME;
1435 wxString wxSPhotoEncoding;
1436 wxString wxSPhotoData;
1437 std::string base64enc;
1439 if (intSplitsFound == 0){
1443 std::map<int, int>::iterator striter;
1445 striter = SplitLength.find(1);
1447 wxStringTokenizer wSTDataType(wxSPropertySeg2.Mid(0, striter->second), wxT(":"));
1449 while (wSTDataType.HasMoreTokens() == TRUE){
1451 wxSPhotoURI = wSTDataType.GetNextToken();
1452 wxSPhotoMIME = wSTDataType.GetNextToken();
1457 wxStringTokenizer wSTDataInfo(wxSPropertySeg2.Mid((striter->second + 1)), wxT(","));
1459 while (wSTDataInfo.HasMoreTokens() == TRUE){
1461 wxSPhotoEncoding = wSTDataInfo.GetNextToken();
1462 wxSPhotoData = wSTDataInfo.GetNextToken();
1463 base64enc = wxSPhotoData.mb_str();
1471 if (PhotoFirst == FALSE){
1473 bool PhotoKeepData = FALSE;
1475 wxString wxSPhotoMIMEF;
1477 if (wxSPhotoMIME == wxT("image/png")){
1478 wxSPhotoMIMEF = wxT("PNG");
1479 } else if (wxSPhotoMIME == wxT("image/jpeg")){
1480 wxSPhotoMIMEF = wxT("JPEG");
1481 } else if (wxSPhotoMIME == wxT("image/gif")){
1482 wxSPhotoMIMEF = wxT("GIF");
1483 } else if (wxSPhotoMIME == wxT("image/bmp")){
1484 wxSPhotoMIMEF = wxT("BMP");
1486 wxSPhotoMIMEF = wxT("UNKNOWN");
1487 PhotoKeepData = TRUE;
1490 ContactDatav3.AddRaw(wxT("PHOTO;ENCODING=b;TYPE=") + wxSPhotoMIMEF, wxSPhotoData);
1492 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1496 if (PhotoKeepData == TRUE){
1498 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;X-FIRST=TRUE;")
1499 + ContactLine.Mid((intPrevValue - 1), ((QuoteBreakPoint + 1) - (intPrevValue))), wxSPropertySeg2);
1503 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;X-FIRST=TRUE;")
1504 + ContactLine.Mid((intPrevValue - 1), ((QuoteBreakPoint + 1) - (intPrevValue))), wxT(""));
1514 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1516 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO"), wxSPropertySeg2);
1520 ContactDatav3.AddRaw(wxT("X-VCARD4-PHOTO;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))) + wxT(":"),
1526 } else if (wxSProperty == wxT("LOGO")) {
1528 std::map<int, int> SplitPoints;
1529 std::map<int, int> SplitLength;
1530 std::map<int, int>::iterator SLiter;
1531 wxString PropertyData;
1532 wxString PropertyName;
1533 wxString PropertyValue;
1534 wxString PropertyTokens;
1535 int intPrevValue = 6;
1539 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1541 ContactDatav3.AddRaw(wxT("X-VCARD4-LOGO"), wxSPropertySeg2);
1545 ContactDatav3.AddRaw(wxT("X-VCARD4-LOGO;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1549 } else if (wxSProperty == wxT("SOUND")) {
1551 std::map<int, int> SplitPoints;
1552 std::map<int, int> SplitLength;
1553 std::map<int, int>::iterator SLiter;
1554 wxString PropertyData;
1555 wxString PropertyName;
1556 wxString PropertyValue;
1557 wxString PropertyTokens;
1558 int intPrevValue = 7;
1562 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1564 ContactDatav3.AddRaw(wxT("X-VCARD4-SOUND"), wxSPropertySeg2);
1568 ContactDatav3.AddRaw(wxT("X-VCARD4-SOUND;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1572 } else if (wxSProperty == wxT("CALURI")){
1574 std::map<int, int> SplitPoints;
1575 std::map<int, int> SplitLength;
1576 std::map<int, int>::iterator SLiter;
1577 wxString PropertyData;
1578 wxString PropertyName;
1579 wxString PropertyValue;
1580 wxString PropertyTokens;
1581 int intPrevValue = 8;
1585 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1587 ContactDatav3.AddRaw(wxT("X-VCARD4-CALURI"), wxSPropertySeg2);
1591 ContactDatav3.AddRaw(wxT("X-VCARD4-CALURI;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1595 } else if (wxSProperty == wxT("CALADRURI")){
1597 std::map<int, int> SplitPoints;
1598 std::map<int, int> SplitLength;
1599 std::map<int, int>::iterator SLiter;
1600 wxString PropertyData;
1601 wxString PropertyName;
1602 wxString PropertyValue;
1603 wxString PropertyTokens;
1604 int intPrevValue = 11;
1608 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1610 ContactDatav3.AddRaw(wxT("X-VCARD4-CALADRURI"), wxSPropertySeg2);
1614 ContactDatav3.AddRaw(wxT("X-VCARD4-CALADRURI;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1618 } else if (wxSProperty == wxT("FBURL")){
1620 std::map<int, int> SplitPoints;
1621 std::map<int, int> SplitLength;
1622 std::map<int, int>::iterator SLiter;
1623 wxString PropertyData;
1624 wxString PropertyName;
1625 wxString PropertyValue;
1626 wxString PropertyTokens;
1627 int intPrevValue = 7;
1631 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1633 ContactDatav3.AddRaw(wxT("X-VCARD4-FBURL"), wxSPropertySeg2);
1637 ContactDatav3.AddRaw(wxT("X-VCARD4-FBURL;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1641 } else if (wxSProperty == wxT("KEY")){
1643 std::map<int, int> SplitPoints;
1644 std::map<int, int> SplitLength;
1645 std::map<int, int>::iterator SLiter;
1646 wxString PropertyData;
1647 wxString PropertyName;
1648 wxString PropertyValue;
1649 wxString PropertyTokens;
1650 int intPrevValue = 5;
1654 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1656 ContactDatav3.AddRaw(wxT("X-VCARD4-KEY"), wxSPropertySeg2);
1660 ContactDatav3.AddRaw(wxT("X-VCARD4-KEY;") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1664 } else if (wxSProperty == wxT("UID")){
1666 ContactDatav3.AddRaw(wxT("UID"), wxSPropertySeg2);
1668 } else if (wxSProperty.Mid(0, 3) == wxT("VND")){
1670 // Split the Vendor three ways.
1672 wxStringTokenizer wSTVendorDetails(wxSPropertySeg1, wxT("-"));
1675 wxString wxSVNDPropName;
1677 size_t intPrevValue = (wxSProperty.Len() + 1);
1679 while (wSTVendorDetails.HasMoreTokens() == TRUE){
1681 wSTVendorDetails.GetNextToken();
1682 wxSVNDID = wSTVendorDetails.GetNextToken();
1683 wxSVNDPropName = wSTVendorDetails.GetNextToken();
1688 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1690 ContactDatav3.AddRaw(wxT("X-VCARD4-") + wxSProperty, wxSPropertySeg2);
1694 ContactDatav3.AddRaw(wxT("X-VCARD4-") + wxSProperty + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1698 } else if (wxSProperty.Mid(0, 2) == wxT("X-")){
1700 size_t intPrevValue = (wxSProperty.Len() + 1);
1702 if (((QuoteBreakPoint + 1) - intPrevValue) <= 0){
1704 ContactDatav3.AddRaw(wxSProperty, wxSPropertySeg2);
1708 ContactDatav3.AddRaw(wxSProperty + wxT(";") + ContactLine.Mid(intPrevValue, ((QuoteBreakPoint + 1) - (intPrevValue + 1))), wxSPropertySeg2);
1714 // Reset the variables.
1717 PropertyFind = TRUE;
1718 ExtraLineSeek = TRUE;
1720 QuoteBreakPoint = 0;
1721 ContactLine.Clear();
1722 wxSProperty.Clear();
1726 ContactDatav3.AddRaw(wxT("END"), wxT("VCARD"));
1727 *wxSData = ContactDatav3.WriteString();
1733 bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
1735 std::map<int, wxString> ContactFileLines;
1736 std::map<int, bool> ContactFileProcessed;
1737 std::map<int, bool> ContactFileProcessedWorking;
1738 std::map<int, wxString>::iterator striter;
1739 std::map<int,bool>::iterator iterbool;
1740 std::map<int,bool>::iterator iterboolsub;
1741 wxString ContactLineRec;
1743 // Process the received data.
1745 wxStringTokenizer wSTContactFileLines(*wxSData, wxT("\r\n"));
1747 int ContactLineSeek = 0;
1749 while (wSTContactFileLines.HasMoreTokens() == TRUE){
1751 ContactLineRec = wSTContactFileLines.GetNextToken();
1752 ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLineRec));
1753 ContactFileProcessed.insert(std::make_pair(ContactLineSeek, FALSE));
1758 bool QuoteMode = FALSE;
1759 bool PropertyFind = TRUE;
1760 bool ExtraLineSeek = TRUE;
1761 bool ExtraLineSeekSub = TRUE;
1762 bool BirthdayProcessed = FALSE;
1763 bool AnniversaryProcessed = FALSE;
1764 bool FNProcessed = FALSE;
1765 bool GenderProcessed = FALSE;
1766 bool NameProcessed = FALSE;
1767 bool FNFirst = FALSE;
1768 bool NicknameFirst = FALSE;
1769 bool TitleFirst = FALSE;
1770 bool OrganisationFirst = FALSE;
1771 bool NoteFirst = FALSE;
1772 bool PhotoFirst = FALSE;
1773 bool LogoFirst = FALSE;
1774 bool NameFirst = FALSE;
1775 bool FoundData = FALSE;
1776 int intExtraNickname = 0;
1777 wxString wxSProperty;
1778 wxString wxSPropertyVCARD4;
1779 wxString wxSPropertySeg1;
1780 wxString wxSPropertySeg2;
1781 wxString wxSPropertyNextLine;
1782 wxString ContactLine;
1783 wxString ContactLineSub;
1784 wxString PropertyName;
1785 wxString PropertyValue;
1786 wxString PropertyDataStr;
1787 size_t ContactLineLen = 0;
1788 size_t ContactLineSubLen = 0;
1789 int QuoteBreakPoint = 0;
1790 size_t intPrevValueSub = 0;
1792 std::map<wxString, wxString> PropertyData;
1793 std::map<wxString, bool> PropertyLock;
1794 std::map<wxString, wxString> TempPropertyData;
1795 std::map<wxString, bool> TempPropertyLock;
1796 std::map<int, int> TempSplitPoints;
1797 std::map<int, int> TempSplitLength;
1798 std::map<int, int>::iterator SLiter;
1800 wxString PropertFindSub;
1801 wxString wxSPropertySub;
1802 wxString wxSPropertySeg1Sub;
1803 wxString wxSPropertySeg2Sub;
1804 wxString wxSPropertyValues;
1805 wxString wxSPropertyData;
1806 wxString wxSPropertyNameConv;
1807 wxString wxSPropertyXVCard4Value;
1808 wxString ItemProcString;
1810 bool XVCard4Value = FALSE;
1811 bool VCard3Value = FALSE;
1812 bool SeekItemData = FALSE;
1816 // Setup the version string.
1818 strVer.Append(wxT("-//Xestia//Address Book Version "));
1819 strVer.Append(wxT(XSDAB_VERSION));
1820 strVer.Append(wxT("//KW"));
1822 vCardOut->AddRaw(wxT("BEGIN"), wxT("VCARD"));
1823 vCardOut->AddRaw(wxT("VERSION"), wxT("4.0"));
1824 vCardOut->AddRaw(wxT("PRODID"), strVer);
1833 // Process the properties which have X-FIRST.
1835 // Clone the ContactFileProcessed into ContactFileProcessedWorking.
1837 ContactFileProcessedWorking.insert(ContactFileProcessed.begin(), ContactFileProcessed.end());
1839 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
1840 iter != ContactFileLines.end(); ++iter){
1842 ExtraLineSeek = TRUE;
1844 iterbool = ContactFileProcessed.find(iter->first);
1846 ContactLine = iter->second;
1848 // Ignore certain variables as they are not needed.
1850 if (ContactLine == wxT("BEGIN:VCARD") ||
1851 ContactLine == wxT("END:VCARD") ||
1852 ContactLine.Mid(0, 8) == wxT("VERSION:") ||
1853 ContactLine.Mid(0, 7) == wxT("PRODID:") ||
1854 ContactLine.Mid(0, 5) == wxT("X-AIM") ||
1855 ContactLine.Mid(0, 5) == wxT("X-MSN") ||
1856 ContactLine.Mid(0, 5) == wxT("X-ICQ") ||
1857 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") ||
1858 ContactLine.Mid(0, 7) == wxT("X-YAHOO") ||
1859 ContactLine.Mid(0, 7) == wxT("X-SKYPE") ||
1860 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
1861 ContactLine.Mid(0, 4) == wxT("REV:")){
1863 iterbool->second = TRUE;
1868 if (iterbool->second == TRUE){
1874 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
1880 if (ContactLine.Mid(0, 4) == wxT("item")){
1882 // Line is a itemn... so ignore.
1888 std::map<int,int> DataLineProcess;
1889 std::map<int, bool>::iterator DLSLiter;
1890 std::map<int,int> DataLineProcessOriginal;
1891 int DataLineSeek = 0;
1892 int DataLineSeekOrig = 0;
1894 std::map<int,wxString>::iterator itersub = iter;
1895 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterbool->first));
1898 while (ExtraLineSeek == TRUE){
1900 // Check if there is extra data on the next line
1901 // (indicated by space or tab at the start) and add data.
1905 if (itersub == ContactFileLines.end()){
1911 iterboolsub = ContactFileProcessed.find(itersub->first);
1913 if (iterboolsub == ContactFileProcessed.end()){
1919 if (iterboolsub->second == TRUE){
1925 wxSPropertyNextLine = itersub->second;
1927 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
1929 wxSPropertyNextLine.Remove(0, 1);
1930 //wxSPropertyNextLine.Trim(FALSE);
1931 //ContactLine.Trim();
1932 ContactLine.Append(wxSPropertyNextLine);
1933 DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterboolsub->first));
1935 //iterboolsub->second = TRUE;
1939 ExtraLineSeek = FALSE;
1945 ContactLineLen = ContactLine.Len();
1947 for (int i = 0; i <= ContactLineLen; i++){
1949 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
1951 PropertyFind = FALSE;
1953 } else if (PropertyFind == TRUE){
1955 wxSProperty.Append(ContactLine.Mid(i, 1));
1959 if (ContactLine.Mid(i, 1) == wxT("\"")){
1961 if (QuoteMode == TRUE){
1973 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
1975 QuoteBreakPoint = i;
1982 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
1983 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
1985 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
1986 wxSProperty = wxSPropertySegSplit.GetNextToken();
1988 // Check what type of property it is.
1992 if ((wxSProperty == wxT("PHOTO") && PhotoFirst == FALSE) ||
1993 (wxSProperty == wxT("NICKNAME") && NicknameFirst == FALSE) ||
1994 (wxSProperty == wxT("TITLE") && TitleFirst == FALSE) ||
1995 (wxSProperty == wxT("FN") && FNFirst == FALSE) ||
1996 (wxSProperty == wxT("ORG") && OrganisationFirst == FALSE) ||
1997 (wxSProperty == wxT("NOTE") && NoteFirst == FALSE)){
1999 wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
2000 intPrevValueSub = (wxSPropertyVCARD4.Len() + 2);
2002 for (std::map<int,wxString>::iterator itersub = ContactFileLines.begin();
2003 itersub != ContactFileLines.end(); ++itersub){
2005 //DataLineProcess = DataLineProcessOriginal;
2006 //DataLineSeek = DataLineSeekOrig;
2008 ContactLineSub = itersub->second;
2010 ExtraLineSeekSub = TRUE;
2012 iterboolsub = ContactFileProcessed.find(itersub->first);
2013 //std::map<int,bool>::iterator iterorig = ContactFileProcessed.find(itersub->first);
2014 //std::map<int,bool>::iterator itersuborig;
2016 // Ignore certain variables as they are not needed.
2018 if (ContactLineSub == wxT("BEGIN:VCARD") ||
2019 ContactLineSub == wxT("END:VCARD") ||
2020 ContactLineSub.Mid(0, 8) == wxT("VERSION:") ||
2021 ContactLineSub.Mid(0, 7) == wxT("PRODID:") ||
2022 ContactLineSub.Mid(0, 5) == wxT("X-AIM") ||
2023 ContactLineSub.Mid(0, 5) == wxT("X-MSN") ||
2024 ContactLineSub.Mid(0, 5) == wxT("X-ICQ") ||
2025 ContactLineSub.Mid(0, 10) == wxT("X-GADUGADU") ||
2026 ContactLineSub.Mid(0, 7) == wxT("X-YAHOO") ||
2027 ContactLineSub.Mid(0, 7) == wxT("X-SKYPE") ||
2028 ContactLineSub.Mid(0, 8) == wxT("X-JABBER") ||
2029 ContactLineSub.Mid(0, 4) == wxT("REV:")){
2031 iterboolsub->second = TRUE;
2036 if (iterboolsub->second == TRUE){
2042 if (ContactLineSub.Mid(0, 1) == wxT(" ") || ContactLineSub.Mid(0, 1) == wxT("\t")){
2048 if (ContactLineSub.Mid(0, 4) == wxT("item")){
2050 // Line is a itemn... so ignore.
2056 //std::map<int,wxString>::iterator itersub = iter;
2058 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2063 while (ExtraLineSeekSub == TRUE){
2065 if (itersub == ContactFileLines.end()){
2066 ExtraLineSeekSub = FALSE;
2073 iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2075 wxSPropertyNextLine = itersub->second;
2077 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2079 wxSPropertyNextLine.Remove(0, 1);
2080 //wxSPropertyNextLine.Trim(FALSE);
2081 //ContactLine.Trim();
2082 ContactLineSub.Append(wxSPropertyNextLine);
2083 //iterboolsub->second = TRUE;
2084 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2090 ExtraLineSeekSub = FALSE;
2096 /*while (ExtraLineSeekSub == TRUE && iterboolsub != ContactFileProcessedWorking.end()){
2098 // Check if there is extra data on the next line
2099 // (indicated by space or tab at the start) and add data.
2103 iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2105 if (iterboolsub->second == TRUE){
2111 if (itersub == ContactFileLines.end()){
2117 wxSPropertyNextLine = itersub->second;
2119 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2121 wxSPropertyNextLine.Remove(0, 1);
2122 //wxSPropertyNextLine.Trim(FALSE);
2123 //ContactLine.Trim();
2124 ContactLineSub.Append(wxSPropertyNextLine);
2125 //iterboolsub->second = TRUE;
2126 DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
2132 ExtraLineSeekSub = FALSE;
2136 if (iterboolsub == ContactFileProcessedWorking.end()){
2139 ExtraLineSeekSub = FALSE;
2145 ContactLineSubLen = ContactLineSub.Len();
2146 PropertyFind = TRUE;
2147 wxSPropertySub.clear();
2149 for (int i = 0; i <= ContactLineSubLen; i++){
2151 if ((ContactLineSub.Mid(i, 1) == wxT(";") || ContactLineSub.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2153 PropertyFind = FALSE;
2155 } else if (PropertyFind == TRUE){
2157 wxSPropertySub.Append(ContactLineSub.Mid(i, 1));
2161 if (ContactLineSub.Mid(i, 1) == wxT("\"")){
2163 if (QuoteMode == TRUE){
2175 if (ContactLineSub.Mid(i, 1) == wxT(":") && ContactLineSub.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2177 QuoteBreakPoint = i;
2184 if (wxSPropertySub != wxSPropertyVCARD4){
2186 wxSPropertySub.clear();
2188 DataLineProcess.clear();
2193 wxSPropertySeg1Sub = ContactLineSub.Mid(0, QuoteBreakPoint);
2194 wxSPropertySeg2Sub = ContactLineSub.Mid((QuoteBreakPoint + 1));
2196 // Split the property name data.
2198 // Strip the X-VCARD4- from the variable.
2200 wxString wxSPropertyChopped = wxSPropertySeg1Sub.Mid(9);
2202 intPrevValueSub = (wxSProperty.Len() + 2);
2204 SplitValuesData(&wxSPropertyChopped, &TempSplitPoints, &TempSplitLength, (int)intPrevValueSub, &TempPropertyData);
2206 // Process the splitted data into temporary property data.
2208 // Look for certain property names and the X-FIRST
2211 bool ProcessData = FALSE;
2213 // Check for X-FIRST.
2215 for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin();
2216 xfiter != TempPropertyData.end(); ++xfiter){
2218 PropertyName = xfiter->first;
2219 PropertyValue = xfiter->second;
2221 if (PropertyName == wxT("X-FIRST") && PropertyValue == wxT("TRUE")){
2225 if (wxSProperty == wxT("PHOTO")){ PhotoFirst = TRUE; }
2226 else if (wxSProperty == wxT("NICKNAME")){ NicknameFirst = TRUE; }
2227 else if (wxSProperty == wxT("TITLE")){ TitleFirst = TRUE; }
2228 else if (wxSProperty == wxT("FN")){ FNFirst = TRUE; }
2229 else if (wxSProperty == wxT("ORG")){ OrganisationFirst = TRUE; }
2230 else if (wxSProperty == wxT("NOTE")){ NoteFirst = TRUE; }
2237 if (ProcessData == FALSE){
2239 DataLineProcess.clear();
2241 TempPropertyData.clear();
2245 wxT("PHOTODANCEMATCH!");
2247 for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin();
2248 xfiter != TempPropertyData.end(); ++xfiter){
2250 PropertyName = xfiter->first;
2251 PropertyValue = xfiter->second;
2253 if (PropertyName == wxT("X-FIRST")){
2259 PropertyData.insert(std::make_pair(PropertyName, PropertyValue));
2260 PropertyLock.insert(std::make_pair(PropertyName, FALSE));
2264 // Mark all lines as processed.
2266 for (std::map<int,int>::iterator dpiter = DataLineProcess.begin();
2267 dpiter != DataLineProcess.end(); ++dpiter){
2269 DLSLiter = ContactFileProcessed.find(dpiter->second);
2270 DLSLiter->second = TRUE;
2274 for (std::map<int,int>::iterator dpoiter = DataLineProcessOriginal.begin();
2275 dpoiter != DataLineProcessOriginal.end(); ++dpoiter){
2277 DLSLiter = ContactFileProcessed.find(dpoiter->second);
2278 DLSLiter->second = TRUE;
2282 DataLineProcess.clear();
2283 DataLineProcessOriginal.clear();
2285 DataLineSeekOrig = 0;
2286 TempSplitPoints.clear();
2287 TempSplitLength.clear();
2288 TempPropertyData.clear();
2299 wxSProperty.clear();
2300 wxSPropertySub.Clear();
2301 wxSPropertySeg1.Clear();
2302 wxSPropertySeg2.Clear();
2303 wxSPropertySeg1Sub.Clear();
2304 wxSPropertySeg2Sub.Clear();
2305 wxSPropertyValues.Clear();
2306 wxSPropertyData.Clear();
2307 wxSPropertyXVCard4Value.Clear();
2308 wxSPropertyNameConv.Clear();
2309 PropertyData.clear();
2310 PropertyLock.clear();
2311 ContactLine.clear();
2312 ContactLineSub.clear();
2313 DataLineProcess.clear();
2314 DataLineProcessOriginal.clear();
2315 TempSplitPoints.clear();
2316 TempSplitLength.clear();
2317 wxSPropertyVCARD4.clear();
2319 DataLineSeekOrig = 0;
2320 XVCard4Value = FALSE;
2321 VCard3Value = FALSE;
2325 if (FoundData == FALSE){
2327 wxSProperty.clear();
2328 wxSPropertySub.Clear();
2329 wxSPropertySeg1.Clear();
2330 wxSPropertySeg2.Clear();
2331 wxSPropertySeg1Sub.Clear();
2332 wxSPropertySeg2Sub.Clear();
2333 wxSPropertyValues.Clear();
2334 wxSPropertyData.Clear();
2335 wxSPropertyXVCard4Value.Clear();
2336 wxSPropertyNameConv.Clear();
2337 PropertyData.clear();
2338 PropertyLock.clear();
2339 ContactLine.clear();
2340 ContactLineSub.clear();
2341 DataLineProcess.clear();
2342 DataLineProcessOriginal.clear();
2343 TempSplitPoints.clear();
2344 TempSplitLength.clear();
2345 wxSPropertyVCARD4.clear();
2347 DataLineSeekOrig = 0;
2348 XVCard4Value = FALSE;
2349 VCard3Value = FALSE;
2353 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2,
2354 &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value,
2355 &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
2357 wxString FinalPropertyData;
2359 FinalPropertyData.Append(wxSPropertyNameConv);
2361 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin();
2362 striter != PropertyData.end(); ++striter){
2364 FinalPropertyData.Append(wxT(";"));
2365 FinalPropertyData.Append(striter->first);
2366 FinalPropertyData.Append(wxT("="));
2367 FinalPropertyData.Append(striter->second);
2371 wxString FinalPropValue;
2373 if (wxSPropertyXVCard4Value.IsEmpty()){
2375 FinalPropValue = wxSPropertyData;
2379 if (wxSPropertyXVCard4Value != wxSPropertyData){
2381 FinalPropValue = wxSPropertyXVCard4Value;
2387 if (FinalPropertyData.IsEmpty() && FinalPropValue.IsEmpty()){
2393 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
2395 wxSProperty.clear();
2396 wxSPropertySub.Clear();
2397 wxSPropertySeg1.Clear();
2398 wxSPropertySeg2.Clear();
2399 wxSPropertySeg1Sub.Clear();
2400 wxSPropertySeg2Sub.Clear();
2401 wxSPropertyValues.Clear();
2402 wxSPropertyData.Clear();
2403 wxSPropertyXVCard4Value.Clear();
2404 wxSPropertyNameConv.Clear();
2405 //FinalPropertyData.clear();
2406 //FinalPropValue.clear();
2407 PropertyData.clear();
2408 PropertyLock.clear();
2409 ContactLine.clear();
2410 ContactLineSub.clear();
2411 DataLineProcess.clear();
2412 DataLineProcessOriginal.clear();
2413 wxSPropertyVCARD4.clear();
2415 DataLineSeekOrig = 0;
2416 XVCard4Value = FALSE;
2417 VCard3Value = FALSE;
2421 // Process the non-itemn values.
2423 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
2424 iter != ContactFileLines.end(); ++iter){
2426 ExtraLineSeek = TRUE;
2428 iterbool = ContactFileProcessed.find(iter->first);
2430 ContactLine = iter->second;
2432 // Ignore certain variables as they are not needed.
2434 if (ContactLine == wxT("BEGIN:VCARD") ||
2435 ContactLine == wxT("END:VCARD") ||
2436 ContactLine.Mid(0, 8) == wxT("VERSION:") ||
2437 ContactLine.Mid(0, 7) == wxT("PRODID:") ||
2438 ContactLine.Mid(0, 5) == wxT("X-AIM") ||
2439 ContactLine.Mid(0, 5) == wxT("X-MSN") ||
2440 ContactLine.Mid(0, 5) == wxT("X-ICQ") ||
2441 ContactLine.Mid(0, 10) == wxT("X-GADUGADU") ||
2442 ContactLine.Mid(0, 7) == wxT("X-YAHOO") ||
2443 ContactLine.Mid(0, 7) == wxT("X-SKYPE") ||
2444 ContactLine.Mid(0, 8) == wxT("X-JABBER") ||
2445 ContactLine.Mid(0, 4) == wxT("REV:")){
2447 iterbool->second = TRUE;
2452 if (iterbool->second == TRUE){
2458 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
2464 if (ContactLine.Mid(0, 4) == wxT("item")){
2466 // Line is a itemn... so ignore.
2472 std::map<int,wxString>::iterator itersub = iter;
2474 while (ExtraLineSeek == TRUE){
2476 // Check if there is extra data on the next line
2477 // (indicated by space or tab at the start) and add data.
2479 if (itersub == ContactFileLines.end()){
2480 ExtraLineSeekSub = FALSE;
2488 iterboolsub = ContactFileProcessedWorking.find(itersub->first);
2490 if (iterboolsub == ContactFileProcessedWorking.end()){
2496 if (iterboolsub->second == TRUE){
2502 if (itersub == ContactFileLines.end()){
2508 wxSPropertyNextLine = itersub->second;
2510 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2512 wxSPropertyNextLine.Remove(0, 1);
2513 //wxSPropertyNextLine.Trim(FALSE);
2514 //ContactLine.Trim();
2515 ContactLine.Append(wxSPropertyNextLine);
2516 iterboolsub->second = TRUE;
2520 ExtraLineSeek = FALSE;
2526 ContactLineLen = ContactLine.Len();
2528 for (int i = 0; i <= ContactLineLen; i++){
2530 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2532 PropertyFind = FALSE;
2534 } else if (PropertyFind == TRUE){
2536 wxSProperty.Append(ContactLine.Mid(i, 1));
2540 if (ContactLine.Mid(i, 1) == wxT("\"")){
2542 if (QuoteMode == TRUE){
2554 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2556 QuoteBreakPoint = i;
2563 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
2564 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
2566 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1, wxT(";"));
2567 wxSProperty = wxSPropertySegSplit.GetNextToken();
2569 std::map<int,int> DataLineProcess;
2570 std::map<int, bool>::iterator DLSLiter;
2572 // Look for the X-VCARD4-(variablename) equivilant.
2574 wxSPropertyVCARD4 = wxT("X-VCARD4-") + wxSProperty;
2576 // Sort out remainder of the types.
2578 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1, &wxSPropertySeg2,
2579 &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value,
2580 &wxSPropertyNameConv, &PropertyData, &PropertyLock, FALSE, &VCard3Value, &XVCard4Value);
2582 wxString FinalPropertyData;
2584 FinalPropertyData.Append(wxSPropertyNameConv);
2586 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin();
2587 striter != PropertyData.end(); ++striter){
2589 FinalPropertyData.Append(wxT(";"));
2590 FinalPropertyData.Append(striter->first);
2591 FinalPropertyData.Append(wxT("="));
2592 FinalPropertyData.Append(striter->second);
2596 wxString FinalPropValue;
2598 if (wxSPropertyXVCard4Value.IsEmpty()){
2600 FinalPropValue = wxSPropertyData;
2604 if (wxSPropertyXVCard4Value != wxSPropertyData){
2606 FinalPropValue = wxSPropertyXVCard4Value;
2612 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
2614 wxSProperty.clear();
2615 wxSPropertySub.Clear();
2616 wxSPropertySeg1.Clear();
2617 wxSPropertySeg2.Clear();
2618 wxSPropertyValues.Clear();
2619 wxSPropertyData.Clear();
2620 wxSPropertyXVCard4Value.Clear();
2621 wxSPropertyNameConv.Clear();
2622 //FinalPropertyData.clear();
2623 //FinalPropValue.clear();
2624 PropertyData.clear();
2625 PropertyLock.clear();
2626 ContactLine.clear();
2627 XVCard4Value = FALSE;
2628 VCard3Value = FALSE;
2634 int NicknameCount = 0;
2643 int RelatedCount = 0;
2648 int CategoryCount = 0;
2652 int CalAdrCount = 0;
2653 int CalReqAdrCount = 0;
2654 int FreeBusyCount = 0;
2656 int VendorCount = 0;
2657 int XTokenCount = 0;
2659 int MaxItemNumber = 0;
2660 int ItemOrdered = 0;
2661 int ItemUnordered = 0;
2663 size_t ItemStringSeekLen = 0;
2664 int ItemSeekSub = 0;
2665 int ItemSeekSecSub = 0;
2666 //int intValueSeek = 1;
2668 std::map<int, wxString> NumberedName;
2669 std::map<int, wxString> NumberedData;
2670 std::map<int, wxString> NumberedPropValues;
2671 std::map<int, wxString> NumberedPropOldValue;
2673 std::map<int, wxString> UnNumberedName;
2674 std::map<int, wxString> UnNumberedData;
2675 std::map<int, wxString> UnNumberedPropValues;
2676 std::map<int, wxString> UnNumberedPropOldValue;
2678 // Part 1: Get the itemn number.
2680 std::map<int,bool>::iterator iterboolsecsub;
2681 std::map<int,wxString>::iterator itersub;
2682 std::map<int, wxString> TempData;
2683 PropertyData.clear();
2684 PropertyLock.clear();
2685 wxString ItemString;
2686 wxString ItemStringSeek;
2687 wxString ItemPropName;
2688 ContactLineSeek = 0;
2690 ContactLineSub.clear();
2691 ExtraLineSeekSub = 0;
2692 wxString wxSPropertyNextLineSub;
2693 ContactLineSubLen = 0;
2695 PropertFindSub.clear();
2696 wxSPropertySub.clear();
2697 wxSPropertySeg1Sub.clear();
2698 wxSPropertySeg2Sub.clear();
2699 wxSPropertyValues.clear();
2700 wxSPropertyData.clear();
2701 wxSPropertyNameConv.clear();
2702 wxSPropertyXVCard4Value.clear();
2703 ItemProcString.clear();
2705 XVCard4Value = FALSE;
2706 VCard3Value = FALSE;
2707 SeekItemData = FALSE;
2709 std::map<wxString, void*> ItemMapIndex;
2710 //std::map<wxString, wxString> ItemNameIndex;
2712 // Look for item in the initial line, process into a proper line then
2713 // look for other lines with the same item association.
2715 for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
2716 iter != ContactFileLines.end(); ++iter){
2718 ExtraLineSeek = TRUE;
2720 iterbool = ContactFileProcessed.find(iter->first);
2722 if (iterbool->second == TRUE){
2728 ContactLine = iter->second;
2730 if (ContactLine.Mid(0, 1) == wxT(" ") || ContactLine.Mid(0, 1) == wxT("\t")){
2736 if (ContactLine.Mid(0, 4) != wxT("item")){
2744 //ContactLineSeekSub = ContactLineSeek;
2745 std::map<int,wxString>::iterator itersub = iter;
2747 while (ExtraLineSeek == TRUE){
2749 // Check if there is extra data on the next line
2750 // (indicated by space or tab at the start) and add data.
2753 iterboolsub = ContactFileProcessed.find(itersub->first);
2755 if (iterboolsub == ContactFileProcessed.end()){
2761 if (iterboolsub->second == TRUE){
2767 if (itersub == ContactFileLines.end()){
2773 wxSPropertyNextLine = itersub->second;
2775 if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
2777 wxSPropertyNextLine.Remove(0, 1);
2778 //wxSPropertyNextLine.Trim(FALSE);
2779 //ContactLine.Trim();
2780 ContactLine.Append(wxSPropertyNextLine);
2781 iterboolsub->second = TRUE;
2785 ExtraLineSeek = FALSE;
2791 ContactLineLen = ContactLine.Len();
2793 for (int i = 0; i <= ContactLineLen; i++){
2795 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2797 PropertyFind = FALSE;
2799 } else if (PropertyFind == TRUE){
2801 wxSProperty.Append(ContactLine.Mid(i, 1));
2805 if (ContactLine.Mid(i, 1) == wxT("\"")){
2807 if (QuoteMode == TRUE){
2819 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2821 QuoteBreakPoint = i;
2828 wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
2829 wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
2831 // Go through the lines and collect the lines like itemn.
2833 std::map<int,wxString> *ItemListData;
2834 ItemListData = new std::map<int,wxString>;
2836 wxStringTokenizer ItemData(wxSPropertySeg1, wxT("."));
2838 ItemString = ItemData.GetNextToken();
2839 ItemStringSeek = wxT("item") + ItemString.Mid(4);
2841 wxStringTokenizer ItemPropSplit(ItemData.GetNextToken(), wxT(";"));
2843 ItemPropName = ItemPropSplit.GetNextToken();
2845 ItemStringSeekLen = ItemStringSeek.Len();
2849 for (std::map<int,wxString>::iterator itersec = ContactFileLines.begin();
2850 itersec != ContactFileLines.end(); ++itersec){
2852 ExtraLineSeek = TRUE;
2854 iterboolsub = ContactFileProcessed.find(itersec->first);
2856 if (iterboolsub->second == TRUE){
2862 ContactLineSub = itersec->second;
2864 wxStringTokenizer ItemProcData(ContactLineSub, wxT("."));
2865 ItemProcString = ItemData.GetNextToken();
2867 if (ItemStringSeek != ContactLineSub.Mid(0, ItemStringSeekLen)){
2875 ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
2877 iterboolsub->second = TRUE;
2881 //ItemNameIndex.insert(std::make_pair(ItemStringSeek, ItemPropName));
2882 ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
2883 ItemMapIndex.insert(std::make_pair(ItemStringSeek, ItemListData));
2887 // Process each itemn set.
2889 for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
2890 iter != ItemMapIndex.end(); ++iter){
2892 std::map<int, wxString> *ItemDataPtr;
2894 ItemDataPtr = (std::map<int,wxString>*)iter->second;
2896 for (std::map<int,wxString>::iterator itersub = ItemDataPtr->begin();
2897 itersub != ItemDataPtr->end(); ++itersub){
2899 ContactLine = itersub->second;
2901 ContactLineLen = ContactLine.Len();
2903 for (int i = 0; i <= ContactLineLen; i++){
2905 if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
2907 PropertyFind = FALSE;
2909 } else if (PropertyFind == TRUE){
2911 wxSProperty.Append(ContactLine.Mid(i, 1));
2915 if (ContactLine.Mid(i, 1) == wxT("\"")){
2917 if (QuoteMode == TRUE){
2929 if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
2931 QuoteBreakPoint = i;
2938 wxSPropertySeg1Sub = ContactLine.Mid(0, QuoteBreakPoint);
2939 wxSPropertySeg2Sub = ContactLine.Mid((QuoteBreakPoint + 1));
2941 wxStringTokenizer wxSPropertySegSplit(wxSPropertySeg1Sub, wxT(";"));
2942 wxSProperty = wxSPropertySegSplit.GetNextToken();
2944 // Sort out remainder of the types.
2946 // Skip certain X-* IM variables as they are processed via
2949 if (wxSProperty == wxT("X-AIM") || wxSProperty == wxT("X-MSN") ||
2950 wxSProperty == wxT("X-ICQ") || wxSProperty == wxT("X-GADUGADU") ||
2951 wxSProperty == wxT("X-YAHOO") || wxSProperty == wxT("X-SKYPE") ||
2952 wxSProperty == wxT("X-JABBER")){
2954 wxSProperty.clear();
2955 wxSPropertySub.Clear();
2956 wxSPropertySeg1.Clear();
2957 wxSPropertySeg2.Clear();
2958 wxSPropertyValues.Clear();
2959 wxSPropertyData.Clear();
2960 wxSPropertyXVCard4Value.Clear();
2961 wxSPropertyNameConv.Clear();
2962 //FinalPropertyData.clear();
2963 //FinalPropValue.clear();
2964 PropertyData.clear();
2965 PropertyLock.clear();
2966 ContactLine.clear();
2967 XVCard4Value = FALSE;
2968 VCard3Value = FALSE;
2973 ConvertV4PropertyProc(&wxSProperty, &wxSPropertySeg1Sub, &wxSPropertySeg2Sub,
2974 &wxSPropertyValues, &wxSPropertyData, &wxSPropertyXVCard4Value,
2975 &wxSPropertyNameConv, &PropertyData, &PropertyLock, TRUE, &VCard3Value, &XVCard4Value);
2979 if (wxSPropertyNameConv.IsEmpty()){
2981 wxSProperty.clear();
2982 wxSPropertySub.Clear();
2983 wxSPropertySeg1.Clear();
2984 wxSPropertySeg2.Clear();
2985 wxSPropertyValues.Clear();
2986 wxSPropertyData.Clear();
2987 wxSPropertyXVCard4Value.Clear();
2988 wxSPropertyNameConv.Clear();
2989 //FinalPropertyData.clear();
2990 //FinalPropValue.clear();
2991 PropertyData.clear();
2992 PropertyLock.clear();
2993 ContactLine.clear();
2994 XVCard4Value = FALSE;
2995 VCard3Value = FALSE;
3000 wxString FinalPropertyData;
3002 FinalPropertyData.Append(wxSPropertyNameConv);
3004 for (std::map<wxString, wxString>::iterator striter = PropertyData.begin();
3005 striter != PropertyData.end(); ++striter){
3007 FinalPropertyData.Append(wxT(";"));
3008 FinalPropertyData.Append(striter->first);
3009 FinalPropertyData.Append(wxT("="));
3010 FinalPropertyData.Append(striter->second);
3014 wxString FinalPropValue;
3016 if (wxSPropertyXVCard4Value.IsEmpty()){
3018 FinalPropValue = wxSPropertyData;
3022 if (wxSPropertyXVCard4Value != wxSPropertyData){
3024 FinalPropValue = wxSPropertyData;
3028 FinalPropValue = wxSPropertyXVCard4Value;
3034 vCardOut->AddRaw(FinalPropertyData, FinalPropValue);
3036 wxSProperty.clear();
3037 wxSPropertySub.Clear();
3038 wxSPropertySeg1Sub.Clear();
3039 wxSPropertySeg2Sub.Clear();
3040 wxSPropertyValues.Clear();
3041 wxSPropertyData.Clear();
3042 wxSPropertyXVCard4Value.Clear();
3043 wxSPropertyNameConv.Clear();
3044 FinalPropertyData.clear();
3045 FinalPropValue.clear();
3046 PropertyData.clear();
3047 PropertyLock.clear();
3048 ContactLine.clear();
3049 XVCard4Value = FALSE;
3050 VCard3Value = FALSE;
3053 //PropertyData.clear();
3054 //PropertyLock.clear();
3060 std::map<int, wxString> *ItemEraseData;
3062 for (std::map<wxString, void*>::iterator iter = ItemMapIndex.begin();
3063 iter != ItemMapIndex.end(); ++iter){
3065 ItemEraseData = (std::map<int,wxString>*)iter->second;
3067 delete ItemEraseData;
3068 ItemEraseData = NULL;
3072 ItemMapIndex.clear();
3074 vCardOut->AddRaw(wxT("END"), wxT("VCARD"));
3080 void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
3081 wxString *wxSPropertySeg1Ptr, wxString *wxSPropertySeg2Ptr,
3082 wxString *wxSPropertyPropValuesOut, wxString *wxSPropertyDataOut,
3083 wxString *wxSPropertyXVCard4Value, wxString *wxSPropertyDataNameOut,
3084 std::map<wxString,wxString> *PropertyDataMap,
3085 std::map<wxString,bool> *PropertyLockMap,
3086 bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
3088 wxString wxSProperty;
3089 wxString wxSPropertySeg1Chopped;
3090 size_t intPropertyLen;
3092 if (ProcessItemData == TRUE){
3094 wxStringTokenizer wxSPropertySplit(*wxSPropertyName, wxT("."));
3096 wxSPropertySplit.GetNextToken();
3097 wxSProperty = wxSPropertySplit.GetNextToken();
3099 // Look for . in wxSPropertySeg1Ptr and remove all data before
3102 int ItemSeek = wxSPropertySeg1Ptr->Find(wxT("."));
3103 wxSPropertySeg1Chopped = wxSPropertySeg1Ptr->Mid((ItemSeek + 1));
3108 wxSProperty = *wxSPropertyName;
3113 // Go through each of the vCard 3.0 properties.
3117 if (wxSProperty == wxT("EMAIL")){
3119 if (ProcessItemData == TRUE){
3121 intPropertyLen = wxSPropertySeg1Chopped.Len();
3125 intPropertyLen = wxSPropertySeg1Ptr->Len();
3129 std::map<int, int> SplitPoints;
3130 std::map<int, int> SplitLength;
3131 std::map<int, int>::iterator SLiter;
3132 wxString PropertyData;
3133 wxString PropertyName;
3134 wxString PropertyValue;
3135 wxString PropertyTokens;
3136 bool FirstToken = TRUE;
3137 int intPrevValue = 7;
3139 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3140 *wxSPropertyDataNameOut = wxT("EMAIL");
3141 *VCardV3Value = TRUE;
3143 if (ProcessItemData == TRUE){
3145 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3149 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3153 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3154 intiter != SplitPoints.end(); ++intiter){
3156 SLiter = SplitLength.find(intiter->first);
3158 if (ProcessItemData == TRUE){
3160 if (FirstToken == TRUE){
3162 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3167 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3173 if (FirstToken == TRUE){
3175 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3180 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3186 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3187 PropertyName = PropertyElement.GetNextToken();
3188 PropertyValue = PropertyElement.GetNextToken();
3190 //ProcessCaptureStrings(&PropertyValue);
3192 intPrevValue = intiter->second;
3194 if (PropertyName == wxT("type") && PropertyValue == wxT("INTERNET")){
3198 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3200 if (ProcessItemData == FALSE){
3201 PropertyName = wxT("PREF");
3202 PropertyValue = wxT("50");
3209 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3210 PropertyValue = wxT("home");
3213 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3214 PropertyValue = wxT("work");
3217 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3218 PropertyName = wxT("X-TYPE");
3219 PropertyValue = wxT("other");
3222 // Process properties.
3224 if (PropertyName.IsEmpty()){
3230 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3232 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3233 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3237 PropertyDataMap->erase(PropertyName);
3238 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3239 PropertyLockMap->erase(PropertyName);
3240 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3250 if (wxSProperty == wxT("ADR")){
3252 if (ProcessItemData == TRUE){
3254 intPropertyLen = wxSPropertySeg1Chopped.Len();
3258 intPropertyLen = wxSPropertySeg1Ptr->Len();
3262 std::map<int, int> SplitPoints;
3263 std::map<int, int> SplitLength;
3264 std::map<int, int>::iterator SLiter;
3265 wxString PropertyData;
3266 wxString PropertyName;
3267 wxString PropertyValue;
3268 wxString PropertyTokens;
3269 bool FirstToken = TRUE;
3270 int intPrevValue = 5;
3272 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3273 *wxSPropertyDataNameOut = wxT("ADR");
3274 *VCardV3Value = TRUE;
3276 if (ProcessItemData == TRUE){
3278 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3282 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3286 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3287 intiter != SplitPoints.end(); ++intiter){
3289 SLiter = SplitLength.find(intiter->first);
3291 if (ProcessItemData == TRUE){
3293 if (FirstToken == TRUE){
3295 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3300 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3306 if (FirstToken == TRUE){
3308 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3313 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3319 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3320 PropertyName = PropertyElement.GetNextToken();
3321 PropertyValue = PropertyElement.GetNextToken();
3323 //ProcessCaptureStrings(&PropertyValue);
3325 intPrevValue = intiter->second;
3327 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3329 if (ProcessItemData == FALSE){
3330 PropertyName = wxT("PREF");
3331 PropertyValue = wxT("50");
3338 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3339 PropertyValue = wxT("home");
3342 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3343 PropertyValue = wxT("work");
3346 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3347 PropertyName = wxT("X-TYPE");
3348 PropertyValue = wxT("other");
3351 // Process properties.
3353 if (PropertyName.IsEmpty()){
3359 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3361 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3362 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3366 PropertyDataMap->erase(PropertyName);
3367 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3368 PropertyLockMap->erase(PropertyName);
3369 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3379 if (wxSProperty == wxT("LABEL")){
3381 if (ProcessItemData == TRUE){
3383 intPropertyLen = wxSPropertySeg1Chopped.Len();
3387 intPropertyLen = wxSPropertySeg1Ptr->Len();
3391 std::map<int, int> SplitPoints;
3392 std::map<int, int> SplitLength;
3393 std::map<int, int>::iterator SLiter;
3394 wxString PropertyData;
3395 wxString PropertyName;
3396 wxString PropertyValue;
3397 wxString PropertyTokens;
3398 bool FirstToken = TRUE;
3399 int intPrevValue = 7;
3401 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3402 *wxSPropertyDataNameOut = wxT("ADR");
3403 *VCardV3Value = TRUE;
3405 if (ProcessItemData == TRUE){
3407 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3411 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3415 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3416 intiter != SplitPoints.end(); ++intiter){
3418 SLiter = SplitLength.find(intiter->first);
3420 if (ProcessItemData == TRUE){
3422 if (FirstToken == TRUE){
3424 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3429 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3435 if (FirstToken == TRUE){
3437 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3442 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3448 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3449 PropertyName = PropertyElement.GetNextToken();
3450 PropertyValue = PropertyElement.GetNextToken();
3452 //ProcessCaptureStrings(&PropertyValue);
3454 intPrevValue = intiter->second;
3456 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3460 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3461 PropertyValue = wxT("home");
3464 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3465 PropertyValue = wxT("work");
3468 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3469 PropertyName = wxT("X-TYPE");
3470 PropertyValue = wxT("other");
3473 // Process properties.
3475 if (PropertyName.IsEmpty()){
3481 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3483 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3484 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3488 PropertyDataMap->erase(PropertyName);
3489 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3490 PropertyLockMap->erase(PropertyName);
3491 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3497 PropertyDataMap->insert(std::make_pair(wxT("X-LABEL"), wxT("TRUE")));
3503 if (wxSProperty == wxT("IMPP")){
3505 if (ProcessItemData == TRUE){
3507 intPropertyLen = wxSPropertySeg1Chopped.Len();
3511 intPropertyLen = wxSPropertySeg1Ptr->Len();
3515 std::map<int, int> SplitPoints;
3516 std::map<int, int> SplitLength;
3517 std::map<int, int>::iterator SLiter;
3518 wxString PropertyData;
3519 wxString PropertyName;
3520 wxString PropertyValue;
3521 wxString PropertyTokens;
3522 bool FirstToken = TRUE;
3523 int intPrevValue = 6;
3525 wxStringTokenizer IMPPSplit(*wxSPropertySeg2Ptr, wxT(":"));
3529 IMPPType = IMPPSplit.GetNextToken();
3531 if (IMPPSplit.HasMoreTokens()){
3533 IMPPData = IMPPSplit.GetNextToken();
3535 if (IMPPType == wxT("ymsgr")){
3537 IMPPType = wxT("yahoo");
3541 *wxSPropertySeg2Ptr = IMPPType + wxT(":") + IMPPData;
3545 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3546 *wxSPropertyDataNameOut = wxT("IMPP");
3547 *VCardV3Value = TRUE;
3549 if (ProcessItemData == TRUE){
3551 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3555 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3559 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3560 intiter != SplitPoints.end(); ++intiter){
3562 SLiter = SplitLength.find(intiter->first);
3564 if (ProcessItemData == TRUE){
3566 if (FirstToken == TRUE){
3568 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3573 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3579 if (FirstToken == TRUE){
3581 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3586 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3592 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3593 PropertyName = PropertyElement.GetNextToken();
3594 PropertyValue = PropertyElement.GetNextToken();
3596 //ProcessCaptureStrings(&PropertyValue);
3598 intPrevValue = intiter->second;
3600 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3604 if (PropertyName == wxT("X-SERVICE-TYPE")){
3608 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3609 PropertyValue = wxT("home");
3612 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3613 PropertyValue = wxT("work");
3616 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3617 PropertyName = wxT("X-TYPE");
3618 PropertyValue = wxT("other");
3621 // Process properties.
3623 if (PropertyName.IsEmpty()){
3629 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3631 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3632 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3636 PropertyDataMap->erase(PropertyName);
3637 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3638 PropertyLockMap->erase(PropertyName);
3639 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3649 if (wxSProperty == wxT("TEL")){
3651 if (ProcessItemData == TRUE){
3653 intPropertyLen = wxSPropertySeg1Chopped.Len();
3657 intPropertyLen = wxSPropertySeg1Ptr->Len();
3661 std::map<int, int> SplitPoints;
3662 std::map<int, int> SplitLength;
3663 std::map<int, int>::iterator SLiter;
3664 std::map<wxString, wxString> TelType;
3665 wxString PropertyData;
3666 wxString PropertyName;
3667 wxString PropertyValue;
3668 wxString PropertyTokens;
3669 bool FirstToken = TRUE;
3670 int intPrevValue = 5;
3672 wxSPropertyDataOut->Append(wxT("tel:"));
3673 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3674 *wxSPropertyDataNameOut = wxT("TEL");
3675 *VCardV3Value = TRUE;
3677 if (ProcessItemData == TRUE){
3679 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3683 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3687 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3688 intiter != SplitPoints.end(); ++intiter){
3690 SLiter = SplitLength.find(intiter->first);
3692 if (ProcessItemData == TRUE){
3694 if (FirstToken == TRUE){
3696 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3701 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3707 if (FirstToken == TRUE){
3709 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3714 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3720 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3721 PropertyName = PropertyElement.GetNextToken();
3722 PropertyValue = PropertyElement.GetNextToken();
3724 //ProcessCaptureStrings(&PropertyValue);
3726 intPrevValue = intiter->second;
3728 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3732 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
3733 TelType.insert(std::make_pair(wxT("home"), wxT("home")));
3737 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
3738 TelType.insert(std::make_pair(wxT("work"), wxT("work")));
3742 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
3743 PropertyName = wxT("X-TYPE");
3744 PropertyValue = wxT("other");
3747 // Process the telephone type options.
3751 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXT") || PropertyValue == wxT("text"))){
3752 TelType.insert(std::make_pair(wxT("text"), wxT("text")));
3758 if (PropertyName == wxT("type") && (PropertyValue == wxT("VOICE") || PropertyValue == wxT("voice"))){
3759 TelType.insert(std::make_pair(wxT("voice"), wxT("voice")));
3765 if (PropertyName == wxT("type") && (PropertyValue == wxT("FAX") || PropertyValue == wxT("fax"))){
3766 TelType.insert(std::make_pair(wxT("fax"), wxT("fax")));
3772 if (PropertyName == wxT("type") && (PropertyValue == wxT("CELL") || PropertyValue == wxT("cell"))){
3773 TelType.insert(std::make_pair(wxT("cell"), wxT("cell")));
3779 if (PropertyName == wxT("type") && (PropertyValue == wxT("VIDEO") || PropertyValue == wxT("video"))){
3780 TelType.insert(std::make_pair(wxT("video"), wxT("video")));
3786 if (PropertyName == wxT("type") && (PropertyValue == wxT("PAGER") || PropertyValue == wxT("pager"))){
3787 TelType.insert(std::make_pair(wxT("pager"), wxT("pager")));
3793 if (PropertyName == wxT("type") && (PropertyValue == wxT("TEXTPHONE") || PropertyValue == wxT("textphone"))){
3794 TelType.insert(std::make_pair(wxT("textphone"), wxT("textphone")));
3798 if (PropertyName == wxT("type") && PropertyValue.Find(wxT(",")) != wxNOT_FOUND){
3799 wxStringTokenizer TypeSplit(PropertyValue, wxT(","));
3800 wxString TypeSplitData;
3801 while (TypeSplit.HasMoreTokens()){
3803 TypeSplitData = TypeSplit.GetNextToken();
3804 TelType.insert(std::make_pair(TypeSplitData, TypeSplitData));
3805 TypeSplitData.clear();
3811 // Process properties.
3813 if (PropertyName.IsEmpty()){
3819 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3821 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3822 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3826 PropertyDataMap->erase(PropertyName);
3827 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3828 PropertyLockMap->erase(PropertyName);
3829 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3835 wxString TelFinalString;
3836 bool TelFirstToken = TRUE;
3838 for (std::map<wxString, wxString>::iterator intiter = TelType.begin();
3839 intiter != TelType.end(); ++intiter){
3841 // Process the type data into a single value. (e.g. TYPE="work,voice,cell").
3843 if (TelFirstToken == TRUE){
3845 TelFinalString.Append(wxT("\""));
3846 TelFinalString.Append(intiter->first);
3847 TelFirstToken = FALSE;
3851 TelFinalString.Append(wxT(","));
3852 TelFinalString.Append(intiter->first);
3858 if (TelFirstToken == FALSE){
3860 TelFinalString.Append(wxT("\""));
3864 if (!TelFinalString.IsEmpty()){
3866 if (PropertyDataMap->find(wxT("TYPE")) == PropertyDataMap->end()){
3868 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
3869 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
3873 PropertyDataMap->erase(PropertyName);
3874 PropertyDataMap->insert(std::make_pair(wxT("type"), TelFinalString));
3875 PropertyLockMap->erase(PropertyName);
3876 PropertyLockMap->insert(std::make_pair(wxT("type"), TRUE));
3886 if (wxSProperty == wxT("X-ABRELATEDNAMES")){
3888 if (ProcessItemData == TRUE){
3890 intPropertyLen = wxSPropertySeg1Chopped.Len();
3894 intPropertyLen = wxSPropertySeg1Ptr->Len();
3898 std::map<int, int> SplitPoints;
3899 std::map<int, int> SplitLength;
3900 std::map<int, int>::iterator SLiter;
3901 wxString PropertyData;
3902 wxString PropertyName;
3903 wxString PropertyValue;
3904 wxString PropertyTokens;
3905 bool FirstToken = TRUE;
3906 int intPrevValue = 18;
3908 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
3909 *wxSPropertyDataNameOut = wxT("RELATED");
3910 *VCardV3Value = TRUE;
3912 if (ProcessItemData == TRUE){
3914 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
3918 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
3922 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
3923 intiter != SplitPoints.end(); ++intiter){
3925 SLiter = SplitLength.find(intiter->first);
3927 if (ProcessItemData == TRUE){
3929 if (FirstToken == TRUE){
3931 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
3936 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
3942 if (FirstToken == TRUE){
3944 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
3949 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
3955 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
3956 PropertyName = PropertyElement.GetNextToken();
3957 PropertyValue = PropertyElement.GetNextToken();
3959 //ProcessCaptureStrings(&PropertyValue);
3961 intPrevValue = intiter->second;
3963 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
3967 // Process properties.
3969 if (PropertyName.IsEmpty()){
3975 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
3977 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3978 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3982 PropertyDataMap->erase(PropertyName);
3983 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
3984 PropertyLockMap->erase(PropertyName);
3985 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
3995 if (wxSProperty == wxT("URL")){
3997 if (ProcessItemData == TRUE){
3999 intPropertyLen = wxSPropertySeg1Chopped.Len();
4003 intPropertyLen = wxSPropertySeg1Ptr->Len();
4007 std::map<int, int> SplitPoints;
4008 std::map<int, int> SplitLength;
4009 std::map<int, int>::iterator SLiter;
4010 wxString PropertyData;
4011 wxString PropertyName;
4012 wxString PropertyValue;
4013 wxString PropertyTokens;
4014 bool FirstToken = TRUE;
4015 int intPrevValue = 5;
4017 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4018 *wxSPropertyDataNameOut = wxT("URL");
4019 *VCardV3Value = TRUE;
4021 if (ProcessItemData == TRUE){
4023 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4027 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4031 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4032 intiter != SplitPoints.end(); ++intiter){
4034 SLiter = SplitLength.find(intiter->first);
4036 if (ProcessItemData == TRUE){
4038 if (FirstToken == TRUE){
4040 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4045 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4051 if (FirstToken == TRUE){
4053 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4058 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4064 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4065 PropertyName = PropertyElement.GetNextToken();
4066 PropertyValue = PropertyElement.GetNextToken();
4068 //ProcessCaptureStrings(&PropertyValue);
4070 intPrevValue = intiter->second;
4072 if (PropertyName == wxT("type") && PropertyValue == wxT("pref")){
4076 if (PropertyName == wxT("type") && (PropertyValue == wxT("HOME") || PropertyValue == wxT("home"))){
4077 PropertyValue = wxT("home");
4080 if (PropertyName == wxT("type") && (PropertyValue == wxT("WORK") || PropertyValue == wxT("work"))){
4081 PropertyValue = wxT("work");
4084 if (PropertyName == wxT("type") && (PropertyValue == wxT("OTHER") || PropertyValue == wxT("other"))){
4085 PropertyName = wxT("X-TYPE");
4086 PropertyValue = wxT("other");
4089 // Process properties.
4091 if (PropertyName.IsEmpty()){
4097 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4099 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4100 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4104 PropertyDataMap->erase(PropertyName);
4105 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4106 PropertyLockMap->erase(PropertyName);
4107 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4117 if (wxSProperty == wxT("TITLE")){
4119 if (ProcessItemData == TRUE){
4121 intPropertyLen = wxSPropertySeg1Chopped.Len();
4125 intPropertyLen = wxSPropertySeg1Ptr->Len();
4129 std::map<int, int> SplitPoints;
4130 std::map<int, int> SplitLength;
4131 std::map<int, int>::iterator SLiter;
4132 wxString PropertyData;
4133 wxString PropertyName;
4134 wxString PropertyValue;
4135 wxString PropertyTokens;
4136 bool FirstToken = TRUE;
4137 int intPrevValue = 7;
4139 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4140 *wxSPropertyDataNameOut = wxT("TITLE");
4141 *VCardV3Value = TRUE;
4143 if (ProcessItemData == TRUE){
4145 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4149 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4153 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4154 intiter != SplitPoints.end(); ++intiter){
4156 SLiter = SplitLength.find(intiter->first);
4158 if (ProcessItemData == TRUE){
4160 if (FirstToken == TRUE){
4162 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4167 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4173 if (FirstToken == TRUE){
4175 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4180 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4186 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4187 PropertyName = PropertyElement.GetNextToken();
4188 PropertyValue = PropertyElement.GetNextToken();
4190 //ProcessCaptureStrings(&PropertyValue);
4192 intPrevValue = intiter->second;
4194 // Process properties.
4196 if (PropertyName.IsEmpty()){
4202 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4204 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4205 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4209 PropertyDataMap->erase(PropertyName);
4210 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4211 PropertyLockMap->erase(PropertyName);
4212 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4222 if (wxSProperty == wxT("FN")){
4224 if (ProcessItemData == TRUE){
4226 intPropertyLen = wxSPropertySeg1Chopped.Len();
4230 intPropertyLen = wxSPropertySeg1Ptr->Len();
4234 std::map<int, int> SplitPoints;
4235 std::map<int, int> SplitLength;
4236 std::map<int, int>::iterator SLiter;
4237 wxString PropertyData;
4238 wxString PropertyName;
4239 wxString PropertyValue;
4240 wxString PropertyTokens;
4241 bool FirstToken = TRUE;
4242 int intPrevValue = 4;
4244 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4245 *wxSPropertyDataNameOut = wxT("FN");
4246 *VCardV3Value = TRUE;
4248 if (ProcessItemData == TRUE){
4250 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4254 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4258 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4259 intiter != SplitPoints.end(); ++intiter){
4261 SLiter = SplitLength.find(intiter->first);
4263 if (ProcessItemData == TRUE){
4265 if (FirstToken == TRUE){
4267 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4272 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4278 if (FirstToken == TRUE){
4280 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4285 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4291 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4292 PropertyName = PropertyElement.GetNextToken();
4293 PropertyValue = PropertyElement.GetNextToken();
4295 //ProcessCaptureStrings(&PropertyValue);
4297 intPrevValue = intiter->second;
4299 // Process properties.
4301 if (PropertyName.IsEmpty()){
4307 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4309 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4310 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4314 PropertyDataMap->erase(PropertyName);
4315 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4316 PropertyLockMap->erase(PropertyName);
4317 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4327 if (wxSProperty == wxT("N")){
4329 if (ProcessItemData == TRUE){
4331 intPropertyLen = wxSPropertySeg1Chopped.Len();
4335 intPropertyLen = wxSPropertySeg1Ptr->Len();
4339 std::map<int, int> SplitPoints;
4340 std::map<int, int> SplitLength;
4341 std::map<int, int>::iterator SLiter;
4342 wxString PropertyData;
4343 wxString PropertyName;
4344 wxString PropertyValue;
4345 wxString PropertyTokens;
4346 bool FirstToken = TRUE;
4347 int intPrevValue = 3;
4349 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4350 *wxSPropertyDataNameOut = wxT("N");
4351 *VCardV3Value = TRUE;
4353 if (ProcessItemData == TRUE){
4355 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4359 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4363 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4364 intiter != SplitPoints.end(); ++intiter){
4366 SLiter = SplitLength.find(intiter->first);
4368 if (ProcessItemData == TRUE){
4370 if (FirstToken == TRUE){
4372 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4377 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4383 if (FirstToken == TRUE){
4385 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4390 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4396 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4397 PropertyName = PropertyElement.GetNextToken();
4398 PropertyValue = PropertyElement.GetNextToken();
4400 //ProcessCaptureStrings(&PropertyValue);
4402 intPrevValue = intiter->second;
4404 // Process properties.
4406 if (PropertyName.IsEmpty()){
4412 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4414 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4415 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4419 PropertyDataMap->erase(PropertyName);
4420 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4421 PropertyLockMap->erase(PropertyName);
4422 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4432 if (wxSProperty == wxT("UID")){
4434 if (ProcessItemData == TRUE){
4436 intPropertyLen = wxSPropertySeg1Chopped.Len();
4440 intPropertyLen = wxSPropertySeg1Ptr->Len();
4444 std::map<int, int> SplitPoints;
4445 std::map<int, int> SplitLength;
4446 std::map<int, int>::iterator SLiter;
4447 wxString PropertyData;
4448 wxString PropertyName;
4449 wxString PropertyValue;
4450 wxString PropertyTokens;
4451 bool FirstToken = TRUE;
4452 int intPrevValue = 5;
4454 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4455 *wxSPropertyDataNameOut = wxT("UID");
4456 *VCardV3Value = TRUE;
4458 if (ProcessItemData == TRUE){
4460 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4464 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4468 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4469 intiter != SplitPoints.end(); ++intiter){
4471 SLiter = SplitLength.find(intiter->first);
4473 if (ProcessItemData == TRUE){
4475 if (FirstToken == TRUE){
4477 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4482 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4488 if (FirstToken == TRUE){
4490 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4495 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4501 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4502 PropertyName = PropertyElement.GetNextToken();
4503 PropertyValue = PropertyElement.GetNextToken();
4505 //ProcessCaptureStrings(&PropertyValue);
4507 intPrevValue = intiter->second;
4509 // Process properties.
4511 if (PropertyName.IsEmpty()){
4517 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4519 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4520 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4524 PropertyDataMap->erase(PropertyName);
4525 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4526 PropertyLockMap->erase(PropertyName);
4527 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4537 if (wxSProperty == wxT("NICKNAME")){
4539 if (ProcessItemData == TRUE){
4541 intPropertyLen = wxSPropertySeg1Chopped.Len();
4545 intPropertyLen = wxSPropertySeg1Ptr->Len();
4549 std::map<int, int> SplitPoints;
4550 std::map<int, int> SplitLength;
4551 std::map<int, int>::iterator SLiter;
4552 wxString PropertyData;
4553 wxString PropertyName;
4554 wxString PropertyValue;
4555 wxString PropertyTokens;
4556 bool FirstToken = TRUE;
4557 int intPrevValue = 10;
4559 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4560 *wxSPropertyDataNameOut = wxT("NICKNAME");
4561 *VCardV3Value = TRUE;
4563 if (ProcessItemData == TRUE){
4565 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4569 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4573 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4574 intiter != SplitPoints.end(); ++intiter){
4576 SLiter = SplitLength.find(intiter->first);
4578 if (ProcessItemData == TRUE){
4580 if (FirstToken == TRUE){
4582 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4587 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4593 if (FirstToken == TRUE){
4595 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4600 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4606 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4607 PropertyName = PropertyElement.GetNextToken();
4608 PropertyValue = PropertyElement.GetNextToken();
4610 //ProcessCaptureStrings(&PropertyValue);
4612 intPrevValue = intiter->second;
4614 // Process properties.
4616 if (PropertyName.IsEmpty()){
4622 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4624 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4625 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4629 PropertyDataMap->erase(PropertyName);
4630 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4631 PropertyLockMap->erase(PropertyName);
4632 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4642 if (wxSProperty == wxT("GENDER")){
4644 if (ProcessItemData == TRUE){
4646 intPropertyLen = wxSPropertySeg1Chopped.Len();
4650 intPropertyLen = wxSPropertySeg1Ptr->Len();
4654 std::map<int, int> SplitPoints;
4655 std::map<int, int> SplitLength;
4656 std::map<int, int>::iterator SLiter;
4657 wxString PropertyData;
4658 wxString PropertyName;
4659 wxString PropertyValue;
4660 wxString PropertyTokens;
4661 bool FirstToken = TRUE;
4662 int intPrevValue = 8;
4664 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
4665 *wxSPropertyDataNameOut = wxT("GENDER");
4666 *VCardV3Value = TRUE;
4668 if (ProcessItemData == TRUE){
4670 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4674 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4678 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4679 intiter != SplitPoints.end(); ++intiter){
4681 SLiter = SplitLength.find(intiter->first);
4683 if (ProcessItemData == TRUE){
4685 if (FirstToken == TRUE){
4687 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4692 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4698 if (FirstToken == TRUE){
4700 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4705 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4711 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4712 PropertyName = PropertyElement.GetNextToken();
4713 PropertyValue = PropertyElement.GetNextToken();
4715 //ProcessCaptureStrings(&PropertyValue);
4717 intPrevValue = intiter->second;
4719 // Process properties.
4721 if (PropertyName.IsEmpty()){
4727 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4729 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4730 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4734 PropertyDataMap->erase(PropertyName);
4735 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4736 PropertyLockMap->erase(PropertyName);
4737 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4747 if (wxSProperty == wxT("BDAY")){
4749 if (ProcessItemData == TRUE){
4751 intPropertyLen = wxSPropertySeg1Chopped.Len();
4755 intPropertyLen = wxSPropertySeg1Ptr->Len();
4759 std::map<int, int> SplitPoints;
4760 std::map<int, int> SplitLength;
4761 std::map<int, int>::iterator SLiter;
4762 wxString PropertyData;
4763 wxString PropertyName;
4764 wxString PropertyValue;
4765 wxString PropertyTokens;
4766 wxString PropertyXOmitYear;
4767 bool FirstToken = TRUE;
4768 int intPrevValue = 6;
4770 *wxSPropertyDataNameOut = wxT("BDAY");
4771 *VCardV3Value = TRUE;
4773 if (ProcessItemData == TRUE){
4775 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4779 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4783 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4784 intiter != SplitPoints.end(); ++intiter){
4786 SLiter = SplitLength.find(intiter->first);
4788 if (ProcessItemData == TRUE){
4790 if (FirstToken == TRUE){
4792 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4797 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4803 if (FirstToken == TRUE){
4805 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4810 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4816 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4817 PropertyName = PropertyElement.GetNextToken();
4818 PropertyValue = PropertyElement.GetNextToken();
4820 //ProcessCaptureStrings(&PropertyValue);
4822 intPrevValue = intiter->second;
4824 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
4825 PropertyXOmitYear = PropertyValue;
4828 // Process properties.
4830 if (PropertyName.IsEmpty()){
4836 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4838 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4839 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4843 PropertyDataMap->erase(PropertyName);
4844 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4845 PropertyLockMap->erase(PropertyName);
4846 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4852 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
4853 // year matches the X-APPLE-OMIT-YEAR value.
4855 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
4860 DateProc = DateSplit.GetNextToken();
4862 if (DateProc == PropertyXOmitYear){
4864 FinalDate.Append(wxT("--"));
4868 FinalDate.Append(DateProc);
4873 DateProc = DateSplit.GetNextToken();
4875 FinalDate.Append(DateProc);
4878 DateProc = DateSplit.GetNextToken();
4880 FinalDate.Append(DateProc);
4882 wxSPropertyDataOut->Append(FinalDate);
4888 if (wxSProperty == wxT("ANNIVERSARY")){
4890 if (ProcessItemData == TRUE){
4892 intPropertyLen = wxSPropertySeg1Chopped.Len();
4896 intPropertyLen = wxSPropertySeg1Ptr->Len();
4900 std::map<int, int> SplitPoints;
4901 std::map<int, int> SplitLength;
4902 std::map<int, int>::iterator SLiter;
4903 wxString PropertyData;
4904 wxString PropertyName;
4905 wxString PropertyValue;
4906 wxString PropertyTokens;
4907 wxString PropertyXOmitYear;
4908 bool FirstToken = TRUE;
4909 int intPrevValue = 13;
4911 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
4912 *VCardV3Value = TRUE;
4914 if (ProcessItemData == TRUE){
4916 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
4920 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
4924 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
4925 intiter != SplitPoints.end(); ++intiter){
4927 SLiter = SplitLength.find(intiter->first);
4929 if (ProcessItemData == TRUE){
4931 if (FirstToken == TRUE){
4933 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
4938 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
4944 if (FirstToken == TRUE){
4946 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
4951 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
4957 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
4958 PropertyName = PropertyElement.GetNextToken();
4959 PropertyValue = PropertyElement.GetNextToken();
4961 //ProcessCaptureStrings(&PropertyValue);
4963 intPrevValue = intiter->second;
4965 if (PropertyName == wxT("X-APPLE-OMIT-YEAR")){
4966 PropertyXOmitYear = PropertyValue;
4969 // Process properties.
4971 if (PropertyName.IsEmpty()){
4977 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
4979 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4980 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4984 PropertyDataMap->erase(PropertyName);
4985 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
4986 PropertyLockMap->erase(PropertyName);
4987 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
4993 // Convert the date from YYYY-MM-DD to YYYYMMDD or --MMDD depending on if the
4994 // year matches the X-APPLE-OMIT-YEAR value.
4996 wxStringTokenizer DateSplit(*wxSPropertySeg2Ptr, wxT("-"));
5001 DateProc = DateSplit.GetNextToken();
5003 if (DateProc == PropertyXOmitYear){
5005 FinalDate.Append(wxT("--"));
5009 FinalDate.Append(DateProc);
5014 DateProc = DateSplit.GetNextToken();
5016 FinalDate.Append(DateProc);
5019 DateProc = DateSplit.GetNextToken();
5021 FinalDate.Append(DateProc);
5023 wxSPropertyDataOut->Append(FinalDate);
5027 // TZ - Not sure how to process this correctly. So data
5028 // is kept as X-VCARD3-TZ for the time being.
5030 if (wxSProperty == wxT("TZ")){
5032 if (ProcessItemData == TRUE){
5034 intPropertyLen = wxSPropertySeg1Chopped.Len();
5038 intPropertyLen = wxSPropertySeg1Ptr->Len();
5042 std::map<int, int> SplitPoints;
5043 std::map<int, int> SplitLength;
5044 std::map<int, int>::iterator SLiter;
5045 wxString PropertyData;
5046 wxString PropertyName;
5047 wxString PropertyValue;
5048 wxString PropertyTokens;
5049 wxString PropertyXOmitYear;
5050 bool FirstToken = TRUE;
5051 int intPrevValue = 4;
5053 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5054 *wxSPropertyDataNameOut = wxT("X-VCARD3-TZ");
5055 *VCardV3Value = TRUE;
5057 if (ProcessItemData == TRUE){
5059 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5063 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5067 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5068 intiter != SplitPoints.end(); ++intiter){
5070 SLiter = SplitLength.find(intiter->first);
5072 if (ProcessItemData == TRUE){
5074 if (FirstToken == TRUE){
5076 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5081 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5087 if (FirstToken == TRUE){
5089 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5094 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5100 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5101 PropertyName = PropertyElement.GetNextToken();
5102 PropertyValue = PropertyElement.GetNextToken();
5104 //ProcessCaptureStrings(&PropertyValue);
5106 intPrevValue = intiter->second;
5108 // Process properties.
5110 if (PropertyName.IsEmpty()){
5116 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5118 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5119 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5123 PropertyDataMap->erase(PropertyName);
5124 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5125 PropertyLockMap->erase(PropertyName);
5126 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5136 if (wxSProperty == wxT("ROLE")){
5138 if (ProcessItemData == TRUE){
5140 intPropertyLen = wxSPropertySeg1Chopped.Len();
5144 intPropertyLen = wxSPropertySeg1Ptr->Len();
5148 std::map<int, int> SplitPoints;
5149 std::map<int, int> SplitLength;
5150 std::map<int, int>::iterator SLiter;
5151 wxString PropertyData;
5152 wxString PropertyName;
5153 wxString PropertyValue;
5154 wxString PropertyTokens;
5155 wxString PropertyXOmitYear;
5156 bool FirstToken = TRUE;
5157 int intPrevValue = 6;
5159 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5160 *wxSPropertyDataNameOut = wxT("ROLE");
5161 *VCardV3Value = TRUE;
5163 if (ProcessItemData == TRUE){
5165 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5169 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5173 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5174 intiter != SplitPoints.end(); ++intiter){
5176 SLiter = SplitLength.find(intiter->first);
5178 if (ProcessItemData == TRUE){
5180 if (FirstToken == TRUE){
5182 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5187 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5193 if (FirstToken == TRUE){
5195 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5200 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5206 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5207 PropertyName = PropertyElement.GetNextToken();
5208 PropertyValue = PropertyElement.GetNextToken();
5210 //ProcessCaptureStrings(&PropertyValue);
5212 intPrevValue = intiter->second;
5214 // Process properties.
5216 if (PropertyName.IsEmpty()){
5222 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5224 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5225 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5229 PropertyDataMap->erase(PropertyName);
5230 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5231 PropertyLockMap->erase(PropertyName);
5232 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5242 if (wxSProperty == wxT("ORG")){
5244 if (ProcessItemData == TRUE){
5246 intPropertyLen = wxSPropertySeg1Chopped.Len();
5250 intPropertyLen = wxSPropertySeg1Ptr->Len();
5254 std::map<int, int> SplitPoints;
5255 std::map<int, int> SplitLength;
5256 std::map<int, int>::iterator SLiter;
5257 wxString PropertyData;
5258 wxString PropertyName;
5259 wxString PropertyValue;
5260 wxString PropertyTokens;
5261 wxString PropertyXOmitYear;
5262 bool FirstToken = TRUE;
5263 int intPrevValue = 5;
5265 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5266 *wxSPropertyDataNameOut = wxT("ORG");
5267 *VCardV3Value = TRUE;
5269 if (ProcessItemData == TRUE){
5271 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5275 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5279 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5280 intiter != SplitPoints.end(); ++intiter){
5282 SLiter = SplitLength.find(intiter->first);
5284 if (ProcessItemData == TRUE){
5286 if (FirstToken == TRUE){
5288 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5293 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5299 if (FirstToken == TRUE){
5301 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5306 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5312 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5313 PropertyName = PropertyElement.GetNextToken();
5314 PropertyValue = PropertyElement.GetNextToken();
5316 //ProcessCaptureStrings(&PropertyValue);
5318 intPrevValue = intiter->second;
5320 // Process properties.
5322 if (PropertyName.IsEmpty()){
5328 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5330 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5331 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5335 PropertyDataMap->erase(PropertyName);
5336 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5337 PropertyLockMap->erase(PropertyName);
5338 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5348 if (wxSProperty == wxT("NOTE")){
5350 if (ProcessItemData == TRUE){
5352 intPropertyLen = wxSPropertySeg1Chopped.Len();
5356 intPropertyLen = wxSPropertySeg1Ptr->Len();
5360 std::map<int, int> SplitPoints;
5361 std::map<int, int> SplitLength;
5362 std::map<int, int>::iterator SLiter;
5363 wxString PropertyData;
5364 wxString PropertyName;
5365 wxString PropertyValue;
5366 wxString PropertyTokens;
5367 wxString PropertyXOmitYear;
5368 bool FirstToken = TRUE;
5369 int intPrevValue = 6;
5371 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5372 *wxSPropertyDataNameOut = wxT("NOTE");
5373 *VCardV3Value = TRUE;
5375 if (ProcessItemData == TRUE){
5377 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5381 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5385 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5386 intiter != SplitPoints.end(); ++intiter){
5388 SLiter = SplitLength.find(intiter->first);
5390 if (ProcessItemData == TRUE){
5392 if (FirstToken == TRUE){
5394 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5399 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5405 if (FirstToken == TRUE){
5407 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5412 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5418 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5419 PropertyName = PropertyElement.GetNextToken();
5420 PropertyValue = PropertyElement.GetNextToken();
5422 //ProcessCaptureStrings(&PropertyValue);
5424 intPrevValue = intiter->second;
5426 // Process properties.
5428 if (PropertyName.IsEmpty()){
5434 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5436 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5437 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5441 PropertyDataMap->erase(PropertyName);
5442 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5443 PropertyLockMap->erase(PropertyName);
5444 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5454 if (wxSProperty == wxT("PHOTO")){
5456 if (ProcessItemData == TRUE){
5458 intPropertyLen = wxSPropertySeg1Chopped.Len();
5462 intPropertyLen = wxSPropertySeg1Ptr->Len();
5466 std::map<int, int> SplitPoints;
5467 std::map<int, int> SplitLength;
5468 std::map<int, int>::iterator SLiter;
5469 std::map<wxString, wxString> SplitData;
5470 wxString PropertyData;
5471 wxString PropertyName;
5472 wxString PropertyValue;
5473 wxString PropertyTokens;
5474 wxString PropertyXOmitYear;
5475 int intPrevValue = 7;
5477 *wxSPropertyDataNameOut = wxT("PHOTO");
5478 *VCardV3Value = TRUE;
5480 if (ProcessItemData == TRUE){
5482 SplitValuesData(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
5486 SplitValuesData(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue, &SplitData);
5490 wxString wxSMIMEType;
5491 wxString wxSEncType;
5493 for (std::map<wxString, wxString>::iterator intiter = SplitData.begin();
5494 intiter != SplitData.end(); ++intiter){
5496 PropertyName = intiter->first;
5497 PropertyValue = intiter->second;
5499 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
5500 wxSEncType = wxT("base64");
5504 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("PNG")){
5505 wxSMIMEType = wxT("image/png");
5507 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("JPEG")){
5508 wxSMIMEType = wxT("image/jpeg");
5510 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("GIF")){
5511 wxSMIMEType = wxT("image/gif");
5513 } else if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type")) && PropertyValue == wxT("BMP")){
5514 wxSMIMEType = wxT("image/bmp");
5516 } else if (PropertyName == wxT("TYPE") || PropertyName == wxT("type")) {
5517 wxSMIMEType = wxT("image/unknown");
5521 //intPrevValue = intiter->second;
5523 // Process properties.
5525 if (PropertyName.IsEmpty()){
5531 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5533 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5534 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5538 PropertyDataMap->erase(PropertyName);
5539 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5540 PropertyLockMap->erase(PropertyName);
5541 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5547 wxSPropertyDataOut->Append(wxT("data:"));
5548 wxSPropertyDataOut->Append(wxSMIMEType);
5549 wxSPropertyDataOut->Append(wxT(";"));
5550 wxSPropertyDataOut->Append(wxSEncType);
5551 wxSPropertyDataOut->Append(wxT(","));
5552 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5558 if (wxSProperty == wxT("SOUND")){
5560 if (ProcessItemData == TRUE){
5562 intPropertyLen = wxSPropertySeg1Chopped.Len();
5566 intPropertyLen = wxSPropertySeg1Ptr->Len();
5570 std::map<int, int> SplitPoints;
5571 std::map<int, int> SplitLength;
5572 std::map<int, int>::iterator SLiter;
5573 wxString PropertyData;
5574 wxString PropertyName;
5575 wxString PropertyValue;
5576 wxString PropertyTokens;
5577 wxString PropertyXOmitYear;
5578 bool FirstToken = TRUE;
5579 int intPrevValue = 7;
5581 *wxSPropertyDataNameOut = wxT("SOUND");
5582 *VCardV3Value = TRUE;
5584 if (ProcessItemData == TRUE){
5586 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5590 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5594 wxString wxSMIMEType;
5595 wxString wxSEncType;
5597 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5598 intiter != SplitPoints.end(); ++intiter){
5600 SLiter = SplitLength.find(intiter->first);
5602 if (ProcessItemData == TRUE){
5604 if (FirstToken == TRUE){
5606 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5611 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5617 if (FirstToken == TRUE){
5619 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5624 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5630 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5631 PropertyName = PropertyElement.GetNextToken();
5632 PropertyValue = PropertyElement.GetNextToken();
5634 //ProcessCaptureStrings(&PropertyValue);
5636 if (PropertyName == wxT("ENCODING") && PropertyValue == wxT("b")){
5637 wxSEncType = wxT("base64");
5641 if ((PropertyName == wxT("TYPE") || PropertyName == wxT("type"))){
5642 wxSMIMEType = PropertyValue;
5646 intPrevValue = intiter->second;
5648 // Process properties.
5650 if (PropertyName.IsEmpty()){
5656 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5658 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5659 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5663 PropertyDataMap->erase(PropertyName);
5664 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5665 PropertyLockMap->erase(PropertyName);
5666 PropertyLockMap->insert(std::make_pair(PropertyName, TRUE));
5672 wxSPropertyDataOut->Append(wxT("data:"));
5673 wxSPropertyDataOut->Append(wxSMIMEType);
5674 wxSPropertyDataOut->Append(wxT(";"));
5675 wxSPropertyDataOut->Append(wxSEncType);
5676 wxSPropertyDataOut->Append(wxT(","));
5677 wxSPropertyDataOut->Append(*wxSPropertySeg2Ptr);
5681 // Look for backward compatability vCard 4.0 properties.
5685 if (wxSProperty == wxT("X-VCARD4-FN")){
5687 if (ProcessItemData == TRUE){
5689 intPropertyLen = wxSPropertySeg1Chopped.Len();
5693 intPropertyLen = wxSPropertySeg1Ptr->Len();
5694 *wxSPropertyDataNameOut = wxT("FN");
5698 std::map<int, int> SplitPoints;
5699 std::map<int, int> SplitLength;
5700 std::map<int, int>::iterator SLiter;
5701 std::map<wxString, bool>::iterator BIter;;
5702 wxString PropertyData;
5703 wxString PropertyName;
5704 wxString PropertyValue;
5705 wxString PropertyTokens;
5706 bool FirstToken = TRUE;
5707 int intPrevValue = 13;
5709 if (ProcessItemData == TRUE){
5711 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5715 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5719 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5720 intiter != SplitPoints.end(); ++intiter){
5722 SLiter = SplitLength.find(intiter->first);
5724 if (ProcessItemData == TRUE){
5726 if (FirstToken == TRUE){
5728 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5733 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5739 if (FirstToken == TRUE){
5741 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5746 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5752 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5753 PropertyName = PropertyElement.GetNextToken();
5754 PropertyValue = PropertyElement.GetNextToken();
5756 //ProcessCaptureStrings(&PropertyValue);
5758 intPrevValue = intiter->second;
5760 // Process properties.
5762 // Check if there is a lock on the property value. If there is a lock then
5763 // the property value cannot be changed.
5765 if (PropertyName.IsEmpty()){
5771 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5773 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5775 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5779 PropertyDataMap->erase(PropertyName);
5780 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5786 //wxSPropertyPropValuesOut->Append(wxT(";"));
5787 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
5791 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5792 *XVCardV4Value = TRUE;
5798 if (wxSProperty == wxT("X-VCARD4-N")){
5800 if (ProcessItemData == TRUE){
5802 intPropertyLen = wxSPropertySeg1Chopped.Len();
5806 intPropertyLen = wxSPropertySeg1Ptr->Len();
5810 std::map<int, int> SplitPoints;
5811 std::map<int, int> SplitLength;
5812 std::map<int, int>::iterator SLiter;
5813 std::map<wxString, bool>::iterator BIter;;
5814 wxString PropertyData;
5815 wxString PropertyName;
5816 wxString PropertyValue;
5817 wxString PropertyTokens;
5818 bool FirstToken = TRUE;
5819 int intPrevValue = 12;
5821 if (ProcessItemData == TRUE){
5823 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5827 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5828 *wxSPropertyDataNameOut = wxT("N");
5832 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5833 intiter != SplitPoints.end(); ++intiter){
5835 SLiter = SplitLength.find(intiter->first);
5837 if (ProcessItemData == TRUE){
5839 if (FirstToken == TRUE){
5841 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5846 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5852 if (FirstToken == TRUE){
5854 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5859 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5865 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5866 PropertyName = PropertyElement.GetNextToken();
5867 PropertyValue = PropertyElement.GetNextToken();
5869 //ProcessCaptureStrings(&PropertyValue);
5871 intPrevValue = intiter->second;
5873 // Process properties.
5875 // Check if there is a lock on the property value. If there is a lock then
5876 // the property value cannot be changed.
5878 if (PropertyName.IsEmpty()){
5884 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5886 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
5888 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5892 PropertyDataMap->erase(PropertyName);
5893 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
5899 //wxSPropertyPropValuesOut->Append(wxT(";"));
5900 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
5904 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
5905 *XVCardV4Value = TRUE;
5909 // X-VCARD4-NICKNAME
5911 if (wxSProperty == wxT("X-VCARD4-NICKNAME")){
5913 if (ProcessItemData == TRUE){
5915 intPropertyLen = wxSPropertySeg1Chopped.Len();
5919 intPropertyLen = wxSPropertySeg1Ptr->Len();
5923 std::map<int, int> SplitPoints;
5924 std::map<int, int> SplitLength;
5925 std::map<int, int>::iterator SLiter;
5926 std::map<wxString, bool>::iterator BIter;;
5927 wxString PropertyData;
5928 wxString PropertyName;
5929 wxString PropertyValue;
5930 wxString PropertyTokens;
5931 bool FirstToken = TRUE;
5932 int intPrevValue = 19;
5934 if (ProcessItemData == TRUE){
5936 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
5940 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
5941 *wxSPropertyDataNameOut = wxT("NICKNAME");
5945 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
5946 intiter != SplitPoints.end(); ++intiter){
5948 SLiter = SplitLength.find(intiter->first);
5950 if (ProcessItemData == TRUE){
5952 if (FirstToken == TRUE){
5954 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
5959 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
5965 if (FirstToken == TRUE){
5967 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
5972 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
5978 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
5979 PropertyName = PropertyElement.GetNextToken();
5980 PropertyValue = PropertyElement.GetNextToken();
5982 //ProcessCaptureStrings(&PropertyValue);
5984 intPrevValue = intiter->second;
5986 // Process properties.
5988 // Check if there is a lock on the property value. If there is a lock then
5989 // the property value cannot be changed.
5991 if (PropertyName.IsEmpty()){
5997 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
5999 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6001 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6005 PropertyDataMap->erase(PropertyName);
6006 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6012 //wxSPropertyPropValuesOut->Append(wxT(";"));
6013 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6017 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6018 *XVCardV4Value = TRUE;
6024 if (wxSProperty == wxT("X-VCARD4-GENDER")){
6026 if (ProcessItemData == TRUE){
6028 intPropertyLen = wxSPropertySeg1Chopped.Len();
6032 intPropertyLen = wxSPropertySeg1Ptr->Len();
6036 std::map<int, int> SplitPoints;
6037 std::map<int, int> SplitLength;
6038 std::map<int, int>::iterator SLiter;
6039 std::map<wxString, bool>::iterator BIter;;
6040 wxString PropertyData;
6041 wxString PropertyName;
6042 wxString PropertyValue;
6043 wxString PropertyTokens;
6044 bool FirstToken = TRUE;
6045 int intPrevValue = 17;
6047 if (ProcessItemData == TRUE){
6049 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6053 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6054 *wxSPropertyDataNameOut = wxT("GENDER");
6058 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6059 intiter != SplitPoints.end(); ++intiter){
6061 SLiter = SplitLength.find(intiter->first);
6063 if (ProcessItemData == TRUE){
6065 if (FirstToken == TRUE){
6067 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6072 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6078 if (FirstToken == TRUE){
6080 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6085 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6091 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6092 PropertyName = PropertyElement.GetNextToken();
6093 PropertyValue = PropertyElement.GetNextToken();
6095 //ProcessCaptureStrings(&PropertyValue);
6097 intPrevValue = intiter->second;
6099 // Process properties.
6101 // Check if there is a lock on the property value. If there is a lock then
6102 // the property value cannot be changed.
6104 if (PropertyName.IsEmpty()){
6110 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6112 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6114 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6118 PropertyDataMap->erase(PropertyName);
6119 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6125 //wxSPropertyPropValuesOut->Append(wxT(";"));
6126 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6130 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6131 *XVCardV4Value = TRUE;
6137 if (wxSProperty == wxT("X-VCARD4-BDAY")){
6139 if (ProcessItemData == TRUE){
6141 intPropertyLen = wxSPropertySeg1Chopped.Len();
6145 intPropertyLen = wxSPropertySeg1Ptr->Len();
6149 std::map<int, int> SplitPoints;
6150 std::map<int, int> SplitLength;
6151 std::map<int, int>::iterator SLiter;
6152 std::map<wxString, bool>::iterator BIter;;
6153 wxString PropertyData;
6154 wxString PropertyName;
6155 wxString PropertyValue;
6156 wxString PropertyTokens;
6157 bool FirstToken = TRUE;
6158 int intPrevValue = 15;
6160 if (ProcessItemData == TRUE){
6162 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6166 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6167 *wxSPropertyDataNameOut = wxT("BDAY");
6171 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6172 intiter != SplitPoints.end(); ++intiter){
6174 SLiter = SplitLength.find(intiter->first);
6176 if (ProcessItemData == TRUE){
6178 if (FirstToken == TRUE){
6180 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6185 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6191 if (FirstToken == TRUE){
6193 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6198 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6204 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6205 PropertyName = PropertyElement.GetNextToken();
6206 PropertyValue = PropertyElement.GetNextToken();
6208 //ProcessCaptureStrings(&PropertyValue);
6210 intPrevValue = intiter->second;
6212 // Process properties.
6214 // Check if there is a lock on the property value. If there is a lock then
6215 // the property value cannot be changed.
6217 if (PropertyName.IsEmpty()){
6223 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6225 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6227 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6231 PropertyDataMap->erase(PropertyName);
6232 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6238 //wxSPropertyPropValuesOut->Append(wxT(";"));
6239 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6243 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6244 *XVCardV4Value = TRUE;
6248 // X-VCARD4-ANNIVERSARY
6250 if (wxSProperty == wxT("X-VCARD4-ANNIVERSARY")){
6252 if (ProcessItemData == TRUE){
6254 intPropertyLen = wxSPropertySeg1Chopped.Len();
6258 intPropertyLen = wxSPropertySeg1Ptr->Len();
6262 std::map<int, int> SplitPoints;
6263 std::map<int, int> SplitLength;
6264 std::map<int, int>::iterator SLiter;
6265 std::map<wxString, bool>::iterator BIter;;
6266 wxString PropertyData;
6267 wxString PropertyName;
6268 wxString PropertyValue;
6269 wxString PropertyTokens;
6270 bool FirstToken = TRUE;
6271 int intPrevValue = 22;
6273 if (ProcessItemData == TRUE){
6275 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6279 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6280 *wxSPropertyDataNameOut = wxT("ANNIVERSARY");
6284 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6285 intiter != SplitPoints.end(); ++intiter){
6287 SLiter = SplitLength.find(intiter->first);
6289 if (ProcessItemData == TRUE){
6291 if (FirstToken == TRUE){
6293 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6298 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6304 if (FirstToken == TRUE){
6306 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6311 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6317 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6318 PropertyName = PropertyElement.GetNextToken();
6319 PropertyValue = PropertyElement.GetNextToken();
6321 //ProcessCaptureStrings(&PropertyValue);
6323 intPrevValue = intiter->second;
6325 // Process properties.
6327 // Check if there is a lock on the property value. If there is a lock then
6328 // the property value cannot be changed.
6330 if (PropertyName.IsEmpty()){
6336 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6338 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6340 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6344 PropertyDataMap->erase(PropertyName);
6345 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6351 //wxSPropertyPropValuesOut->Append(wxT(";"));
6352 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6356 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6357 *XVCardV4Value = TRUE;
6363 if (wxSProperty == wxT("X-VCARD4-TZ")){
6365 if (ProcessItemData == TRUE){
6367 intPropertyLen = wxSPropertySeg1Chopped.Len();
6371 intPropertyLen = wxSPropertySeg1Ptr->Len();
6375 std::map<int, int> SplitPoints;
6376 std::map<int, int> SplitLength;
6377 std::map<int, int>::iterator SLiter;
6378 std::map<wxString, bool>::iterator BIter;;
6379 wxString PropertyData;
6380 wxString PropertyName;
6381 wxString PropertyValue;
6382 wxString PropertyTokens;
6383 bool FirstToken = TRUE;
6384 int intPrevValue = 13;
6386 if (ProcessItemData == TRUE){
6388 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6392 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6393 *wxSPropertyDataNameOut = wxT("TZ");
6397 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6398 intiter != SplitPoints.end(); ++intiter){
6400 SLiter = SplitLength.find(intiter->first);
6402 if (ProcessItemData == TRUE){
6404 if (FirstToken == TRUE){
6406 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6411 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6417 if (FirstToken == TRUE){
6419 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6424 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6430 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6431 PropertyName = PropertyElement.GetNextToken();
6432 PropertyValue = PropertyElement.GetNextToken();
6434 //ProcessCaptureStrings(&PropertyValue);
6436 intPrevValue = intiter->second;
6438 // Process properties.
6440 // Check if there is a lock on the property value. If there is a lock then
6441 // the property value cannot be changed.
6443 if (PropertyName.IsEmpty()){
6449 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6451 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6453 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6457 PropertyDataMap->erase(PropertyName);
6458 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6464 //wxSPropertyPropValuesOut->Append(wxT(";"));
6465 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6469 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6470 *XVCardV4Value = TRUE;
6476 if (wxSProperty == wxT("X-VCARD4-ADR")){
6478 if (ProcessItemData == TRUE){
6480 intPropertyLen = wxSPropertySeg1Chopped.Len();
6484 intPropertyLen = wxSPropertySeg1Ptr->Len();
6488 std::map<int, int> SplitPoints;
6489 std::map<int, int> SplitLength;
6490 std::map<int, int>::iterator SLiter;
6491 std::map<wxString, bool>::iterator BIter;;
6492 wxString PropertyData;
6493 wxString PropertyName;
6494 wxString PropertyValue;
6495 wxString PropertyTokens;
6496 bool FirstToken = TRUE;
6497 int intPrevValue = 14;
6499 if (ProcessItemData == TRUE){
6501 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6505 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6506 *wxSPropertyDataNameOut = wxT("ADR");
6510 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6511 intiter != SplitPoints.end(); ++intiter){
6513 SLiter = SplitLength.find(intiter->first);
6515 if (ProcessItemData == TRUE){
6517 if (FirstToken == TRUE){
6519 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6524 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6530 if (FirstToken == TRUE){
6532 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6537 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6543 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6544 PropertyName = PropertyElement.GetNextToken();
6545 PropertyValue = PropertyElement.GetNextToken();
6547 //ProcessCaptureStrings(&PropertyValue);
6549 intPrevValue = intiter->second;
6551 // Process properties.
6553 // Check if there is a lock on the property value. If there is a lock then
6554 // the property value cannot be changed.
6556 if (PropertyName.IsEmpty()){
6562 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6564 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6566 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6570 PropertyDataMap->erase(PropertyName);
6571 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6577 //wxSPropertyPropValuesOut->Append(wxT(";"));
6578 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6582 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6583 *XVCardV4Value = TRUE;
6589 if (wxSProperty == wxT("X-VCARD4-EMAIL")){
6591 if (ProcessItemData == TRUE){
6593 intPropertyLen = wxSPropertySeg1Chopped.Len();
6597 intPropertyLen = wxSPropertySeg1Ptr->Len();
6601 std::map<int, int> SplitPoints;
6602 std::map<int, int> SplitLength;
6603 std::map<int, int>::iterator SLiter;
6604 std::map<wxString, bool>::iterator BIter;;
6605 wxString PropertyData;
6606 wxString PropertyName;
6607 wxString PropertyValue;
6608 wxString PropertyTokens;
6609 bool FirstToken = TRUE;
6610 int intPrevValue = 16;
6612 if (ProcessItemData == TRUE){
6614 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6618 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6619 *wxSPropertyDataNameOut = wxT("EMAIL");
6623 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6624 intiter != SplitPoints.end(); ++intiter){
6626 SLiter = SplitLength.find(intiter->first);
6628 if (ProcessItemData == TRUE){
6630 if (FirstToken == TRUE){
6632 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6637 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6643 if (FirstToken == TRUE){
6645 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6650 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6656 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6657 PropertyName = PropertyElement.GetNextToken();
6658 PropertyValue = PropertyElement.GetNextToken();
6660 //ProcessCaptureStrings(&PropertyValue);
6662 intPrevValue = intiter->second;
6664 // Process properties.
6666 // Check if there is a lock on the property value. If there is a lock then
6667 // the property value cannot be changed.
6669 if (PropertyName.IsEmpty()){
6675 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6677 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6679 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6683 PropertyDataMap->erase(PropertyName);
6684 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6690 //wxSPropertyPropValuesOut->Append(wxT(";"));
6691 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6695 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6696 *XVCardV4Value = TRUE;
6702 if (wxSProperty == wxT("X-VCARD4-IMPP")){
6704 if (ProcessItemData == TRUE){
6706 intPropertyLen = wxSPropertySeg1Chopped.Len();
6710 intPropertyLen = wxSPropertySeg1Ptr->Len();
6714 std::map<int, int> SplitPoints;
6715 std::map<int, int> SplitLength;
6716 std::map<int, int>::iterator SLiter;
6717 std::map<wxString, bool>::iterator BIter;;
6718 wxString PropertyData;
6719 wxString PropertyName;
6720 wxString PropertyValue;
6721 wxString PropertyTokens;
6722 bool FirstToken = TRUE;
6723 int intPrevValue = 15;
6725 if (ProcessItemData == TRUE){
6727 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6731 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6732 *wxSPropertyDataNameOut = wxT("IMPP");
6736 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6737 intiter != SplitPoints.end(); ++intiter){
6739 SLiter = SplitLength.find(intiter->first);
6741 if (ProcessItemData == TRUE){
6743 if (FirstToken == TRUE){
6745 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6750 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6756 if (FirstToken == TRUE){
6758 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6763 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6769 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6770 PropertyName = PropertyElement.GetNextToken();
6771 PropertyValue = PropertyElement.GetNextToken();
6773 //ProcessCaptureStrings(&PropertyValue);
6775 intPrevValue = intiter->second;
6777 // Process properties.
6779 // Check if there is a lock on the property value. If there is a lock then
6780 // the property value cannot be changed.
6782 if (PropertyName.IsEmpty()){
6788 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6790 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6792 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6796 PropertyDataMap->erase(PropertyName);
6797 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6803 //wxSPropertyPropValuesOut->Append(wxT(";"));
6804 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6808 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6809 *XVCardV4Value = TRUE;
6815 if (wxSProperty == wxT("X-VCARD4-TEL")){
6817 if (ProcessItemData == TRUE){
6819 intPropertyLen = wxSPropertySeg1Chopped.Len();
6823 intPropertyLen = wxSPropertySeg1Ptr->Len();
6827 std::map<int, int> SplitPoints;
6828 std::map<int, int> SplitLength;
6829 std::map<int, int>::iterator SLiter;
6830 std::map<wxString, bool>::iterator BIter;;
6831 wxString PropertyData;
6832 wxString PropertyName;
6833 wxString PropertyValue;
6834 wxString PropertyTokens;
6835 bool FirstToken = TRUE;
6836 int intPrevValue = 14;
6838 if (ProcessItemData == TRUE){
6840 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6844 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6845 *wxSPropertyDataNameOut = wxT("TEL");
6849 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6850 intiter != SplitPoints.end(); ++intiter){
6852 SLiter = SplitLength.find(intiter->first);
6854 if (ProcessItemData == TRUE){
6856 if (FirstToken == TRUE){
6858 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6863 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6869 if (FirstToken == TRUE){
6871 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6876 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6882 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6883 PropertyName = PropertyElement.GetNextToken();
6884 PropertyValue = PropertyElement.GetNextToken();
6886 //ProcessCaptureStrings(&PropertyValue);
6888 intPrevValue = intiter->second;
6890 // Process properties.
6892 // Check if there is a lock on the property value. If there is a lock then
6893 // the property value cannot be changed.
6895 if (PropertyName.IsEmpty()){
6901 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
6903 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
6905 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6909 PropertyDataMap->erase(PropertyName);
6910 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
6916 //wxSPropertyPropValuesOut->Append(wxT(";"));
6917 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
6921 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
6922 *XVCardV4Value = TRUE;
6928 if (wxSProperty == wxT("X-VCARD4-LANG")){
6930 if (ProcessItemData == TRUE){
6932 intPropertyLen = wxSPropertySeg1Chopped.Len();
6936 intPropertyLen = wxSPropertySeg1Ptr->Len();
6940 std::map<int, int> SplitPoints;
6941 std::map<int, int> SplitLength;
6942 std::map<int, int>::iterator SLiter;
6943 std::map<wxString, bool>::iterator BIter;;
6944 wxString PropertyData;
6945 wxString PropertyName;
6946 wxString PropertyValue;
6947 wxString PropertyTokens;
6948 bool FirstToken = TRUE;
6949 int intPrevValue = 15;
6951 if (ProcessItemData == TRUE){
6953 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
6957 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
6958 *wxSPropertyDataNameOut = wxT("LANG");
6962 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
6963 intiter != SplitPoints.end(); ++intiter){
6965 SLiter = SplitLength.find(intiter->first);
6967 if (ProcessItemData == TRUE){
6969 if (FirstToken == TRUE){
6971 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
6976 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
6982 if (FirstToken == TRUE){
6984 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
6989 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
6995 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
6996 PropertyName = PropertyElement.GetNextToken();
6997 PropertyValue = PropertyElement.GetNextToken();
6999 //ProcessCaptureStrings(&PropertyValue);
7001 intPrevValue = intiter->second;
7003 // Process properties.
7005 // Check if there is a lock on the property value. If there is a lock then
7006 // the property value cannot be changed.
7008 if (PropertyName.IsEmpty()){
7014 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7016 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7018 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7022 PropertyDataMap->erase(PropertyName);
7023 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7029 //wxSPropertyPropValuesOut->Append(wxT(";"));
7030 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7034 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7035 *XVCardV4Value = TRUE;
7041 if (wxSProperty == wxT("X-VCARD4-GEO")){
7043 if (ProcessItemData == TRUE){
7045 intPropertyLen = wxSPropertySeg1Chopped.Len();
7049 intPropertyLen = wxSPropertySeg1Ptr->Len();
7053 std::map<int, int> SplitPoints;
7054 std::map<int, int> SplitLength;
7055 std::map<int, int>::iterator SLiter;
7056 std::map<wxString, bool>::iterator BIter;;
7057 wxString PropertyData;
7058 wxString PropertyName;
7059 wxString PropertyValue;
7060 wxString PropertyTokens;
7061 bool FirstToken = TRUE;
7062 int intPrevValue = 14;
7064 if (ProcessItemData == TRUE){
7066 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7070 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7071 *wxSPropertyDataNameOut = wxT("GEO");
7075 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7076 intiter != SplitPoints.end(); ++intiter){
7078 SLiter = SplitLength.find(intiter->first);
7080 if (ProcessItemData == TRUE){
7082 if (FirstToken == TRUE){
7084 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7089 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7095 if (FirstToken == TRUE){
7097 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7102 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7108 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7109 PropertyName = PropertyElement.GetNextToken();
7110 PropertyValue = PropertyElement.GetNextToken();
7112 //ProcessCaptureStrings(&PropertyValue);
7114 intPrevValue = intiter->second;
7116 // Process properties.
7118 // Check if there is a lock on the property value. If there is a lock then
7119 // the property value cannot be changed.
7121 if (PropertyName.IsEmpty()){
7127 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7129 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7131 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7135 PropertyDataMap->erase(PropertyName);
7136 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7142 //wxSPropertyPropValuesOut->Append(wxT(";"));
7143 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7147 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7148 *XVCardV4Value = TRUE;
7154 if (wxSProperty == wxT("X-VCARD4-RELATED")){
7156 if (ProcessItemData == TRUE){
7158 intPropertyLen = wxSPropertySeg1Chopped.Len();
7162 intPropertyLen = wxSPropertySeg1Ptr->Len();
7166 std::map<int, int> SplitPoints;
7167 std::map<int, int> SplitLength;
7168 std::map<int, int>::iterator SLiter;
7169 std::map<wxString, bool>::iterator BIter;;
7170 wxString PropertyData;
7171 wxString PropertyName;
7172 wxString PropertyValue;
7173 wxString PropertyTokens;
7174 bool FirstToken = TRUE;
7175 int intPrevValue = 18;
7177 if (ProcessItemData == TRUE){
7179 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7183 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7184 *wxSPropertyDataNameOut = wxT("RELATED");
7188 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7189 intiter != SplitPoints.end(); ++intiter){
7191 SLiter = SplitLength.find(intiter->first);
7193 if (ProcessItemData == TRUE){
7195 if (FirstToken == TRUE){
7197 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7202 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7208 if (FirstToken == TRUE){
7210 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7215 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7221 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7222 PropertyName = PropertyElement.GetNextToken();
7223 PropertyValue = PropertyElement.GetNextToken();
7225 //ProcessCaptureStrings(&PropertyValue);
7227 intPrevValue = intiter->second;
7229 // Process properties.
7231 // Check if there is a lock on the property value. If there is a lock then
7232 // the property value cannot be changed.
7234 if (PropertyName.IsEmpty()){
7240 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7242 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7244 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7248 PropertyDataMap->erase(PropertyName);
7249 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7255 //wxSPropertyPropValuesOut->Append(wxT(";"));
7256 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7260 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7261 *XVCardV4Value = TRUE;
7267 if (wxSProperty == wxT("X-VCARD4-URL")){
7269 if (ProcessItemData == TRUE){
7271 intPropertyLen = wxSPropertySeg1Chopped.Len();
7275 intPropertyLen = wxSPropertySeg1Ptr->Len();
7279 std::map<int, int> SplitPoints;
7280 std::map<int, int> SplitLength;
7281 std::map<int, int>::iterator SLiter;
7282 std::map<wxString, bool>::iterator BIter;;
7283 wxString PropertyData;
7284 wxString PropertyName;
7285 wxString PropertyValue;
7286 wxString PropertyTokens;
7287 bool FirstToken = TRUE;
7288 int intPrevValue = 14;
7290 if (ProcessItemData == TRUE){
7292 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7296 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7297 *wxSPropertyDataNameOut = wxT("URL");
7301 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7302 intiter != SplitPoints.end(); ++intiter){
7304 SLiter = SplitLength.find(intiter->first);
7306 if (ProcessItemData == TRUE){
7308 if (FirstToken == TRUE){
7310 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7315 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7321 if (FirstToken == TRUE){
7323 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7328 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7334 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7335 PropertyName = PropertyElement.GetNextToken();
7336 PropertyValue = PropertyElement.GetNextToken();
7338 //ProcessCaptureStrings(&PropertyValue);
7340 intPrevValue = intiter->second;
7342 // Process properties.
7344 // Check if there is a lock on the property value. If there is a lock then
7345 // the property value cannot be changed.
7347 if (PropertyName.IsEmpty()){
7353 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7355 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7357 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7361 PropertyDataMap->erase(PropertyName);
7362 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7368 //wxSPropertyPropValuesOut->Append(wxT(";"));
7369 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7373 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7374 *XVCardV4Value = TRUE;
7380 if (wxSProperty == wxT("X-VCARD4-TITLE")){
7382 if (ProcessItemData == TRUE){
7384 intPropertyLen = wxSPropertySeg1Chopped.Len();
7388 intPropertyLen = wxSPropertySeg1Ptr->Len();
7392 std::map<int, int> SplitPoints;
7393 std::map<int, int> SplitLength;
7394 std::map<int, int>::iterator SLiter;
7395 std::map<wxString, bool>::iterator BIter;;
7396 wxString PropertyData;
7397 wxString PropertyName;
7398 wxString PropertyValue;
7399 wxString PropertyTokens;
7400 bool FirstToken = TRUE;
7401 int intPrevValue = 16;
7403 if (ProcessItemData == TRUE){
7405 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7409 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7410 *wxSPropertyDataNameOut = wxT("TITLE");
7414 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7415 intiter != SplitPoints.end(); ++intiter){
7417 SLiter = SplitLength.find(intiter->first);
7419 if (ProcessItemData == TRUE){
7421 if (FirstToken == TRUE){
7423 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7428 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7434 if (FirstToken == TRUE){
7436 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7441 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7447 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7448 PropertyName = PropertyElement.GetNextToken();
7449 PropertyValue = PropertyElement.GetNextToken();
7451 //ProcessCaptureStrings(&PropertyValue);
7453 intPrevValue = intiter->second;
7455 // Process properties.
7457 // Check if there is a lock on the property value. If there is a lock then
7458 // the property value cannot be changed.
7460 if (PropertyName.IsEmpty()){
7466 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7468 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7470 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7474 PropertyDataMap->erase(PropertyName);
7475 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7481 //wxSPropertyPropValuesOut->Append(wxT(";"));
7482 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7486 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7487 *XVCardV4Value = TRUE;
7493 if (wxSProperty == wxT("X-VCARD4-ROLE")){
7495 if (ProcessItemData == TRUE){
7497 intPropertyLen = wxSPropertySeg1Chopped.Len();
7501 intPropertyLen = wxSPropertySeg1Ptr->Len();
7505 std::map<int, int> SplitPoints;
7506 std::map<int, int> SplitLength;
7507 std::map<int, int>::iterator SLiter;
7508 std::map<wxString, bool>::iterator BIter;;
7509 wxString PropertyData;
7510 wxString PropertyName;
7511 wxString PropertyValue;
7512 wxString PropertyTokens;
7513 bool FirstToken = TRUE;
7514 int intPrevValue = 15;
7516 if (ProcessItemData == TRUE){
7518 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7522 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7523 *wxSPropertyDataNameOut = wxT("ROLE");
7527 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7528 intiter != SplitPoints.end(); ++intiter){
7530 SLiter = SplitLength.find(intiter->first);
7532 if (ProcessItemData == TRUE){
7534 if (FirstToken == TRUE){
7536 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7541 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7547 if (FirstToken == TRUE){
7549 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7554 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7560 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7561 PropertyName = PropertyElement.GetNextToken();
7562 PropertyValue = PropertyElement.GetNextToken();
7564 //ProcessCaptureStrings(&PropertyValue);
7566 intPrevValue = intiter->second;
7568 // Process properties.
7570 // Check if there is a lock on the property value. If there is a lock then
7571 // the property value cannot be changed.
7573 if (PropertyName.IsEmpty()){
7579 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7581 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7583 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7587 PropertyDataMap->erase(PropertyName);
7588 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7594 //wxSPropertyPropValuesOut->Append(wxT(";"));
7595 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7599 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7600 *XVCardV4Value = TRUE;
7606 if (wxSProperty == wxT("X-VCARD4-ORG")){
7608 if (ProcessItemData == TRUE){
7610 intPropertyLen = wxSPropertySeg1Chopped.Len();
7614 intPropertyLen = wxSPropertySeg1Ptr->Len();
7618 std::map<int, int> SplitPoints;
7619 std::map<int, int> SplitLength;
7620 std::map<int, int>::iterator SLiter;
7621 std::map<wxString, bool>::iterator BIter;;
7622 wxString PropertyData;
7623 wxString PropertyName;
7624 wxString PropertyValue;
7625 wxString PropertyTokens;
7626 bool FirstToken = TRUE;
7627 int intPrevValue = 14;
7629 if (ProcessItemData == TRUE){
7631 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7635 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7636 *wxSPropertyDataNameOut = wxT("ORG");
7640 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7641 intiter != SplitPoints.end(); ++intiter){
7643 SLiter = SplitLength.find(intiter->first);
7645 if (ProcessItemData == TRUE){
7647 if (FirstToken == TRUE){
7649 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7654 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7660 if (FirstToken == TRUE){
7662 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7667 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7673 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7674 PropertyName = PropertyElement.GetNextToken();
7675 PropertyValue = PropertyElement.GetNextToken();
7677 //ProcessCaptureStrings(&PropertyValue);
7679 intPrevValue = intiter->second;
7681 // Process properties.
7683 // Check if there is a lock on the property value. If there is a lock then
7684 // the property value cannot be changed.
7686 if (PropertyName.IsEmpty()){
7692 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7694 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7696 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7700 PropertyDataMap->erase(PropertyName);
7701 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7707 //wxSPropertyPropValuesOut->Append(wxT(";"));
7708 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7712 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7713 *XVCardV4Value = TRUE;
7719 if (wxSProperty == wxT("X-VCARD4-NOTE")){
7721 if (ProcessItemData == TRUE){
7723 intPropertyLen = wxSPropertySeg1Chopped.Len();
7727 intPropertyLen = wxSPropertySeg1Ptr->Len();
7731 std::map<int, int> SplitPoints;
7732 std::map<int, int> SplitLength;
7733 std::map<int, int>::iterator SLiter;
7734 std::map<wxString, bool>::iterator BIter;;
7735 wxString PropertyData;
7736 wxString PropertyName;
7737 wxString PropertyValue;
7738 wxString PropertyTokens;
7739 bool FirstToken = TRUE;
7740 int intPrevValue = 15;
7742 if (ProcessItemData == TRUE){
7744 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7748 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7749 *wxSPropertyDataNameOut = wxT("NOTE");
7753 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7754 intiter != SplitPoints.end(); ++intiter){
7756 SLiter = SplitLength.find(intiter->first);
7758 if (ProcessItemData == TRUE){
7760 if (FirstToken == TRUE){
7762 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7767 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7773 if (FirstToken == TRUE){
7775 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7780 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7786 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7787 PropertyName = PropertyElement.GetNextToken();
7788 PropertyValue = PropertyElement.GetNextToken();
7790 //ProcessCaptureStrings(&PropertyValue);
7792 intPrevValue = intiter->second;
7794 // Process properties.
7796 // Check if there is a lock on the property value. If there is a lock then
7797 // the property value cannot be changed.
7799 if (PropertyName.IsEmpty()){
7805 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7807 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7809 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7813 PropertyDataMap->erase(PropertyName);
7814 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7820 //wxSPropertyPropValuesOut->Append(wxT(";"));
7821 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7825 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7826 *XVCardV4Value = TRUE;
7830 // X-VCARD4-CATEGORIES
7832 if (wxSProperty == wxT("X-VCARD4-CATEGORIES")){
7834 if (ProcessItemData == TRUE){
7836 intPropertyLen = wxSPropertySeg1Chopped.Len();
7840 intPropertyLen = wxSPropertySeg1Ptr->Len();
7844 std::map<int, int> SplitPoints;
7845 std::map<int, int> SplitLength;
7846 std::map<int, int>::iterator SLiter;
7847 std::map<wxString, bool>::iterator BIter;;
7848 wxString PropertyData;
7849 wxString PropertyName;
7850 wxString PropertyValue;
7851 wxString PropertyTokens;
7852 bool FirstToken = TRUE;
7853 int intPrevValue = 21;
7855 if (ProcessItemData == TRUE){
7857 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7861 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7862 *wxSPropertyDataNameOut = wxT("CATEGORIES");
7866 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7867 intiter != SplitPoints.end(); ++intiter){
7869 SLiter = SplitLength.find(intiter->first);
7871 if (ProcessItemData == TRUE){
7873 if (FirstToken == TRUE){
7875 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7880 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7886 if (FirstToken == TRUE){
7888 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
7893 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
7899 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
7900 PropertyName = PropertyElement.GetNextToken();
7901 PropertyValue = PropertyElement.GetNextToken();
7903 //ProcessCaptureStrings(&PropertyValue);
7905 intPrevValue = intiter->second;
7907 // Process properties.
7909 // Check if there is a lock on the property value. If there is a lock then
7910 // the property value cannot be changed.
7912 if (PropertyName.IsEmpty()){
7918 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
7920 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
7922 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7926 PropertyDataMap->erase(PropertyName);
7927 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
7933 //wxSPropertyPropValuesOut->Append(wxT(";"));
7934 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
7938 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
7939 *XVCardV4Value = TRUE;
7945 if (wxSProperty == wxT("X-VCARD4-PHOTO")){
7947 if (ProcessItemData == TRUE){
7949 intPropertyLen = wxSPropertySeg1Chopped.Len();
7953 intPropertyLen = wxSPropertySeg1Ptr->Len();
7957 std::map<int, int> SplitPoints;
7958 std::map<int, int> SplitLength;
7959 std::map<int, int>::iterator SLiter;
7960 std::map<wxString, bool>::iterator BIter;;
7961 wxString PropertyData;
7962 wxString PropertyName;
7963 wxString PropertyValue;
7964 wxString PropertyTokens;
7965 bool FirstToken = TRUE;
7966 int intPrevValue = 16;
7968 if (ProcessItemData == TRUE){
7970 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
7974 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
7975 *wxSPropertyDataNameOut = wxT("PHOTO");
7979 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
7980 intiter != SplitPoints.end(); ++intiter){
7982 SLiter = SplitLength.find(intiter->first);
7984 if (ProcessItemData == TRUE){
7986 if (FirstToken == TRUE){
7988 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
7993 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
7999 if (FirstToken == TRUE){
8001 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8006 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8012 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8013 PropertyName = PropertyElement.GetNextToken();
8014 PropertyValue = PropertyElement.GetNextToken();
8016 //ProcessCaptureStrings(&PropertyValue);
8018 intPrevValue = intiter->second;
8020 // Process properties.
8022 // Check if there is a lock on the property value. If there is a lock then
8023 // the property value cannot be changed.
8025 if (PropertyName.IsEmpty()){
8031 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8033 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8035 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8039 PropertyDataMap->erase(PropertyName);
8040 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8046 //wxSPropertyPropValuesOut->Append(wxT(";"));
8047 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8051 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8052 *XVCardV4Value = TRUE;
8058 if (wxSProperty == wxT("X-VCARD4-LOGO")){
8060 if (ProcessItemData == TRUE){
8062 intPropertyLen = wxSPropertySeg1Chopped.Len();
8066 intPropertyLen = wxSPropertySeg1Ptr->Len();
8070 std::map<int, int> SplitPoints;
8071 std::map<int, int> SplitLength;
8072 std::map<int, int>::iterator SLiter;
8073 std::map<wxString, bool>::iterator BIter;;
8074 wxString PropertyData;
8075 wxString PropertyName;
8076 wxString PropertyValue;
8077 wxString PropertyTokens;
8078 bool FirstToken = TRUE;
8079 int intPrevValue = 15;
8081 if (ProcessItemData == TRUE){
8083 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8087 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8088 *wxSPropertyDataNameOut = wxT("LOGO");
8092 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8093 intiter != SplitPoints.end(); ++intiter){
8095 SLiter = SplitLength.find(intiter->first);
8097 if (ProcessItemData == TRUE){
8099 if (FirstToken == TRUE){
8101 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8106 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8112 if (FirstToken == TRUE){
8114 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8119 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8125 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8126 PropertyName = PropertyElement.GetNextToken();
8127 PropertyValue = PropertyElement.GetNextToken();
8129 //ProcessCaptureStrings(&PropertyValue);
8131 intPrevValue = intiter->second;
8133 // Process properties.
8135 // Check if there is a lock on the property value. If there is a lock then
8136 // the property value cannot be changed.
8138 if (PropertyName.IsEmpty()){
8144 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8146 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8148 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8152 PropertyDataMap->erase(PropertyName);
8153 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8159 //wxSPropertyPropValuesOut->Append(wxT(";"));
8160 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8164 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8165 *XVCardV4Value = TRUE;
8171 if (wxSProperty == wxT("X-VCARD4-SOUND")){
8173 if (ProcessItemData == TRUE){
8175 intPropertyLen = wxSPropertySeg1Chopped.Len();
8179 intPropertyLen = wxSPropertySeg1Ptr->Len();
8183 std::map<int, int> SplitPoints;
8184 std::map<int, int> SplitLength;
8185 std::map<int, int>::iterator SLiter;
8186 std::map<wxString, bool>::iterator BIter;;
8187 wxString PropertyData;
8188 wxString PropertyName;
8189 wxString PropertyValue;
8190 wxString PropertyTokens;
8191 bool FirstToken = TRUE;
8192 int intPrevValue = 16;
8194 if (ProcessItemData == TRUE){
8196 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8200 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8201 *wxSPropertyDataNameOut = wxT("SOUND");
8205 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8206 intiter != SplitPoints.end(); ++intiter){
8208 SLiter = SplitLength.find(intiter->first);
8210 if (ProcessItemData == TRUE){
8212 if (FirstToken == TRUE){
8214 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8219 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8225 if (FirstToken == TRUE){
8227 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8232 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8238 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8239 PropertyName = PropertyElement.GetNextToken();
8240 PropertyValue = PropertyElement.GetNextToken();
8242 //ProcessCaptureStrings(&PropertyValue);
8244 intPrevValue = intiter->second;
8246 // Process properties.
8248 // Check if there is a lock on the property value. If there is a lock then
8249 // the property value cannot be changed.
8251 if (PropertyName.IsEmpty()){
8257 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8259 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8261 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8265 PropertyDataMap->erase(PropertyName);
8266 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8272 //wxSPropertyPropValuesOut->Append(wxT(";"));
8273 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8277 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8278 *XVCardV4Value = TRUE;
8284 if (wxSProperty == wxT("X-VCARD4-CALURI")){
8286 if (ProcessItemData == TRUE){
8288 intPropertyLen = wxSPropertySeg1Chopped.Len();
8292 intPropertyLen = wxSPropertySeg1Ptr->Len();
8296 std::map<int, int> SplitPoints;
8297 std::map<int, int> SplitLength;
8298 std::map<int, int>::iterator SLiter;
8299 std::map<wxString, bool>::iterator BIter;;
8300 wxString PropertyData;
8301 wxString PropertyName;
8302 wxString PropertyValue;
8303 wxString PropertyTokens;
8304 bool FirstToken = TRUE;
8305 int intPrevValue = 17;
8307 if (ProcessItemData == TRUE){
8309 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8313 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8314 *wxSPropertyDataNameOut = wxT("CALURI");
8318 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8319 intiter != SplitPoints.end(); ++intiter){
8321 SLiter = SplitLength.find(intiter->first);
8323 if (ProcessItemData == TRUE){
8325 if (FirstToken == TRUE){
8327 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8332 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8338 if (FirstToken == TRUE){
8340 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8345 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8351 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8352 PropertyName = PropertyElement.GetNextToken();
8353 PropertyValue = PropertyElement.GetNextToken();
8355 //ProcessCaptureStrings(&PropertyValue);
8357 intPrevValue = intiter->second;
8359 // Process properties.
8361 // Check if there is a lock on the property value. If there is a lock then
8362 // the property value cannot be changed.
8364 if (PropertyName.IsEmpty()){
8370 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8372 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8374 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8378 PropertyDataMap->erase(PropertyName);
8379 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8385 //wxSPropertyPropValuesOut->Append(wxT(";"));
8386 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8390 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8391 *XVCardV4Value = TRUE;
8395 // X-VCARD4-CALADRURI
8397 if (wxSProperty == wxT("X-VCARD4-CALADRURI")){
8399 if (ProcessItemData == TRUE){
8401 intPropertyLen = wxSPropertySeg1Chopped.Len();
8405 intPropertyLen = wxSPropertySeg1Ptr->Len();
8409 std::map<int, int> SplitPoints;
8410 std::map<int, int> SplitLength;
8411 std::map<int, int>::iterator SLiter;
8412 std::map<wxString, bool>::iterator BIter;;
8413 wxString PropertyData;
8414 wxString PropertyName;
8415 wxString PropertyValue;
8416 wxString PropertyTokens;
8417 bool FirstToken = TRUE;
8418 int intPrevValue = 20;
8420 if (ProcessItemData == TRUE){
8422 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8426 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8427 *wxSPropertyDataNameOut = wxT("CALADRURI");
8431 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8432 intiter != SplitPoints.end(); ++intiter){
8434 SLiter = SplitLength.find(intiter->first);
8436 if (ProcessItemData == TRUE){
8438 if (FirstToken == TRUE){
8440 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8445 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8451 if (FirstToken == TRUE){
8453 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8458 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8464 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8465 PropertyName = PropertyElement.GetNextToken();
8466 PropertyValue = PropertyElement.GetNextToken();
8468 //ProcessCaptureStrings(&PropertyValue);
8470 intPrevValue = intiter->second;
8472 // Process properties.
8474 // Check if there is a lock on the property value. If there is a lock then
8475 // the property value cannot be changed.
8477 if (PropertyName.IsEmpty()){
8483 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8485 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8487 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8491 PropertyDataMap->erase(PropertyName);
8492 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8498 //wxSPropertyPropValuesOut->Append(wxT(";"));
8499 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8503 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8504 *XVCardV4Value = TRUE;
8510 if (wxSProperty == wxT("X-VCARD4-FBURL")){
8512 if (ProcessItemData == TRUE){
8514 intPropertyLen = wxSPropertySeg1Chopped.Len();
8518 intPropertyLen = wxSPropertySeg1Ptr->Len();
8522 std::map<int, int> SplitPoints;
8523 std::map<int, int> SplitLength;
8524 std::map<int, int>::iterator SLiter;
8525 std::map<wxString, bool>::iterator BIter;;
8526 wxString PropertyData;
8527 wxString PropertyName;
8528 wxString PropertyValue;
8529 wxString PropertyTokens;
8530 bool FirstToken = TRUE;
8531 int intPrevValue = 16;
8533 if (ProcessItemData == TRUE){
8535 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8539 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8540 *wxSPropertyDataNameOut = wxT("FBURL");
8544 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8545 intiter != SplitPoints.end(); ++intiter){
8547 SLiter = SplitLength.find(intiter->first);
8549 if (ProcessItemData == TRUE){
8551 if (FirstToken == TRUE){
8553 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8558 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8564 if (FirstToken == TRUE){
8566 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8571 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8577 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8578 PropertyName = PropertyElement.GetNextToken();
8579 PropertyValue = PropertyElement.GetNextToken();
8581 //ProcessCaptureStrings(&PropertyValue);
8583 intPrevValue = intiter->second;
8585 // Process properties.
8587 // Check if there is a lock on the property value. If there is a lock then
8588 // the property value cannot be changed.
8590 if (PropertyName.IsEmpty()){
8596 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8598 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8600 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8604 PropertyDataMap->erase(PropertyName);
8605 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8611 //wxSPropertyPropValuesOut->Append(wxT(";"));
8612 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8616 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8617 *XVCardV4Value = TRUE;
8623 if (wxSProperty == wxT("X-VCARD4-KEY")){
8625 if (ProcessItemData == TRUE){
8627 intPropertyLen = wxSPropertySeg1Chopped.Len();
8631 intPropertyLen = wxSPropertySeg1Ptr->Len();
8635 std::map<int, int> SplitPoints;
8636 std::map<int, int> SplitLength;
8637 std::map<int, int>::iterator SLiter;
8638 std::map<wxString, bool>::iterator BIter;;
8639 wxString PropertyData;
8640 wxString PropertyName;
8641 wxString PropertyValue;
8642 wxString PropertyTokens;
8643 bool FirstToken = TRUE;
8644 int intPrevValue = 14;
8646 if (ProcessItemData == TRUE){
8648 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8652 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8653 *wxSPropertyDataNameOut = wxT("KEY");
8657 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8658 intiter != SplitPoints.end(); ++intiter){
8660 SLiter = SplitLength.find(intiter->first);
8662 if (ProcessItemData == TRUE){
8664 if (FirstToken == TRUE){
8666 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8671 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8677 if (FirstToken == TRUE){
8679 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8684 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8690 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8691 PropertyName = PropertyElement.GetNextToken();
8692 PropertyValue = PropertyElement.GetNextToken();
8694 //ProcessCaptureStrings(&PropertyValue);
8696 intPrevValue = intiter->second;
8698 // Process properties.
8700 // Check if there is a lock on the property value. If there is a lock then
8701 // the property value cannot be changed.
8703 if (PropertyName.IsEmpty()){
8709 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8711 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8713 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8717 PropertyDataMap->erase(PropertyName);
8718 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8724 //wxSPropertyPropValuesOut->Append(wxT(";"));
8725 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8729 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8730 *XVCardV4Value = TRUE;
8736 if (wxSProperty.Mid(0, 12) == wxT("X-VCARD4-VND")){
8738 if (ProcessItemData == TRUE){
8740 intPropertyLen = wxSPropertySeg1Chopped.Len();
8744 intPropertyLen = wxSPropertySeg1Ptr->Len();
8748 std::map<int, int> SplitPoints;
8749 std::map<int, int> SplitLength;
8750 std::map<int, int>::iterator SLiter;
8751 std::map<wxString, bool>::iterator BIter;;
8752 wxString PropertyData;
8753 wxString PropertyName;
8754 wxString PropertyValue;
8755 wxString PropertyTokens;
8756 bool FirstToken = TRUE;
8757 int intPrevValue = 14;
8759 if (ProcessItemData == TRUE){
8761 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8765 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8766 *wxSPropertyDataNameOut = wxSProperty.Mid(9);
8770 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8771 intiter != SplitPoints.end(); ++intiter){
8773 SLiter = SplitLength.find(intiter->first);
8775 if (ProcessItemData == TRUE){
8777 if (FirstToken == TRUE){
8779 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8784 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8790 if (FirstToken == TRUE){
8792 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8797 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8803 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8804 PropertyName = PropertyElement.GetNextToken();
8805 PropertyValue = PropertyElement.GetNextToken();
8807 //ProcessCaptureStrings(&PropertyValue);
8809 intPrevValue = intiter->second;
8811 // Process properties.
8813 // Check if there is a lock on the property value. If there is a lock then
8814 // the property value cannot be changed.
8816 if (PropertyName.IsEmpty()){
8822 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8824 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8826 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8830 PropertyDataMap->erase(PropertyName);
8831 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8837 //wxSPropertyPropValuesOut->Append(wxT(";"));
8838 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8842 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8843 *XVCardV4Value = TRUE;
8847 // X-ADDRESSBOOKSERVER-KIND
8849 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-KIND")){
8853 if (ProcessItemData == TRUE){
8855 intPropertyLen = wxSPropertySeg1Chopped.Len();
8859 intPropertyLen = wxSPropertySeg1Ptr->Len();
8863 std::map<int, int> SplitPoints;
8864 std::map<int, int> SplitLength;
8865 std::map<int, int>::iterator SLiter;
8866 std::map<wxString, bool>::iterator BIter;;
8867 wxString PropertyData;
8868 wxString PropertyName;
8869 wxString PropertyValue;
8870 wxString PropertyTokens;
8871 bool FirstToken = TRUE;
8872 int intPrevValue = 26;
8874 if (ProcessItemData == TRUE){
8876 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8880 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
8884 *wxSPropertyDataNameOut = wxT("KIND");
8886 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
8887 intiter != SplitPoints.end(); ++intiter){
8889 SLiter = SplitLength.find(intiter->first);
8891 if (ProcessItemData == TRUE){
8893 if (FirstToken == TRUE){
8895 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
8900 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
8906 if (FirstToken == TRUE){
8908 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
8913 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
8919 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
8920 PropertyName = PropertyElement.GetNextToken();
8921 PropertyValue = PropertyElement.GetNextToken();
8923 //ProcessCaptureStrings(&PropertyValue);
8925 intPrevValue = intiter->second;
8927 // Process properties.
8929 // Check if there is a lock on the property value. If there is a lock then
8930 // the property value cannot be changed.
8932 if (PropertyName.IsEmpty()){
8938 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
8940 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
8942 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8946 PropertyDataMap->erase(PropertyName);
8947 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
8953 //wxSPropertyPropValuesOut->Append(wxT(";"));
8954 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
8958 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
8959 *XVCardV4Value = TRUE;
8963 // X-ADDRESSBOOKSERVER-MEMBER
8965 if (wxSProperty == wxT("X-ADDRESSBOOKSERVER-MEMBER")){
8969 if (ProcessItemData == TRUE){
8971 intPropertyLen = wxSPropertySeg1Chopped.Len();
8975 intPropertyLen = wxSPropertySeg1Ptr->Len();
8979 std::map<int, int> SplitPoints;
8980 std::map<int, int> SplitLength;
8981 std::map<int, int>::iterator SLiter;
8982 std::map<wxString, bool>::iterator BIter;;
8983 wxString PropertyData;
8984 wxString PropertyName;
8985 wxString PropertyValue;
8986 wxString PropertyTokens;
8987 bool FirstToken = TRUE;
8988 int intPrevValue = 28;
8990 if (ProcessItemData == TRUE){
8992 SplitValues(&wxSPropertySeg1Chopped, &SplitPoints, &SplitLength, intPrevValue);
8996 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9000 *wxSPropertyDataNameOut = wxT("MEMBER");
9002 for (std::map<int, int>::iterator intiter = SplitPoints.begin();
9003 intiter != SplitPoints.end(); ++intiter){
9005 SLiter = SplitLength.find(intiter->first);
9007 if (ProcessItemData == TRUE){
9009 if (FirstToken == TRUE){
9011 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue - 1), (SLiter->second));
9016 PropertyData = wxSPropertySeg1Chopped.Mid((intPrevValue), (SLiter->second));
9022 if (FirstToken == TRUE){
9024 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue - 1), (SLiter->second));
9029 PropertyData = wxSPropertySeg1Ptr->Mid((intPrevValue), (SLiter->second));
9035 wxStringTokenizer PropertyElement (PropertyData, wxT("="));
9036 PropertyName = PropertyElement.GetNextToken();
9037 PropertyValue = PropertyElement.GetNextToken();
9039 //ProcessCaptureStrings(&PropertyValue);
9041 intPrevValue = intiter->second;
9043 // Process properties.
9045 // Check if there is a lock on the property value. If there is a lock then
9046 // the property value cannot be changed.
9048 if (PropertyName.IsEmpty()){
9054 if (PropertyLockMap->find(PropertyName) == PropertyLockMap->end()){
9056 if (PropertyDataMap->find(PropertyName) == PropertyDataMap->end()){
9058 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9062 PropertyDataMap->erase(PropertyName);
9063 PropertyDataMap->insert(std::make_pair(PropertyName, PropertyValue));
9069 //wxSPropertyPropValuesOut->Append(wxT(";"));
9070 //wxSPropertyPropValuesOut->Append(PropertyName + wxT("=") + PropertyValue);
9074 wxSPropertyXVCard4Value->Append(*wxSPropertySeg2Ptr);
9075 *XVCardV4Value = TRUE;
9080 // Deal with X-ABLabel specifically.
9082 if (wxSProperty == wxT("X-ABLabel") && ProcessItemData == TRUE){
9084 //int intPropertyLen = wxSPropertySeg1Ptr->Len();
9085 intPropertyLen = wxSPropertySeg1Ptr->Len();
9086 std::map<int, int> SplitPoints;
9087 std::map<int, int> SplitLength;
9088 std::map<int, int>::iterator SLiter;
9089 wxString PropertyData;
9090 wxString PropertyName;
9091 wxString PropertyValue;
9092 wxString PropertyTokens;
9093 int intPrevValue = 11;
9095 SplitValues(wxSPropertySeg1Ptr, &SplitPoints, &SplitLength, intPrevValue);
9097 //EscapeString(wxSPropertySeg2Ptr, FALSE);
9098 PropertyDataMap->insert(std::make_pair(wxT("X-ABLabel"), *wxSPropertySeg2Ptr));
9104 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
9106 CaptureString(strCapture, FALSE);
9110 void vCard34Conv::SplitValues(wxString *PropertyLine,
9111 std::map<int,int> *SplitPoints,
9112 std::map<int,int> *SplitLength,
9115 size_t intPropertyLen = PropertyLine->Len();
9116 int intSplitsFound = 0;
9117 int intSplitSize = 0;
9118 int intSplitSeek = 0;
9120 for (int i = intSize; i <= intPropertyLen; i++){
9124 if (PropertyLine->Mid(i, 1) == wxT(";") &&
9125 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
9127 if (intSplitsFound == 0){
9129 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
9133 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
9137 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
9147 if (intSplitsFound == 0){
9149 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
9150 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9154 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
9155 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9161 void vCard34Conv::SplitValuesData(wxString *PropertyLine,
9162 std::map<int,int> *SplitPoints,
9163 std::map<int,int> *SplitLength,
9165 std::map<wxString,wxString> *SplitData){
9168 wxStringTokenizer PropertyElement;
9169 wxString PropertyName;
9170 wxString PropertyValue;
9171 size_t intPropertyLen = PropertyLine->Len();
9172 int intSplitsFound = 0;
9173 int intSplitSize = 0;
9174 int intSplitSeek = (intSize - 1);
9176 for (int i = intSize; i <= intPropertyLen; i++){
9180 if (PropertyLine->Mid(i, 1) == wxT(";") &&
9181 PropertyLine->Mid((i - 1), 1) != wxT("\\")){
9183 if (intSplitsFound == 0){
9185 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
9186 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize)));
9190 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
9191 SplitLength->insert(std::make_pair(intSplitsFound, (intSplitSize - 1)));
9195 SplitPoints->insert(std::make_pair(intSplitsFound, (i + 1)));
9198 intSplitSeek = (i + 1);
9201 if (!DataStr.IsEmpty()){
9203 PropertyElement.SetString(DataStr, wxT("="));
9204 PropertyName = PropertyElement.GetNextToken();
9205 PropertyValue = PropertyElement.GetNextToken();
9206 SplitData->insert(std::make_pair(PropertyName, PropertyValue));
9211 PropertyName.clear();
9212 PropertyValue.clear();
9218 if (intSplitsFound == 0){
9220 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize));
9222 SplitPoints->insert(std::make_pair(intSplitsFound, (8 + 1)));
9223 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9227 DataStr = PropertyLine->Mid(intSplitSeek, (intSplitSize - 1));
9229 SplitPoints->insert(std::make_pair(intSplitsFound, (intSplitSeek + 1)));
9230 SplitLength->insert(std::make_pair(intSplitsFound, intSplitSize));
9234 if (!DataStr.IsEmpty()){
9236 PropertyElement.SetString(DataStr, wxT("="));
9237 PropertyName = PropertyElement.GetNextToken();
9238 PropertyValue = PropertyElement.GetNextToken();
9239 SplitData->insert(std::make_pair(PropertyName, PropertyValue));