mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-12031 define StandardPlural::indexFromString(const UnicodeString &keyword, UErrorCode &errorCode)
X-SVN-Rev: 38137
This commit is contained in:
parent
758b66dbca
commit
ddfb23cc4c
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue