From: Steve Brokenshire Date: Sun, 27 Dec 2015 00:28:33 +0000 (+0000) Subject: Added source code, headers and unit testing for the KEY vCard property for ContactDat... X-Git-Tag: release-0.09~212 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=a45c3a46e4e37da415a8b8da2aaabe6a4abc4551;p=xestiaab%2F.git Added source code, headers and unit testing for the KEY vCard property for ContactDataObject. --- diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 8bddc03..7531af0 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -103,6 +103,7 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ int CalendarCount = 0; int CalendarAddressCount = 0; int FreeBusyAddressCount = 0; + int KeyCount = 0; wxString ContactLine; wxString PropertyLine; wxString PropertySeg1; @@ -375,6 +376,13 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ ProcessCalendarFreeBusy(PropertySeg1, PropertySeg2, &FreeBusyAddressCount); FreeBusyAddressCount++; + } else if (Property == wxT("KEY")){ + + // See frmContactEditor-LoadKey.cpp + + ProcessKey(PropertySeg1, PropertySeg2, &KeyCount); + KeyCount++; + } } @@ -5201,6 +5209,233 @@ void ContactDataObject::ProcessCalendarFreeBusy(wxString PropertySeg1, wxString } +void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2, int *KeyCount){ + + size_t intPropertyLen = PropertySeg1.Len(); + std::map SplitPoints; + std::map SplitLength; + std::map::iterator SLiter; + wxString PropertyData; + wxString PropertyName; + wxString PropertyValue; + wxString PropertyTokens; + bool FirstToken = TRUE; + int intSplitsFound = 0; + int intSplitSize = 0; + int intPrevValue = 5; + int intPref = 0; + int intType = 0; + long ListCtrlIndex; + + SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue); + + intPrevValue = 4; + + PropertyType PropType = PROPERTY_NONE; + + // Look for type before continuing. + + CheckType(&PropertySeg1, &SplitPoints, &SplitLength, &intPrevValue, &PropType); + + intPrevValue = 4; + + for (std::map::iterator intiter = SplitPoints.begin(); + intiter != SplitPoints.end(); ++intiter){ + + SLiter = SplitLength.find(intiter->first); + + PropertyData = PropertySeg1.Mid(intPrevValue, (SLiter->second)); + + wxStringTokenizer PropertyElement (PropertyData, wxT("=")); + PropertyName = PropertyElement.GetNextToken(); + PropertyValue = PropertyElement.GetNextToken(); + + intPrevValue = intiter->second; + + // Process properties. + + size_t intPropertyValueLen = PropertyValue.Len(); + + if (PropertyValue.Mid((intPropertyValueLen - 1), 1) == wxT("\"")){ + + PropertyValue.Trim(); + PropertyValue.RemoveLast(); + + } + + if (PropertyValue.Mid(0, 1) == wxT("\"")){ + + PropertyValue.Remove(0, 1); + + } + + if (PropertyName == wxT("ALTID")){ + + KeyListAltID.erase(*KeyCount); + KeyListAltID.insert(std::make_pair(*KeyCount, PropertyValue)); + + } else if (PropertyName == wxT("PID")){ + + KeyListPID.erase(*KeyCount); + KeyListPID.insert(std::make_pair(*KeyCount, PropertyValue)); + + } else if (PropertyName == wxT("PREF")){ + + int PriorityNumber = 0; + bool ValidNumber = TRUE; + + try{ + PriorityNumber = std::stoi(PropertyValue.ToStdString()); + } + + catch(std::invalid_argument &e){ + ValidNumber = FALSE; + } + + if (ValidNumber == TRUE){ + + KeyListPref.erase(*KeyCount); + KeyListPref.insert(std::make_pair(*KeyCount, PriorityNumber)); + + } + + } else { + + // Something else we don't know about so append + // to the tokens variable. + + if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){ + + if (FirstToken == TRUE){ + + PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); + FirstToken = FALSE; + + } else { + + PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); + + } + + } + + } + + } + + intPropertyLen = PropertySeg2.Len(); + SplitPoints.clear(); + SplitLength.clear(); + intSplitsFound = 0; + intSplitSize = 0; + intPrevValue = 0; + + for (int i = 0; i <= intPropertyLen; i++){ + + intSplitSize++; + + if (PropertySeg2.Mid(i, 1) == wxT(";") && PropertySeg2.Mid((i - 1), 1) != wxT("\\")){ + + intSplitsFound++; + SplitPoints.insert(std::make_pair(intSplitsFound, (i + 1))); + + if (intSplitsFound == 6){ + + SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1))); + break; + + } else { + + SplitLength.insert(std::make_pair(intSplitsFound, (intSplitSize - 1))); + + } + + intSplitSize = 0; + + } + + } + + wxString wxSKeyURI; + wxString wxSKeyMIME; + wxString wxSKeyEncoding; + wxString wxSKeyData; + std::string base64enc; + + if (intSplitsFound == 0){ + + } else { + + std::map::iterator striter; + + striter = SplitLength.find(1); + + wxStringTokenizer wSTDataType(PropertySeg2.Mid(0, striter->second), wxT(":")); + + while (wSTDataType.HasMoreTokens() == TRUE){ + + wxSKeyURI = wSTDataType.GetNextToken(); + wxSKeyMIME = wSTDataType.GetNextToken(); + break; + + } + + if (wxSKeyURI == wxT("data")){ + + wxStringTokenizer wSTDataInfo(PropertySeg2.Mid((striter->second + 1)), wxT(",")); + + while (wSTDataInfo.HasMoreTokens() == TRUE){ + + wxSKeyEncoding = wSTDataInfo.GetNextToken(); + wxSKeyData = wSTDataInfo.GetNextToken(); + break; + + } + + } + + } + + // Add the data to the General/Home/Work address variables. + + if (wxSKeyURI == wxT("data")){ + + KeyListDataEncType.erase(*KeyCount); + KeyListKeyType.erase(*KeyCount); + KeyListDataEncType.insert(std::make_pair(*KeyCount, wxSKeyEncoding)); + KeyListKeyType.insert(std::make_pair(*KeyCount, TRUE)); + + KeyList.erase(*KeyCount); + KeyList.insert(std::make_pair(*KeyCount, wxSKeyData)); + + } else { + + KeyList.erase(*KeyCount); + KeyList.insert(std::make_pair(*KeyCount, PropertySeg2)); + + } + + KeyListDataType.insert(std::make_pair(*KeyCount, wxSKeyMIME)); + + switch (PropType){ + case PROPERTY_NONE: + break; + case PROPERTY_HOME: + KeyListType.insert(std::make_pair(*KeyCount, wxT("home"))); + break; + case PROPERTY_WORK: + KeyListType.insert(std::make_pair(*KeyCount, wxT("work"))); + break; + } + + if (!PropertyTokens.IsEmpty()){ + + KeyListTokens.insert(std::make_pair(*KeyCount, PropertyTokens)); + + } + +} + void SplitValues(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength, diff --git a/source/contacteditor/ContactDataObject.h b/source/contacteditor/ContactDataObject.h index ccdc5db..8cb40d5 100644 --- a/source/contacteditor/ContactDataObject.h +++ b/source/contacteditor/ContactDataObject.h @@ -82,6 +82,7 @@ class ContactDataObject{ void ProcessCalendarURI(wxString PropertySeg1, wxString PropertySeg2, int *CalAdrCount); void ProcessCalendarAddressURI(wxString PropertySeg1, wxString PropertySeg2, int *CalAdrURICount); void ProcessCalendarFreeBusy(wxString PropertySeg1, wxString PropertySeg2, int *FreeBusyAddressCount); + void ProcessKey(wxString PropertySeg1, wxString PropertySeg2, int *KeyCount); public: diff --git a/source/tests/LoadCheck-Load4.vcf b/source/tests/LoadCheck-Load4.vcf index 180475f..e43f044 100644 --- a/source/tests/LoadCheck-Load4.vcf +++ b/source/tests/LoadCheck-Load4.vcf @@ -504,4 +504,123 @@ FBURL;TYPE=home;ALTID=84;PID=81;PREF=82;MEDIATYPE=text/dryplain;STATUS=FREE: http://example.com/home/freebusy FBURL;TYPE=work;ALTID=94;PID=91;PREF=92;MEDIATYPE=text/stillwetink;STATUS=BU SY:http://example.com/business/freebusy +KEY;ALTID=54;PID=51;PREF=52;KEYS=JUSTONE:data:application/pgp-keys;base64,LS + 0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9 + DSy0tLS0tClZlcnNpb246IEdudVBHIHYyCgptUU11QkZaL0JyWVJDQUN2cTNueUl4dXJPOFovMH + cwQWdkeUdhN1d2cWRpdk5OWVdEM3dmZkgrSi83R2o1dkNOClJwWFQ5TVI4SEdmR0Jwai9hc0Nsa + jltbjhnRENMcVZJaXFybXZXK3dHbnhBVWxFU05VT201cEx6NTRwTzBzOW0KYzJ5SDRkYWVYR3pR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DUyTERkamZXQ1BZWFU9Cj16T3NxCi0tLS0tRU5EIFBHUCBQVUJMSUMgS0VZIEJMT0NLLS0tLS + 0K END:VCARD diff --git a/source/tests/xestiaab_contactload.h b/source/tests/xestiaab_contactload.h index 803d2a3..3886d4c 100644 --- a/source/tests/xestiaab_contactload.h +++ b/source/tests/xestiaab_contactload.h @@ -3495,7 +3495,7 @@ TEST(ContactLoad, FreeBusyTests){ std::map::iterator TestFileIter; std::map::iterator TestFileIntIter; - // Start with a general calendar request address. + // Start with a general calendar free busy address. TestFileIter = TestFile.FreeBusyList.find(0); ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter); @@ -3536,7 +3536,7 @@ TEST(ContactLoad, FreeBusyTests){ ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter); ASSERT_EQ("STATUS=OUT", TestFileIter->second); - // Start with a home calendar request address. + // Start with a home calendar free busy address. TestFileIter = TestFile.FreeBusyList.find(1); ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter); @@ -3578,7 +3578,7 @@ TEST(ContactLoad, FreeBusyTests){ ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter); ASSERT_EQ("STATUS=FREE", TestFileIter->second); - // Start with a business calendar request address. + // Start with a business calendar free busy address. TestFileIter = TestFile.FreeBusyList.find(2); ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter); @@ -3620,6 +3620,279 @@ TEST(ContactLoad, FreeBusyTests){ ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter); ASSERT_EQ("STATUS=BUSY", TestFileIter->second); +} + +TEST(ContactLoad, KeyTests){ + + ContactDataObject TestFile; + + wxString KeyA = "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tClZlcnNpb246IEdudVBHIHYyCgpt" + "UU11QkZaL0JyWVJDQUN2cTNueUl4dXJPOFovMHcwQWdkeUdhN1d2cWRpdk5OWVdEM3dmZkgrSi83" + "R2o1dkNOClJwWFQ5TVI4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KbHQyWXh1aUlad1FZRVFnQUR3VUNWb" + "jh2REFJYkRBVUpBQW5lTkFBS0NSREI0d2taWjdzT1E1Uk5BUUNUSHVjOQpjM1dORURZY1hhV2N6" + "S3ZwN2R4aWJ1YS9FanNxRC85eHNUOHRZUUQrT2VqRndvRmVrbnpZa2RFMmdJb2ZuaDk0CjdKeUh" + "aNDUyTERkamZXQ1BZWFU9Cj16T3NxCi0tLS0tRU5EIFBHUCBQVUJMSUMgS0VZIEJMT0NLLS0tLS" + "0K"; + + // Check that the vCard 4.0 file loads OK. + + ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf")); + + std::map::iterator TestFileIter; + std::map::iterator TestFileIntIter; + + // Start with a general key. + + TestFileIter = TestFile.KeyList.find(0); + ASSERT_NE(TestFile.KeyList.end(), TestFileIter); + ASSERT_EQ(KeyA, TestFileIter->second); + + // Check the encoding type. + + TestFileIter = TestFile.KeyListDataEncType.find(0); + ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter); + ASSERT_EQ("base64", TestFileIter->second.ToStdString()); + + // Check the file type. + + TestFileIter = TestFile.KeyListDataType.find(0); + ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter); + ASSERT_EQ("application/pgp-keys", TestFileIter->second); + + // Check the TYPE section. + + TestFileIter = TestFile.KeyListType.find(0); + ASSERT_EQ(TestFile.KeyListType.end(), TestFileIter); + + // Check the ALTID section. + + TestFileIter = TestFile.KeyListAltID.find(0); + ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter); + ASSERT_EQ("54", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.KeyListPID.find(0); + ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter); + ASSERT_EQ("51", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.KeyListPref.find(0); + ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter); + ASSERT_EQ(52, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.KeyListTokens.find(0); + ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter); + ASSERT_EQ("KEYS=JUSTONE", TestFileIter->second); + + // Start with a work key. + + TestFileIter = TestFile.KeyList.find(1); + ASSERT_NE(TestFile.KeyList.end(), TestFileIter); + ASSERT_EQ(KeyB, TestFileIter->second); + + // Check the encoding type. + + TestFileIter = TestFile.KeyListDataEncType.find(1); + ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter); + ASSERT_EQ("base64", TestFileIter->second.ToStdString()); + + // Check the file type. + + TestFileIter = TestFile.KeyListDataType.find(1); + ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter); + ASSERT_EQ("application/pgp-keys", TestFileIter->second); + + // Check the TYPE section. + + TestFileIter = TestFile.KeyListType.find(1); + ASSERT_NE(TestFile.KeyListType.end(), TestFileIter); + ASSERT_EQ("home", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.KeyListAltID.find(1); + ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter); + ASSERT_EQ("64", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.KeyListPID.find(1); + ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter); + ASSERT_EQ("61", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.KeyListPref.find(1); + ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter); + ASSERT_EQ(62, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.KeyListTokens.find(1); + ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter); + ASSERT_EQ("KEYS=NONE", TestFileIter->second); + + // Start with a business key. + + TestFileIter = TestFile.KeyList.find(2); + ASSERT_NE(TestFile.KeyList.end(), TestFileIter); + ASSERT_EQ(KeyC, TestFileIter->second); + + // Check the encoding type. + + TestFileIter = TestFile.KeyListDataEncType.find(2); + ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter); + ASSERT_EQ("base64", TestFileIter->second.ToStdString()); + + // Check the file type. + + TestFileIter = TestFile.KeyListDataType.find(2); + ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter); + ASSERT_EQ("application/pgp-keys", TestFileIter->second); + + // Check the TYPE section. + + TestFileIter = TestFile.KeyListType.find(2); + ASSERT_NE(TestFile.KeyListType.end(), TestFileIter); + ASSERT_EQ("work", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.KeyListAltID.find(2); + ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter); + ASSERT_EQ("74", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.KeyListPID.find(2); + ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter); + ASSERT_EQ("71", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.KeyListPref.find(2); + ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter); + ASSERT_EQ(72, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.KeyListTokens.find(2); + ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter); + ASSERT_EQ("KEYS=MISSING", TestFileIter->second); }