X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=ffca4603a8bd88aae2ed7336a80b9fef1355606b;hp=66f42594d4daccf647c123e2dfc6f471d6b451e6;hb=6cd8a887c1e346fef41e94e6593248246cf3c729;hpb=17d33f5a39d1b64be75d308a78467290e96b7e38 diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 66f4259..ffca460 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -110,6 +110,7 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ int VendorCount = 0; int XTokenCount = 0; int XMLCount = 0; + int ClientPIDCount = 0; wxString ContactLine; wxString PropertyLine; wxString PropertySeg1; @@ -247,6 +248,11 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ ProcessN(PropertySeg1, PropertySeg2); NameProcessed = TRUE; + } else if (Property == wxT("CLIENTPIDMAP")){ + + ProcessClientPIDMap(PropertySeg1, PropertySeg2, &ClientPIDCount); + ClientPIDCount++; + } else if (Property == wxT("NICKNAME")){ ProcessNickname(PropertySeg1, PropertySeg2, &NicknameCount); @@ -1092,6 +1098,90 @@ void ContactDataObject::ProcessN(wxString PropertySeg1, wxString PropertySeg2){ } +void ContactDataObject::ProcessClientPIDMap(wxString PropertySeg1, wxString PropertySeg2, int *ClientPIDCount){ + + 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 = 14; + int intPref = 0; + int intType = 0; + + SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue); + + intPrevValue = 13; + + 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); + + } + + CaptureString(&PropertyValue, FALSE); + + if (PropertyName.IsEmpty() || PropertyName.IsEmpty()){ + + continue; + + } + + if (FirstToken == TRUE){ + + PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue); + FirstToken = FALSE; + + } else { + + PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue); + + } + + } + + CaptureString(&PropertySeg2, FALSE); + + ClientPIDList.insert(std::make_pair(*ClientPIDCount, PropertySeg2)); + + if (!PropertyTokens.IsEmpty()){ + + ClientPIDListTokens.insert(std::make_pair(*ClientPIDCount, PropertyTokens)); + + } + +} + void ContactDataObject::ProcessNickname(wxString PropertySeg1, wxString PropertySeg2, int *NicknameCount){ std::map SplitPoints;