#include <listformatter.h>
Inheritance diagram for icu::ListFormatter:
Public Member Functions | |
virtual | ~ListFormatter () |
Destructor. | |
UnicodeString & | format (const UnicodeString items[], int32_t n_items, UnicodeString &appendTo, UErrorCode &errorCode) const |
Formats a list of strings. | |
ListFormatter (const ListFormatData &listFormatterData) | |
Static Public Member Functions | |
static ListFormatter * | createInstance (UErrorCode &errorCode) |
Creates a ListFormatter appropriate for the default locale. | |
static ListFormatter * | createInstance (const Locale &locale, UErrorCode &errorCode) |
Creates a ListFormatter appropriate for a locale. | |
static void | getFallbackLocale (const Locale &in, Locale &out, UErrorCode &errorCode) |
Gets the fallback locale for a given locale. |
Example: Input data ["Alice", "Bob", "Charlie", "Delta"] will be formatted as "Alice, Bob, Charlie and Delta" in English.
The ListFormatter class is not intended for public subclassing.
Definition at line 56 of file listformatter.h.
virtual icu::ListFormatter::~ListFormatter | ( | ) | [virtual] |
icu::ListFormatter::ListFormatter | ( | const ListFormatData & | listFormatterData | ) |
static ListFormatter* icu::ListFormatter::createInstance | ( | const Locale & | locale, | |
UErrorCode & | errorCode | |||
) | [static] |
Creates a ListFormatter appropriate for a locale.
locale | The locale. | |
errorCode | ICU error code, set if no data available for the given locale. |
static ListFormatter* icu::ListFormatter::createInstance | ( | UErrorCode & | errorCode | ) | [static] |
Creates a ListFormatter appropriate for the default locale.
errorCode | ICU error code, set if no data available for default locale. |
UnicodeString& icu::ListFormatter::format | ( | const UnicodeString | items[], | |
int32_t | n_items, | |||
UnicodeString & | appendTo, | |||
UErrorCode & | errorCode | |||
) | const |
Formats a list of strings.
items | An array of strings to be combined and formatted. | |
n_items | Length of the array items. | |
appendTo | The string to which the result should be appended to. | |
errorCode | ICU error code, set if there is an error. |
static void icu::ListFormatter::getFallbackLocale | ( | const Locale & | in, | |
Locale & | out, | |||
UErrorCode & | errorCode | |||
) | [static] |