From a703f54f2a94dfd3045912c9509c1ba1327327dd Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 13 Mar 2016 09:42:52 +0000 Subject: [PATCH] Added comments to describe functions in contacteditor/cdo/ContactDataObject.cpp --- .../contacteditor/cdo/ContactDataObject.cpp | 86 ++++++++++++++++++- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/source/contacteditor/cdo/ContactDataObject.cpp b/source/contacteditor/cdo/ContactDataObject.cpp index 5085409..de1a2bf 100644 --- a/source/contacteditor/cdo/ContactDataObject.cpp +++ b/source/contacteditor/cdo/ContactDataObject.cpp @@ -20,6 +20,8 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ + // Load the ContactDataObject using the Filename given. + if (!wxFileExists(Filename)){ return CONTACTLOAD_FILEMISSING; @@ -429,6 +431,8 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ void ContactDataObject::ProcessKind(wxString KindType){ + // Process the type of contact. + if (KindType == wxT("individual")){ ContactKind = CONTACTKIND_INDIVIDUAL; @@ -454,6 +458,8 @@ void ContactDataObject::ProcessKind(wxString KindType){ void ContactDataObject::ProcessRevision(wxString PropertySeg1, wxString PropertySeg2){ + // Process the revision date. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -517,6 +523,8 @@ void ContactDataObject::ProcessRevision(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySeg2, int *SourceCount){ + // Process the source address. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -623,6 +631,8 @@ void ContactDataObject::ProcessSource(wxString PropertySeg1, wxString PropertySe void ContactDataObject::ProcessXML(wxString PropertySeg1, wxString PropertySeg2, int *XMLCount){ + // Process the XML data. + std::map SplitPoints; std::map SplitLength; @@ -667,6 +677,8 @@ void ContactDataObject::ProcessXML(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySeg2, int *GroupCount){ + // Process the membership data. + std::map SplitPoints; std::map SplitLength; @@ -723,6 +735,8 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, int *FNCount){ + // Process the full name. + std::map SplitPoints; std::map SplitLength; @@ -792,6 +806,8 @@ void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){ + // Process the name. + std::map SplitPoints; std::map SplitLength; @@ -931,6 +947,8 @@ void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){ void ContactDataObject::ProcessClientPIDMap(wxString PropertySeg1, wxString PropertySeg2, int *ClientPIDCount){ + // Process the Client PID Map. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -978,6 +996,8 @@ void ContactDataObject::ProcessClientPIDMap(wxString PropertySeg1, wxString Prop void ContactDataObject::ProcessNickname(wxString PropertySeg1, wxString PropertySeg2, int *NicknameCount){ + // Process the Nickname. + std::map SplitPoints; std::map SplitLength; @@ -1081,6 +1101,8 @@ void ContactDataObject::ProcessNickname(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessGender(wxString PropertySeg1, wxString PropertySeg2){ + // Process the gender. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -1151,7 +1173,7 @@ void ContactDataObject::ProcessGender(wxString PropertySeg1, wxString PropertySe void ContactDataObject::ProcessBirthday(wxString PropertySeg1, wxString PropertySeg2){ - // Process date. Preserve the remainder in the string. + // Process birthday date. std::map SplitPoints; std::map SplitLength; @@ -1253,7 +1275,7 @@ void ContactDataObject::ProcessBirthday(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessAnniversary(wxString PropertySeg1, wxString PropertySeg2){ - // Process date. Preserve the remainder in the string. + // Process the anniversary. std::map SplitPoints; std::map SplitLength; @@ -1355,6 +1377,8 @@ void ContactDataObject::ProcessAnniversary(wxString PropertySeg1, wxString Prope void ContactDataObject::ProcessTimeZone(wxString PropertySeg1, wxString PropertySeg2, int *TimeZoneCount){ + // Process the timezone. + std::map SplitPoints; std::map SplitLength; @@ -1463,6 +1487,8 @@ void ContactDataObject::ProcessTimeZone(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessAddress(wxString PropertySeg1, wxString PropertySeg2, int *AddressCount){ + // Process the address. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -1762,6 +1788,8 @@ void ContactDataObject::ProcessAddress(wxString PropertySeg1, wxString PropertyS void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg2, int *EmailCount){ + // Process the email address. + std::map SplitPoints; std::map SplitLength; @@ -1863,6 +1891,8 @@ void ContactDataObject::ProcessEmail(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, int *IMCount){ + // Process the IM. + std::map SplitPoints; std::map SplitLength; @@ -1984,6 +2014,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString PropertySeg2, int *TelephoneCount){ + // Process the telephone. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -2274,6 +2306,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString PropertySeg2, int *LanguageCount){ + // Process the language. + std::map SplitPoints; std::map SplitLength; @@ -2374,6 +2408,8 @@ void ContactDataObject::ProcessLanguage(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString PropertySeg2, int *GeographicCount){ + // Process the geographic location. + std::map SplitPoints; std::map SplitLength; @@ -2495,6 +2531,8 @@ void ContactDataObject::ProcessGeographic(wxString PropertySeg1, wxString Proper void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertySeg2, int *RelatedCount){ + // Process the relation. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -2683,6 +2721,8 @@ void ContactDataObject::ProcessRelated(wxString PropertySeg1, wxString PropertyS void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2, int *URLCount){ + // Process the URL. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -2807,6 +2847,8 @@ void ContactDataObject::ProcessURL(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg2, int *TitleCount){ + // Process the title. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -2931,6 +2973,8 @@ void ContactDataObject::ProcessTitle(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2, int *RoleCount){ + // Process the role. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -3055,6 +3099,8 @@ void ContactDataObject::ProcessRole(wxString PropertySeg1, wxString PropertySeg2 void ContactDataObject::ProcessOrganisation(wxString PropertySeg1, wxString PropertySeg2, int *OrganisationCount){ + // Process the organisation. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -3184,6 +3230,8 @@ void ContactDataObject::ProcessOrganisation(wxString PropertySeg1, wxString Prop void ContactDataObject::ProcessNote(wxString PropertySeg1, wxString PropertySeg2, int *NoteCount){ + // Process the note. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -3308,6 +3356,8 @@ void ContactDataObject::ProcessNote(wxString PropertySeg1, wxString PropertySeg2 void ContactDataObject::ProcessCategory(wxString PropertySeg1, wxString PropertySeg2, int *CategoryCount){ + // Process the category. + std::map SplitPoints; std::map SplitLength; std::map::iterator SLiter; @@ -3558,6 +3608,8 @@ void ContactDataObject::ProcessCategory(wxString PropertySeg1, wxString Property void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg2, int *PhotoCount){ + // Process the photo. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -3726,6 +3778,8 @@ void ContactDataObject::ProcessPhoto(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2, int *LogoCount){ + // Process the logo. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -3894,6 +3948,8 @@ void ContactDataObject::ProcessLogo(wxString PropertySeg1, wxString PropertySeg2 void ContactDataObject::ProcessSound(wxString PropertySeg1, wxString PropertySeg2, int *SoundCount){ + // Process the sound. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4063,6 +4119,8 @@ void ContactDataObject::ProcessSound(wxString PropertySeg1, wxString PropertySeg void ContactDataObject::ProcessCalendarURI(wxString PropertySeg1, wxString PropertySeg2, int *CalURICount){ + // Process the calendar URI. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4166,6 +4224,8 @@ void ContactDataObject::ProcessCalendarURI(wxString PropertySeg1, wxString Prope void ContactDataObject::ProcessCalendarAddressURI(wxString PropertySeg1, wxString PropertySeg2, int *CalAdrURICount){ + // Process the calendar address URI. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4269,6 +4329,8 @@ void ContactDataObject::ProcessCalendarAddressURI(wxString PropertySeg1, wxStrin void ContactDataObject::ProcessCalendarFreeBusy(wxString PropertySeg1, wxString PropertySeg2, int *FreeBusyAddressCount){ + // Process the calendar free busy URL. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4372,6 +4434,8 @@ void ContactDataObject::ProcessCalendarFreeBusy(wxString PropertySeg1, wxString void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2, int *KeyCount){ + // Process the key. + size_t intPropertyLen = PropertySeg1.Len(); std::map SplitPoints; std::map SplitLength; @@ -4553,6 +4617,8 @@ void ContactDataObject::ProcessKey(wxString PropertySeg1, wxString PropertySeg2, void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySeg2, int *VendorCount){ + // Process the vendor information. + // Split the Vendor three ways. wxStringTokenizer wSTVendorDetails(PropertySeg1, wxT("-")); @@ -4587,6 +4653,8 @@ void ContactDataObject::ProcessVendor(wxString PropertySeg1, wxString PropertySe void ContactDataObject::ClearData(){ + // Clear the contact information. + NameTitle.clear(); NameForename.clear(); NameSurname.clear(); @@ -5093,6 +5161,8 @@ void ProcessNameValue(wxString *PropertyData, wxString *PropertyName, wxString *PropertyValue){ + // Proces the name and value information. + wxStringTokenizer PropertyElement (*PropertyData, wxT("=")); *PropertyName = PropertyElement.GetNextToken(); *PropertyValue = PropertyElement.GetNextToken(); @@ -5104,6 +5174,8 @@ void ProcessTokens(wxString *PropertyName, wxString *PropertyTokens, bool *FirstToken){ + // Process the tokens. + if (!PropertyName->IsEmpty() && !PropertyValue->IsEmpty() && *PropertyName != wxT("TYPE")){ if (*FirstToken == TRUE){ @@ -5128,6 +5200,8 @@ void ProcessStringValue(wxString *PropertyName, int *ItemCount, bool *PropertyMatched){ + // Process the string value. + if (*PropertyName == PropertyNameMatch){ MapPtr->erase(*ItemCount); MapPtr->insert(std::make_pair(*ItemCount, *PropertyValue)); @@ -5143,6 +5217,8 @@ void ProcessIntegerValue(wxString *PropertyName, int *ItemCount, bool *PropertyMatched){ + // Process the integer value. + if (*PropertyName == PropertyNameMatch){ *PropertyMatched = TRUE; } else { @@ -5173,7 +5249,9 @@ void SplitValues(wxString *PropertyLine, std::map *SplitPoints, std::map *SplitLength, int intSize){ - + + // Split values from a string supplied by PropertyLine. + size_t intPropertyLen = PropertyLine->Len(); int intSplitsFound = 0; int intSplitSize = 0; @@ -5226,6 +5304,8 @@ void CheckType(wxString *PropertySeg1, int *intPrevValue, PropertyType *PropType){ + // Check the information type. + wxString PropertyData; wxString PropertyName; wxString PropertyValue; -- 2.39.2