"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "source/i18n/unicode/listformatter.h" between
icu4c-66_1-src.tgz and icu4c-67_1-src.tgz

About: ICU (International Components for Unicode) is a set of C/C++ and Java libraries providing Unicode and Globalization support for software applications on a wide variety of platforms.

listformatter.h  (icu4c-66_1-src.tgz):listformatter.h  (icu4c-67_1-src.tgz)
skipping to change at line 29 skipping to change at line 29
#ifndef __LISTFORMATTER_H__ #ifndef __LISTFORMATTER_H__
#define __LISTFORMATTER_H__ #define __LISTFORMATTER_H__
#include "unicode/utypes.h" #include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API #if U_SHOW_CPLUSPLUS_API
#include "unicode/unistr.h" #include "unicode/unistr.h"
#include "unicode/locid.h" #include "unicode/locid.h"
#include "unicode/formattedvalue.h" #include "unicode/formattedvalue.h"
#include "unicode/ulistformatter.h"
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
class FieldPositionIterator;
class FieldPositionHandler; class FieldPositionHandler;
class FormattedListData; class FormattedListData;
class ListFormatter; class ListFormatter;
/** @internal */ /** @internal */
class Hashtable; class Hashtable;
/** @internal */ /** @internal */
struct ListFormatInternal; struct ListFormatInternal;
/* The following can't be #ifndef U_HIDE_INTERNAL_API, needed for other .h file declarations */ /* The following can't be #ifndef U_HIDE_INTERNAL_API, needed for other .h file declarations */
/** /**
* @internal * @internal
* \cond * \cond
*/ */
struct ListFormatData : public UMemory { struct ListFormatData : public UMemory {
UnicodeString twoPattern; UnicodeString twoPattern;
UnicodeString startPattern; UnicodeString startPattern;
UnicodeString middlePattern; UnicodeString middlePattern;
UnicodeString endPattern; UnicodeString endPattern;
Locale locale;
ListFormatData(const UnicodeString& two, const UnicodeString& start, const Uni ListFormatData(const UnicodeString& two, const UnicodeString& start, const Uni
codeString& middle, const UnicodeString& end) : codeString& middle, const UnicodeString& end,
twoPattern(two), startPattern(start), middlePattern(middle), endPattern(en const Locale& loc) :
d) {} twoPattern(two), startPattern(start), middlePattern(middle), endPattern(en
d), locale(loc) {}
}; };
/** \endcond */ /** \endcond */
/** /**
* \file * \file
* \brief C++ API: API for formatting a list. * \brief C++ API: API for formatting a list.
*/ */
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
#ifndef U_HIDE_DRAFT_API
/** /**
* An immutable class containing the result of a list formatting operation. * An immutable class containing the result of a list formatting operation.
* *
* Instances of this class are immutable and thread-safe. * Instances of this class are immutable and thread-safe.
* *
* When calling nextPosition(): * When calling nextPosition():
* The fields are returned from start to end. The special field category * The fields are returned from start to end. The special field category
* UFIELD_CATEGORY_LIST_SPAN is used to indicate which argument * UFIELD_CATEGORY_LIST_SPAN is used to indicate which argument
* was inserted at the given position. The span category will * was inserted at the given position. The span category will
* always occur before the corresponding instance of UFIELD_CATEGORY_LIST * always occur before the corresponding instance of UFIELD_CATEGORY_LIST
* in the nextPosition() iterator. * in the nextPosition() iterator.
* *
* Not intended for public subclassing. * Not intended for public subclassing.
* *
* @draft ICU 64 * @stable ICU 64
*/ */
class U_I18N_API FormattedList : public UMemory, public FormattedValue { class U_I18N_API FormattedList : public UMemory, public FormattedValue {
public: public:
/** /**
* Default constructor; makes an empty FormattedList. * Default constructor; makes an empty FormattedList.
* @draft ICU 64 * @stable ICU 64
*/ */
FormattedList() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {} FormattedList() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
/** /**
* Move constructor: Leaves the source FormattedList in an undefined state. * Move constructor: Leaves the source FormattedList in an undefined state.
* @draft ICU 64 * @stable ICU 64
*/ */
FormattedList(FormattedList&& src) U_NOEXCEPT; FormattedList(FormattedList&& src) U_NOEXCEPT;
/** /**
* Destruct an instance of FormattedList. * Destruct an instance of FormattedList.
* @draft ICU 64 * @stable ICU 64
*/ */
virtual ~FormattedList() U_OVERRIDE; virtual ~FormattedList() U_OVERRIDE;
/** Copying not supported; use move constructor instead. */ /** Copying not supported; use move constructor instead. */
FormattedList(const FormattedList&) = delete; FormattedList(const FormattedList&) = delete;
/** Copying not supported; use move assignment instead. */ /** Copying not supported; use move assignment instead. */
FormattedList& operator=(const FormattedList&) = delete; FormattedList& operator=(const FormattedList&) = delete;
/** /**
* Move assignment: Leaves the source FormattedList in an undefined state. * Move assignment: Leaves the source FormattedList in an undefined state.
* @draft ICU 64 * @stable ICU 64
*/ */
FormattedList& operator=(FormattedList&& src) U_NOEXCEPT; FormattedList& operator=(FormattedList&& src) U_NOEXCEPT;
/** @copydoc FormattedValue::toString() */ /** @copydoc FormattedValue::toString() */
UnicodeString toString(UErrorCode& status) const U_OVERRIDE; UnicodeString toString(UErrorCode& status) const U_OVERRIDE;
/** @copydoc FormattedValue::toTempString() */ /** @copydoc FormattedValue::toTempString() */
UnicodeString toTempString(UErrorCode& status) const U_OVERRIDE; UnicodeString toTempString(UErrorCode& status) const U_OVERRIDE;
/** @copydoc FormattedValue::appendTo() */ /** @copydoc FormattedValue::appendTo() */
skipping to change at line 135 skipping to change at line 136
private: private:
FormattedListData *fData; FormattedListData *fData;
UErrorCode fErrorCode; UErrorCode fErrorCode;
explicit FormattedList(FormattedListData *results) explicit FormattedList(FormattedListData *results)
: fData(results), fErrorCode(U_ZERO_ERROR) {} : fData(results), fErrorCode(U_ZERO_ERROR) {}
explicit FormattedList(UErrorCode errorCode) explicit FormattedList(UErrorCode errorCode)
: fData(nullptr), fErrorCode(errorCode) {} : fData(nullptr), fErrorCode(errorCode) {}
friend class ListFormatter; friend class ListFormatter;
}; };
#endif /* U_HIDE_DRAFT_API */
#endif // !UCONFIG_NO_FORMATTING #endif // !UCONFIG_NO_FORMATTING
/** /**
* An immutable class for formatting a list, using data from CLDR (or supplied * An immutable class for formatting a list, using data from CLDR (or supplied
* separately). * separately).
* *
* Example: Input data ["Alice", "Bob", "Charlie", "Delta"] will be formatted * Example: Input data ["Alice", "Bob", "Charlie", "Delta"] will be formatted
* as "Alice, Bob, Charlie and Delta" in English. * as "Alice, Bob, Charlie and Delta" in English.
* *
* The ListFormatter class is not intended for public subclassing. * The ListFormatter class is not intended for public subclassing.
skipping to change at line 185 skipping to change at line 185
* Creates a ListFormatter appropriate for a locale. * Creates a ListFormatter appropriate for a locale.
* *
* @param locale The locale. * @param locale The locale.
* @param errorCode ICU error code, set if no data available for the given l ocale. * @param errorCode ICU error code, set if no data available for the given l ocale.
* @return A ListFormatter object created from internal data derived from * @return A ListFormatter object created from internal data derived from
* CLDR data. * CLDR data.
* @stable ICU 50 * @stable ICU 50
*/ */
static ListFormatter* createInstance(const Locale& locale, UErrorCode& error Code); static ListFormatter* createInstance(const Locale& locale, UErrorCode& error Code);
#ifndef U_HIDE_DRAFT_API
#if !UCONFIG_NO_FORMATTING
/**
* Creates a ListFormatter for the given locale, list type, and style.
*
* @param locale The locale.
* @param type The type of list formatting to use.
* @param width The width of formatting to use.
* @param errorCode ICU error code, set if no data available for the given l
ocale.
* @return A ListFormatter object created from internal data derived from CL
DR data.
* @draft ICU 67
*/
static ListFormatter* createInstance(
const Locale& locale, UListFormatterType type, UListFormatterWidth width,
UErrorCode& errorCode);
#endif /* !UCONFIG_NO_FORMATTING */
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API #ifndef U_HIDE_INTERNAL_API
/** /**
* Creates a ListFormatter appropriate for a locale and style. * Creates a ListFormatter appropriate for a locale and style.
* *
* TODO(ICU-20888): Remove this in ICU 68.
*
* @param locale The locale. * @param locale The locale.
* @param style the style, either "standard", "or", "unit", "unit-narrow", o r "unit-short" * @param style the style, either "standard", "or", "unit", "unit-narrow", o r "unit-short"
* @param errorCode ICU error code, set if no data available for the given l ocale. * @param errorCode ICU error code, set if no data available for the given l ocale.
* @return A ListFormatter object created from internal data derived from * @return A ListFormatter object created from internal data derived from
* CLDR data. * CLDR data.
* @internal * @internal
*/ */
static ListFormatter* createInstance(const Locale& locale, const char* style , UErrorCode& errorCode); static ListFormatter* createInstance(const Locale& locale, const char* style , UErrorCode& errorCode);
#endif /* U_HIDE_INTERNAL_API */ #endif /* U_HIDE_INTERNAL_API */
skipping to change at line 219 skipping to change at line 238
* @param items An array of strings to be combined and formatted. * @param items An array of strings to be combined and formatted.
* @param n_items Length of the array items. * @param n_items Length of the array items.
* @param appendTo The string to which the result should be appended to. * @param appendTo The string to which the result should be appended to.
* @param errorCode ICU error code, set if there is an error. * @param errorCode ICU error code, set if there is an error.
* @return Formatted string combining the elements of items, appended to app endTo. * @return Formatted string combining the elements of items, appended to app endTo.
* @stable ICU 50 * @stable ICU 50
*/ */
UnicodeString& format(const UnicodeString items[], int32_t n_items, UnicodeString& format(const UnicodeString items[], int32_t n_items,
UnicodeString& appendTo, UErrorCode& errorCode) const; UnicodeString& appendTo, UErrorCode& errorCode) const;
#ifndef U_HIDE_DRAFT_API
/**
* Format a list of strings.
*
* @param items An array of strings to be combined and formatted.
* @param n_items Length of the array items.
* @param appendTo The string to which the formatted result will be
* appended.
* @param posIter On return, can be used to iterate over positions of
* fields generated by this format call. Field values are
* defined in UListFormatterField. Can be NULL.
* @param errorCode ICU error code returned here.
* @return Formatted string combining the elements of items,
* appended to appendTo.
* @draft ICU 63
*/
UnicodeString& format(const UnicodeString items[], int32_t n_items,
UnicodeString & appendTo, FieldPositionIterator* posIter,
UErrorCode& errorCode) const;
#endif // U_HIDE_DRAFT_API
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
#ifndef U_HIDE_DRAFT_API
/** /**
* Formats a list of strings to a FormattedList, which exposes field * Formats a list of strings to a FormattedList, which exposes field
* position information. The FormattedList contains more information than * position information. The FormattedList contains more information than
* a FieldPositionIterator. * a FieldPositionIterator.
* *
* @param items An array of strings to be combined and formatted. * @param items An array of strings to be combined and formatted.
* @param n_items Length of the array items. * @param n_items Length of the array items.
* @param errorCode ICU error code returned here. * @param errorCode ICU error code returned here.
* @return A FormattedList containing field information. * @return A FormattedList containing field information.
* @draft ICU 64 * @stable ICU 64
*/ */
FormattedList formatStringsToValue( FormattedList formatStringsToValue(
const UnicodeString items[], const UnicodeString items[],
int32_t n_items, int32_t n_items,
UErrorCode& errorCode) const; UErrorCode& errorCode) const;
#endif /* U_HIDE_DRAFT_API */
#endif // !UCONFIG_NO_FORMATTING #endif // !UCONFIG_NO_FORMATTING
#ifndef U_HIDE_INTERNAL_API #ifndef U_HIDE_INTERNAL_API
/** /**
@internal for MeasureFormat @internal for MeasureFormat
*/ */
UnicodeString& format( UnicodeString& format(
const UnicodeString items[], const UnicodeString items[],
int32_t n_items, int32_t n_items,
UnicodeString& appendTo, UnicodeString& appendTo,
 End of changes. 17 change blocks. 
36 lines changed or deleted 35 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)