ICU 65.1
65.1
|
Data for the best-matching pair of a desired and a supported locale. More...
#include <localematcher.h>
Public Member Functions | |
Result (Result &&src) U_NOEXCEPT | |
Move constructor; might modify the source. More... | |
~Result () | |
Destructor. More... | |
Result & | operator= (Result &&src) U_NOEXCEPT |
Move assignment; might modify the source. More... | |
const Locale * | getDesiredLocale () const |
Returns the best-matching desired locale. More... | |
const Locale * | getSupportedLocale () const |
Returns the best-matching supported locale. More... | |
int32_t | getDesiredIndex () const |
Returns the index of the best-matching desired locale in the input Iterable order. More... | |
int32_t | getSupportedIndex () const |
Returns the index of the best-matching supported locale in the constructor’s or builder’s input order (“set” Collection plus “added” locales). More... | |
Locale | makeResolvedLocale (UErrorCode &errorCode) const |
Takes the best-matching supported locale and adds relevant fields of the best-matching desired locale, such as the -t- and -u- extensions. More... | |
Friends | |
class | LocaleMatcher |
Data for the best-matching pair of a desired and a supported locale.
Movable but not copyable.
Definition at line 158 of file localematcher.h.
icu::LocaleMatcher::Result::Result | ( | Result && | src | ) |
icu::LocaleMatcher::Result::~Result | ( | ) |
Destructor.
|
inline |
Returns the index of the best-matching desired locale in the input Iterable order.
-1 if the list of desired locales is empty or if none matched well enough.
Definition at line 212 of file localematcher.h.
|
inline |
Returns the best-matching desired locale.
nullptr if the list of desired locales is empty or if none matched well enough.
Definition at line 192 of file localematcher.h.
|
inline |
Returns the index of the best-matching supported locale in the constructor’s or builder’s input order (“set” Collection plus “added” locales).
If the matcher was built from a locale list string, then the iteration order is that of a LocalePriorityList built from the same string. -1 if the list of supported locales is empty or if none matched well enough.
Definition at line 224 of file localematcher.h.
|
inline |
Returns the best-matching supported locale.
If none matched well enough, this is the default locale. The default locale is nullptr if the list of supported locales is empty and no explicit default locale is set.
Definition at line 203 of file localematcher.h.
Locale icu::LocaleMatcher::Result::makeResolvedLocale | ( | UErrorCode & | errorCode | ) | const |
Takes the best-matching supported locale and adds relevant fields of the best-matching desired locale, such as the -t- and -u- extensions.
May replace some fields of the supported locale. The result is the locale that should be used for date and number formatting, collation, etc. Returns the root locale if getSupportedLocale() returns nullptr.
Example: desired=ar-SA-u-nu-latn, supported=ar-EG, resolved locale=ar-SA-u-nu-latn