ICU-12031 define StandardPlural::indexFromString(const UnicodeString &keyword, UErrorCode &errorCode)

X-SVN-Rev: 38137
This commit is contained in:
Markus Scherer 2015-12-16 05:36:59 +00:00
parent 758b66dbca
commit ddfb23cc4c

View file

@ -111,6 +111,17 @@ int32_t StandardPlural::indexFromString(const char *keyword, UErrorCode &errorCo
}
}
int32_t StandardPlural::indexFromString(const UnicodeString &keyword, UErrorCode &errorCode) {
if (U_FAILURE(errorCode)) { return OTHER; }
int32_t i = indexOrNegativeFromString(keyword);
if (i >= 0) {
return i;
} else {
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
return OTHER;
}
}
U_NAMESPACE_END
#endif // !UCONFIG_NO_FORMATTING