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