CheckType(&PropertySeg1, &SplitPoints, &SplitLength, &intPrevValue, &PropType);
intPrevValue = 5;
+ bool PropertyMatched = FALSE;
for (std::map<int, int>::iterator intiter = SplitPoints.begin();
intiter != SplitPoints.end(); ++intiter){
CaptureString(&PropertyValue, FALSE);
- if (PropertyName == wxT("ALTID")){
-
- LogosListAltID.erase(*LogoCount);
- LogosListAltID.insert(std::make_pair(*LogoCount, PropertyValue));
-
- } else if (PropertyName == wxT("PID")){
-
- LogosListPID.erase(*LogoCount);
- LogosListPID.insert(std::make_pair(*LogoCount, PropertyValue));
+ ProcessStringValue(&PropertyName, "ALTID", &LogosListAltID, &PropertyValue, LogoCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "PID", &LogosListPID, &PropertyValue, LogoCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "MEDIATYPE", &LogosListMediatype, &PropertyValue, LogoCount, &PropertyMatched);
+ ProcessIntegerValue(&PropertyName, "PREF", &LogosListPref, &PropertyValue, LogoCount, &PropertyMatched);
- } else if (PropertyName == wxT("PREF")){
-
- ProcessIntegerValue(&LogosListPref, &PropertyValue, LogoCount);
+ if (PropertyMatched == TRUE){
- } else if (PropertyName == wxT("MEDIATYPE")){
+ PropertyMatched = FALSE;
+ continue;
- LogosListMediatype.erase(*LogoCount);
- LogosListMediatype.insert(std::make_pair(*LogoCount, PropertyValue));
-
- } else {
+ }
+
+ if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
- // Something else we don't know about so append
- // to the tokens variable.
+ if (FirstToken == TRUE){
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+ PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
+ FirstToken = FALSE;
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
+ } else {
+
+ PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
}
CheckType(&PropertySeg1, &SplitPoints, &SplitLength, &intPrevValue, &PropType);
intPrevValue = 6;
+ bool PropertyMatched = FALSE;
for (std::map<int, int>::iterator intiter = SplitPoints.begin();
intiter != SplitPoints.end(); ++intiter){
CaptureString(&PropertyValue, FALSE);
- if (PropertyName == wxT("ALTID")){
-
- SoundsListAltID.erase(*SoundCount);
- SoundsListAltID.insert(std::make_pair(*SoundCount, PropertyValue));
-
- } else if (PropertyName == wxT("PID")){
-
- SoundsListPID.erase(*SoundCount);
- SoundsListPID.insert(std::make_pair(*SoundCount, PropertyValue));
+ ProcessStringValue(&PropertyName, "ALTID", &SoundsListAltID, &PropertyValue, SoundCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "PID", &SoundsListPID, &PropertyValue, SoundCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "MEDIATYPE", &SoundsListMediatype, &PropertyValue, SoundCount, &PropertyMatched);
+ ProcessStringValue(&PropertyName, "LANGUAGE", &SoundsListLanguage, &PropertyValue, SoundCount, &PropertyMatched);
+ ProcessIntegerValue(&PropertyName, "PREF", &SoundsListPref, &PropertyValue, SoundCount, &PropertyMatched);
- } else if (PropertyName == wxT("PREF")){
-
- ProcessIntegerValue(&SoundsListPref, &PropertyValue, SoundCount);
-
- } else if (PropertyName == wxT("MEDIATYPE")){
+ if (PropertyMatched == TRUE){
- SoundsListMediatype.erase(*SoundCount);
- SoundsListMediatype.insert(std::make_pair(*SoundCount, PropertyValue));
-
- } else if (PropertyName == wxT("LANGUAGE")){
+ PropertyMatched = FALSE;
+ continue;
- SoundsListLanguage.erase(*SoundCount);
- SoundsListLanguage.insert(std::make_pair(*SoundCount, PropertyValue));
+ }
- } else {
+ if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
- // Something else we don't know about so append
- // to the tokens variable.
+ if (FirstToken == TRUE){
- if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty() && PropertyName != wxT("TYPE")){
+ PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
+ FirstToken = FALSE;
- if (FirstToken == TRUE){
-
- PropertyTokens.Append(PropertyName + wxT("=") + PropertyValue);
- FirstToken = FALSE;
-
- } else {
-
- PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
-
- }
+ } else {
+
+ PropertyTokens.Append(wxT(";") + PropertyName + wxT("=") + PropertyValue);
}