class Result

Defined at line 194 of file ../../third_party/icu/default/source/common/unicode/localematcher.h

Data for the best-matching pair of a desired and a supported locale.

Movable but not copyable.

ICU 65

Public Methods

void Result (Result && src)

Move constructor; might modify the source.

This object will have the same contents that the source object had.

Parameters

src Result to move contents from. ICU 65
const Locale * getDesiredLocale ()

Returns the best-matching desired locale.

nullptr if the list of desired locales is empty or if none matched well enough.

Returns

the best-matching desired locale, or nullptr.

ICU 65

Defined at line 228 of file ../../third_party/icu/default/source/common/unicode/localematcher.h

const Locale * getSupportedLocale ()

Returns the best-matching supported locale.

If none matched well enough, this is the default locale.

The default locale is nullptr if Builder::setNoDefaultLocale() was called,

or if the list of supported locales is empty and no explicit default locale is set.

Returns

the best-matching supported locale, or nullptr.

ICU 65

Defined at line 239 of file ../../third_party/icu/default/source/common/unicode/localematcher.h

int32_t getDesiredIndex ()

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.

Returns

the index of the best-matching desired locale, or -1.

ICU 65

Defined at line 248 of file ../../third_party/icu/default/source/common/unicode/localematcher.h

int32_t getSupportedIndex ()

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.

Returns

the index of the best-matching supported locale, or -1.

ICU 65

Defined at line 260 of file ../../third_party/icu/default/source/common/unicode/localematcher.h

void ~Result ()

Destructor.

ICU 65

Result & operator= (Result && src)

Move assignment; might modify the source.

This object will have the same contents that the source object had.

Parameters

src Result to move contents from. ICU 65
Locale makeResolvedLocale (UErrorCode & errorCode)

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

Returns

a locale combining the best-matching desired and supported locales.

ICU 65

Friends

class LocaleMatcher