Movatterモバイル変換


[0]ホーム

URL:


ICU 78.1  78.1
Public Member Functions |Static Public Member Functions
icu::ListFormatter Class Reference

An immutable class for formatting a list, using data from CLDR (or supplied separately).More...

#include <listformatter.h>

Inheritance diagram for icu::ListFormatter:

Public Member Functions

 ListFormatter (constListFormatter &)
 Copy constructor.More...
 
ListFormatteroperator= (constListFormatter &other)
 Assignment operator.More...
 
virtual ~ListFormatter ()
 Destructor.More...
 
UnicodeStringformat (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...
 
UnicodeStringformat (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

staticListFormattercreateInstance (UErrorCode &errorCode)
 Creates aListFormatter appropriate for the default locale.More...
 
staticListFormattercreateInstance (constLocale &locale,UErrorCode &errorCode)
 Creates aListFormatter appropriate for a locale.More...
 
staticListFormattercreateInstance (constLocale &locale,UListFormatterType type,UListFormatterWidth width,UErrorCode &errorCode)
 Creates aListFormatter for the given locale, list type, and style.More...
 

Detailed Description

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.

Stable:
ICU 50

Definition at line151 of filelistformatter.h.

Constructor & Destructor Documentation

◆ ListFormatter()[1/3]

icu::ListFormatter::ListFormatter(constListFormatter)

Copy constructor.

Stable:
ICU 52

◆ ~ListFormatter()

virtual icu::ListFormatter::~ListFormatter()
virtual

Destructor.

Stable:
ICU 50

◆ ListFormatter()[2/3]

icu::ListFormatter::ListFormatter(const ListFormatData & data,
UErrorCodeerrorCode 
)
Internal:
Do not use.

This API is for internal use only. constructor made public for testing.

◆ ListFormatter()[3/3]

icu::ListFormatter::ListFormatter(const ListFormatInternal * listFormatterInternal)
Internal:
Do not use.

This API is for internal use only. constructor made public for testing.

Member Function Documentation

◆ createInstance()[1/3]

staticListFormatter* icu::ListFormatter::createInstance(constLocalelocale,
UErrorCodeerrorCode 
)
static

Creates aListFormatter appropriate for a locale.

Parameters
localeThe locale.
errorCodeICU error code, set if no data available for the given locale.
Returns
AListFormatter object created from internal data derived from CLDR data.
Stable:
ICU 50

◆ createInstance()[2/3]

staticListFormatter* icu::ListFormatter::createInstance(constLocalelocale,
UListFormatterType type,
UListFormatterWidth width,
UErrorCodeerrorCode 
)
static

Creates aListFormatter for the given locale, list type, and style.

Parameters
localeThe locale.
typeThe type of list formatting to use.
widthThe width of formatting to use.
errorCodeICU error code, set if no data available for the given locale.
Returns
AListFormatter object created from internal data derived from CLDR data.
Stable:
ICU 67

◆ createInstance()[3/3]

staticListFormatter* icu::ListFormatter::createInstance(UErrorCodeerrorCode)
static

Creates aListFormatter appropriate for the default locale.

Parameters
errorCodeICU error code, set if no data available for default locale.
Returns
Pointer to aListFormatter object for the default locale, created from internal data derived from CLDR data.
Stable:
ICU 50

◆ format()[1/2]

UnicodeString& icu::ListFormatter::format(constUnicodeString items[],
int32_t n_items,
UnicodeStringappendTo,
int32_t index,
int32_t & offset,
UErrorCodeerrorCode 
) const
Internal:
Do not use.

This API is for internal use only. forMeasureFormat

◆ format()[2/2]

UnicodeString& icu::ListFormatter::format(constUnicodeString items[],
int32_t n_items,
UnicodeStringappendTo,
UErrorCodeerrorCode 
) const

Formats a list of strings.

Parameters
itemsAn array of strings to be combined and formatted.
n_itemsLength of the array items.
appendToThe string to which the result should be appended to.
errorCodeICU error code, set if there is an error.
Returns
Formatted string combining the elements of items, appended to appendTo.
Stable:
ICU 50

◆ formatStringsToValue()

FormattedList icu::ListFormatter::formatStringsToValue(constUnicodeString items[],
int32_t n_items,
UErrorCodeerrorCode 
) const

Formats a list of strings to aFormattedList, which exposes field position information.

TheFormattedList contains more information than aFieldPositionIterator.

Parameters
itemsAn array of strings to be combined and formatted.
n_itemsLength of the array items.
errorCodeICU error code returned here.
Returns
AFormattedList containing field information.
Stable:
ICU 64

◆ operator=()

ListFormatter& icu::ListFormatter::operator=(constListFormatterother)

Assignment operator.

Stable:
ICU 52

The documentation for this class was generated from the following file:

Generated by doxygen 1.9.1
[8]ページ先頭

©2009-2025 Movatter.jp