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 (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
- if (FirstToken == TRUE){
+ if (FirstToken == TRUE){
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
+ PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
+ FirstToken = FALSE;
- } else {
+ } else {
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
+ PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
+ }
+
}
}
wxString PropertyValue;
wxString PropertyTokens;
bool FirstToken = TRUE;
+ bool PropertyMatched = FALSE;
for (std::map<int, int>::iterator intiter = SplitPoints.begin();
intiter != SplitPoints.end(); ++intiter){
CaptureString(&PropertyValue, FALSE);
- if (PropertyName == wxT("ALTID")){
-
- NicknamesListAltID->erase(*NicknameCount);
- NicknamesListAltID->insert(std::make_pair(*NicknameCount, PropertyValue));
+ ProcessStringValue(&PropertyName, "ALTID", NicknamesListAltID, &PropertyValue, NicknameCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "PID", NicknamesListPID, &PropertyValue, NicknameCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "LANGUAGE", NicknamesListLanguage, &PropertyValue, NicknameCount, &PropertyMatched);
+ ProcessIntegerValue(&PropertyName, "PREF", NicknamesListPref, &PropertyValue, NicknameCount, &PropertyMatched);
- } else if (PropertyName == wxT("PID")){
-
- NicknamesListPID->erase(*NicknameCount);
- NicknamesListPID->insert(std::make_pair(*NicknameCount, PropertyValue));
-
- } else if (PropertyName == wxT("PREF")){
-
- ProcessIntegerValue(NicknamesListPref, &PropertyValue, NicknameCount);
+ if (PropertyMatched == TRUE){
- } else if (PropertyName == wxT("LANGUAGE")){
-
- NicknamesListLanguage->erase(*NicknameCount);
- NicknamesListLanguage->insert(std::make_pair(*NicknameCount, PropertyValue));
-
- } else {
+ PropertyMatched = FALSE;
+ continue;
- // Something else we don't know about so append
- // to the tokens variable.
+ }
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+ if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+
+ if (FirstToken == TRUE){
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
+ PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
+ FirstToken = FALSE;
- }
+ } else {
+ PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
+
+ }
+
}
}