19#ifndef __LISTFORMATTER_H__
20#define __LISTFORMATTER_H__
24#if U_SHOW_CPLUSPLUS_API
32class FieldPositionIterator;
33class FieldPositionHandler;
34class FormattedListData;
41struct ListFormatInternal;
48struct ListFormatData :
public UMemory {
49 UnicodeString twoPattern;
50 UnicodeString startPattern;
51 UnicodeString middlePattern;
52 UnicodeString endPattern;
54 ListFormatData(
const UnicodeString& two,
const UnicodeString& start,
const UnicodeString& middle,
const UnicodeString& end) :
55 twoPattern(two), startPattern(start), middlePattern(middle), endPattern(end) {}
66#if !UCONFIG_NO_FORMATTING
67#ifndef U_HIDE_DRAFT_API
129 FormattedListData *fData;
134 : fData(nullptr), fErrorCode(errorCode) {}
135 friend class ListFormatter;
188#ifndef U_HIDE_INTERNAL_API
223#ifndef U_HIDE_DRAFT_API
244#if !UCONFIG_NO_FORMATTING
245#ifndef U_HIDE_DRAFT_API
264#ifndef U_HIDE_INTERNAL_API
286 static void initializeHash(
UErrorCode& errorCode);
287 static const ListFormatInternal* getListFormatInternal(
const Locale& locale,
const char *style,
UErrorCode& errorCode);
288 struct ListPatternsSink;
289 static ListFormatInternal* loadListFormatInternal(
const Locale& locale,
const char* style,
UErrorCode& errorCode);
293 int32_t index, int32_t &offset, FieldPositionHandler* handler,
UErrorCode& errorCode)
const;
297 ListFormatInternal* owned;
298 const ListFormatInternal* data;
Base class for objects to which Unicode characters and strings can be appended.
Represents a span of a string containing a given field.
FieldPositionIterator returns the field ids and their start/limit positions generated by a call to Fo...
A Locale object represents a specific geographical, political, or cultural region.
UMemory is the common ICU base class.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
C++ API: Locale ID object.
int8_t UBool
The ICU boolean type.
#define U_OVERRIDE
Defined to the C++11 "override" keyword if available.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
@ U_INVALID_STATE_ERROR
Requested operation can not be completed with ICU in its current state.
@ U_ZERO_ERROR
No error, no warning.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.