ICU 78.1 78.1 |
An immutable class for formatting a list, using data from CLDR (or supplied separately).More...
#include <listformatter.h>

Public Member Functions | |
| ListFormatter (constListFormatter &) | |
| Copy constructor.More... | |
| ListFormatter & | operator= (constListFormatter &other) |
| Assignment operator.More... | |
| virtual | ~ListFormatter () |
| Destructor.More... | |
| UnicodeString & | format (constUnicodeString items[], int32_t n_items,UnicodeString &appendTo,UErrorCode &errorCode) const |
| Formats a list of strings.More... | |
| FormattedList | formatStringsToValue (constUnicodeString items[], int32_t n_items,UErrorCode &errorCode) const |
| Formats a list of strings to aFormattedList, which exposes field position information.More... | |
| UnicodeString & | format (constUnicodeString items[], int32_t n_items,UnicodeString &appendTo, int32_t index, int32_t &offset,UErrorCode &errorCode) const |
| ListFormatter (const ListFormatData &data,UErrorCode &errorCode) | |
| ListFormatter (const ListFormatInternal *listFormatterInternal) | |
Public Member Functions inherited fromicu::UObject | |
| virtual | ~UObject () |
| Destructor.More... | |
| virtualUClassID | getDynamicClassID () const |
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.More... | |
Static Public Member Functions | |
| staticListFormatter * | createInstance (UErrorCode &errorCode) |
| Creates aListFormatter appropriate for the default locale.More... | |
| staticListFormatter * | createInstance (constLocale &locale,UErrorCode &errorCode) |
| Creates aListFormatter appropriate for a locale.More... | |
| staticListFormatter * | createInstance (constLocale &locale,UListFormatterType type,UListFormatterWidth width,UErrorCode &errorCode) |
| Creates aListFormatter for the given locale, list type, and style.More... | |
An immutable class for formatting a list, using data from CLDR (or supplied separately).
Example: Input data ["Alice", "Bob", "Charlie", "Delta"] will be formatted as "Alice, Bob, Charlie and Delta" in English.
TheListFormatter class is not intended for public subclassing.
Definition at line151 of filelistformatter.h.
| icu::ListFormatter::ListFormatter | ( | constListFormatter & | ) |
Copy constructor.
| virtual |
Destructor.
| icu::ListFormatter::ListFormatter | ( | const ListFormatData & | data, |
| UErrorCode & | errorCode | ||
| ) |
This API is for internal use only. constructor made public for testing.
| icu::ListFormatter::ListFormatter | ( | const ListFormatInternal * | listFormatterInternal | ) |
This API is for internal use only. constructor made public for testing.
| static |
Creates aListFormatter appropriate for a locale.
| locale | The locale. |
| errorCode | ICU error code, set if no data available for the given locale. |
| static |
Creates aListFormatter for the given locale, list type, and style.
| locale | The locale. |
| type | The type of list formatting to use. |
| width | The width of formatting to use. |
| errorCode | ICU error code, set if no data available for the given locale. |
| static |
Creates aListFormatter appropriate for the default locale.
| errorCode | ICU error code, set if no data available for default locale. |
| UnicodeString& icu::ListFormatter::format | ( | constUnicodeString | items[], |
| int32_t | n_items, | ||
| UnicodeString & | appendTo, | ||
| int32_t | index, | ||
| int32_t & | offset, | ||
| UErrorCode & | errorCode | ||
| ) | const |
This API is for internal use only. forMeasureFormat
| UnicodeString& icu::ListFormatter::format | ( | constUnicodeString | 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. |
| FormattedList icu::ListFormatter::formatStringsToValue | ( | constUnicodeString | items[], |
| int32_t | n_items, | ||
| UErrorCode & | errorCode | ||
| ) | const |
Formats a list of strings to aFormattedList, which exposes field position information.
TheFormattedList contains more information than aFieldPositionIterator.
| items | An array of strings to be combined and formatted. |
| n_items | Length of the array items. |
| errorCode | ICU error code returned here. |
| ListFormatter& icu::ListFormatter::operator= | ( | constListFormatter & | other | ) |
Assignment operator.