ICU-20979 BRS 67rc, ICU4C API promotion

This commit is contained in:
Peter Edberg 2020-03-31 19:43:35 -07:00 committed by pedberg-icu
parent b718ccf17a
commit dcfe6c4ada
22 changed files with 364 additions and 797 deletions

View File

@ -12,7 +12,6 @@
#include "unicode/stringpiece.h"
#include "unicode/uobject.h"
#ifndef U_HIDE_DRAFT_API
/**
* \file
* \brief C++ API: Builder API for Locale
@ -57,7 +56,7 @@ class CharString;
* UErrorCode, then track the error of the validation of the input parameter
* into the internal UErrorCode.
*
* @draft ICU 64
* @stable ICU 64
*/
class U_COMMON_API LocaleBuilder : public UObject {
public:
@ -66,13 +65,13 @@ public:
* fields, extensions, and private use information is the
* empty string.
*
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder();
/**
* Destructor
* @draft ICU 64
* @stable ICU 64
*/
virtual ~LocaleBuilder();
@ -86,7 +85,7 @@ public:
* @param locale the locale
* @return This builder.
*
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setLocale(const Locale& locale);
@ -104,7 +103,7 @@ public:
* @param tag the language tag, defined as
* [unicode_locale_id](http://www.unicode.org/reports/tr35/tr35.html#unicode_locale_id).
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setLanguageTag(StringPiece tag);
@ -119,7 +118,7 @@ public:
*
* @param language the language
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setLanguage(StringPiece language);
@ -135,7 +134,7 @@ public:
*
* @param script the script
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setScript(StringPiece script);
@ -154,7 +153,7 @@ public:
*
* @param region the region
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setRegion(StringPiece region);
@ -175,7 +174,7 @@ public:
*
* @param variant the variant
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setVariant(StringPiece variant);
@ -196,7 +195,7 @@ public:
* @param key the extension key
* @param value the extension value
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setExtension(char key, StringPiece value);
@ -216,7 +215,7 @@ public:
* @param key the Unicode locale key
* @param type the Unicode locale type
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& setUnicodeLocaleKeyword(
StringPiece key, StringPiece type);
@ -229,7 +228,7 @@ public:
*
* @param attribute the attribute
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& addUnicodeLocaleAttribute(StringPiece attribute);
@ -242,7 +241,7 @@ public:
*
* @param attribute the attribute
* @return This builder.
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& removeUnicodeLocaleAttribute(StringPiece attribute);
@ -251,7 +250,7 @@ public:
* <p>This method clears the internal UErrorCode.
*
* @return this builder
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& clear();
@ -260,7 +259,7 @@ public:
* Language, script, region and variant are unchanged.
*
* @return this builder
* @draft ICU 64
* @stable ICU 64
*/
LocaleBuilder& clearExtensions();
@ -275,7 +274,7 @@ public:
* the same builder to build more locales.
*
* @return a new Locale
* @draft ICU 64
* @stable ICU 64
*/
Locale build(UErrorCode& status);
@ -308,8 +307,6 @@ private:
U_NAMESPACE_END
#endif // U_HIDE_DRAFT_API
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __LOCALEBUILDER_H__

View File

@ -20,7 +20,7 @@
* \brief C++ API: Locale matcher: User's desired locales vs. application's supported locales.
*/
#ifndef U_HIDE_DRAFT_API
#ifndef U_FORCE_HIDE_DRAFT_API
/**
* Builder option for whether the language subtag or the script subtag is most important.
@ -218,6 +218,7 @@ public:
*/
Result &operator=(Result &&src) U_NOEXCEPT;
#ifndef U_HIDE_DRAFT_API
/**
* Returns the best-matching desired locale.
* nullptr if the list of desired locales is empty or if none matched well enough.
@ -272,6 +273,7 @@ public:
* @draft ICU 65
*/
Locale makeResolvedLocale(UErrorCode &errorCode) const;
#endif // U_HIDE_DRAFT_API
private:
Result(const Locale *desired, const Locale *supported,
@ -334,6 +336,7 @@ public:
*/
Builder &operator=(Builder &&src) U_NOEXCEPT;
#ifndef U_HIDE_DRAFT_API
/**
* Parses an Accept-Language string
* (<a href="https://tools.ietf.org/html/rfc2616#section-14.4">RFC 2616 Section 14.4</a>),
@ -486,6 +489,7 @@ public:
* @draft ICU 65
*/
LocaleMatcher build(UErrorCode &errorCode) const;
#endif // U_HIDE_DRAFT_API
private:
friend class LocaleMatcher;
@ -531,6 +535,7 @@ public:
*/
LocaleMatcher &operator=(LocaleMatcher &&src) U_NOEXCEPT;
#ifndef U_HIDE_DRAFT_API
/**
* Returns the supported locale which best matches the desired locale.
*
@ -598,6 +603,7 @@ public:
* @draft ICU 65
*/
Result getBestMatchResult(Locale::Iterator &desiredLocales, UErrorCode &errorCode) const;
#endif // U_HIDE_DRAFT_API
#ifndef U_HIDE_INTERNAL_API
/**
@ -654,6 +660,6 @@ private:
U_NAMESPACE_END
#endif // U_HIDE_DRAFT_API
#endif // U_FORCE_HIDE_DRAFT_API
#endif // U_SHOW_CPLUSPLUS_API
#endif // __LOCALEMATCHER_H__

View File

@ -225,7 +225,6 @@ public:
src.ptr=NULL;
}
#ifndef U_HIDE_DRAFT_API
/**
* Constructs a LocalPointer from a C++11 std::unique_ptr.
* The LocalPointer steals the object owned by the std::unique_ptr.
@ -234,11 +233,10 @@ public:
* in a local variable, you must use std::move.
*
* @param p The std::unique_ptr from which the pointer will be stolen.
* @draft ICU 64
* @stable ICU 64
*/
explicit LocalPointer(std::unique_ptr<T> &&p)
: LocalPointerBase<T>(p.release()) {}
#endif /* U_HIDE_DRAFT_API */
/**
* Destructor deletes the object it owns.
@ -261,20 +259,18 @@ public:
return *this;
}
#ifndef U_HIDE_DRAFT_API
/**
* Move-assign from an std::unique_ptr to this LocalPointer.
* Steals the pointer from the std::unique_ptr.
*
* @param p The std::unique_ptr from which the pointer will be stolen.
* @return *this
* @draft ICU 64
* @stable ICU 64
*/
LocalPointer<T> &operator=(std::unique_ptr<T> &&p) U_NOEXCEPT {
adoptInstead(p.release());
return *this;
}
#endif /* U_HIDE_DRAFT_API */
/**
* Swap pointers.
@ -332,7 +328,6 @@ public:
}
}
#ifndef U_HIDE_DRAFT_API
/**
* Conversion operator to a C++11 std::unique_ptr.
* Disowns the object and gives it to the returned std::unique_ptr.
@ -342,12 +337,11 @@ public:
*
* @return An std::unique_ptr owning the pointer previously owned by this
* icu::LocalPointer.
* @draft ICU 64
* @stable ICU 64
*/
operator std::unique_ptr<T> () && {
return std::unique_ptr<T>(LocalPointerBase<T>::orphan());
}
#endif /* U_HIDE_DRAFT_API */
};
/**
@ -406,7 +400,6 @@ public:
src.ptr=NULL;
}
#ifndef U_HIDE_DRAFT_API
/**
* Constructs a LocalArray from a C++11 std::unique_ptr of an array type.
* The LocalPointer steals the array owned by the std::unique_ptr.
@ -415,11 +408,10 @@ public:
* in a local variable, you must use std::move.
*
* @param p The std::unique_ptr from which the array will be stolen.
* @draft ICU 64
* @stable ICU 64
*/
explicit LocalArray(std::unique_ptr<T[]> &&p)
: LocalPointerBase<T>(p.release()) {}
#endif /* U_HIDE_DRAFT_API */
/**
* Destructor deletes the array it owns.
@ -442,20 +434,18 @@ public:
return *this;
}
#ifndef U_HIDE_DRAFT_API
/**
* Move-assign from an std::unique_ptr to this LocalPointer.
* Steals the array from the std::unique_ptr.
*
* @param p The std::unique_ptr from which the array will be stolen.
* @return *this
* @draft ICU 64
* @stable ICU 64
*/
LocalArray<T> &operator=(std::unique_ptr<T[]> &&p) U_NOEXCEPT {
adoptInstead(p.release());
return *this;
}
#endif /* U_HIDE_DRAFT_API */
/**
* Swap pointers.
@ -521,7 +511,6 @@ public:
*/
T &operator[](ptrdiff_t i) const { return LocalPointerBase<T>::ptr[i]; }
#ifndef U_HIDE_DRAFT_API
/**
* Conversion operator to a C++11 std::unique_ptr.
* Disowns the object and gives it to the returned std::unique_ptr.
@ -531,12 +520,11 @@ public:
*
* @return An std::unique_ptr owning the pointer previously owned by this
* icu::LocalPointer.
* @draft ICU 64
* @stable ICU 64
*/
operator std::unique_ptr<T[]> () && {
return std::unique_ptr<T[]>(LocalPointerBase<T>::orphan());
}
#endif /* U_HIDE_DRAFT_API */
};
/**

View File

@ -37,13 +37,13 @@ uprv_strCompare(const UChar *s1, int32_t length1,
const UChar *s2, int32_t length2,
UBool strncmpStyle, UBool codePointOrder);
U_CAPI int32_t U_EXPORT2
U_INTERNAL int32_t U_EXPORT2
ustr_hashUCharsN(const UChar *str, int32_t length);
U_CAPI int32_t U_EXPORT2
U_INTERNAL int32_t U_EXPORT2
ustr_hashCharsN(const char *str, int32_t length);
U_CAPI int32_t U_EXPORT2
U_INTERNAL int32_t U_EXPORT2
ustr_hashICharsN(const char *str, int32_t length);
/**
@ -53,7 +53,7 @@ ustr_hashICharsN(const char *str, int32_t length);
* @return If UChar is a lowercase ASCII character, returns the uppercase version.
* Otherwise, returns the input character.
*/
U_CAPI UChar U_EXPORT2
U_INTERNAL UChar U_EXPORT2
u_asciiToUpper(UChar c);
// TODO: Add u_asciiToLower if/when there is a need for it.
@ -70,28 +70,28 @@ u_asciiToUpper(UChar c);
* @param pErrorCode ICU error code.
* @return length
*/
U_CAPI int32_t U_EXPORT2
U_INTERNAL int32_t U_EXPORT2
u_terminateUChars(UChar *dest, int32_t destCapacity, int32_t length, UErrorCode *pErrorCode);
/**
* NUL-terminate a char * string if possible.
* Same as u_terminateUChars() but for a different string type.
*/
U_CAPI int32_t U_EXPORT2
U_INTERNAL int32_t U_EXPORT2
u_terminateChars(char *dest, int32_t destCapacity, int32_t length, UErrorCode *pErrorCode);
/**
* NUL-terminate a UChar32 * string if possible.
* Same as u_terminateUChars() but for a different string type.
*/
U_CAPI int32_t U_EXPORT2
U_INTERNAL int32_t U_EXPORT2
u_terminateUChar32s(UChar32 *dest, int32_t destCapacity, int32_t length, UErrorCode *pErrorCode);
/**
* NUL-terminate a wchar_t * string if possible.
* Same as u_terminateUChars() but for a different string type.
*/
U_CAPI int32_t U_EXPORT2
U_INTERNAL int32_t U_EXPORT2
u_terminateWChars(wchar_t *dest, int32_t destCapacity, int32_t length, UErrorCode *pErrorCode);
/**

View File

@ -56,7 +56,6 @@ class U_I18N_API CurrencyUnit: public MeasureUnit {
*/
CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec);
#ifndef U_HIDE_DRAFT_API
/**
* Construct an object with the given ISO currency code.
*
@ -64,10 +63,9 @@ class U_I18N_API CurrencyUnit: public MeasureUnit {
* length 3. If invalid, the currency is initialized to XXX.
* @param ec input-output error code. If the isoCode is invalid,
* then this will be set to a failing value.
* @draft ICU 64
* @stable ICU 64
*/
CurrencyUnit(StringPiece isoCode, UErrorCode &ec);
#endif /* U_HIDE_DRAFT_API */
/**
* Copy constructor

View File

@ -1283,14 +1283,13 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*/
virtual void setNegativeSuffix(const UnicodeString& newValue);
#ifndef U_HIDE_DRAFT_API
/**
* Whether to show the plus sign on positive (non-negative) numbers; for example, "+12"
*
* For more control over sign display, use NumberFormatter.
*
* @return Whether the sign is shown on positive numbers and zero.
* @draft ICU 64
* @stable ICU 64
*/
UBool isSignAlwaysShown() const;
@ -1300,10 +1299,9 @@ class U_I18N_API DecimalFormat : public NumberFormat {
* For more control over sign display, use NumberFormatter.
*
* @param value true to always show a sign; false to hide the sign on positive numbers and zero.
* @draft ICU 64
* @stable ICU 64
*/
void setSignAlwaysShown(UBool value);
#endif /* U_HIDE_DRAFT_API */
/**
* Get the multiplier for use in percent, permill, etc.
@ -1650,7 +1648,6 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*/
virtual void setSecondaryGroupingSize(int32_t newValue);
#ifndef U_HIDE_DRAFT_API
/**
* Returns the minimum number of grouping digits.
* Grouping separators are output if there are at least this many
@ -1672,7 +1669,7 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*
* @see setMinimumGroupingDigits
* @see getGroupingSize
* @draft ICU 64
* @stable ICU 64
*/
int32_t getMinimumGroupingDigits() const;
@ -1684,11 +1681,9 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*
* @param newValue the new value of minimum grouping digits.
* @see getMinimumGroupingDigits
* @draft ICU 64
* @stable ICU 64
*/
void setMinimumGroupingDigits(int32_t newValue);
#endif /* U_HIDE_DRAFT_API */
/**
* Allows you to get the behavior of the decimal separator with integers.
@ -1729,13 +1724,12 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*/
virtual void setDecimalPatternMatchRequired(UBool newValue);
#ifndef U_HIDE_DRAFT_API
/**
* Returns whether to ignore exponents when parsing.
*
* @return Whether to ignore exponents when parsing.
* @see #setParseNoExponent
* @draft ICU 64
* @stable ICU 64
*/
UBool isParseNoExponent() const;
@ -1745,7 +1739,7 @@ class U_I18N_API DecimalFormat : public NumberFormat {
* 5).
*
* @param value true to prevent exponents from being parsed; false to allow them to be parsed.
* @draft ICU 64
* @stable ICU 64
*/
void setParseNoExponent(UBool value);
@ -1754,7 +1748,7 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*
* @return Whether parsing is case-sensitive.
* @see #setParseCaseSensitive
* @draft ICU 64
* @stable ICU 64
*/
UBool isParseCaseSensitive() const;
@ -1767,7 +1761,7 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*
* @param value true to enable case-sensitive parsing (the default); false to force
* case-sensitive parsing behavior.
* @draft ICU 64
* @stable ICU 64
*/
void setParseCaseSensitive(UBool value);
@ -1777,7 +1771,7 @@ class U_I18N_API DecimalFormat : public NumberFormat {
*
* @return Whether an error code is set if high-order digits are truncated.
* @see setFormatFailIfMoreThanMaxDigits
* @draft ICU 64
* @stable ICU 64
*/
UBool isFormatFailIfMoreThanMaxDigits() const;
@ -1786,11 +1780,9 @@ class U_I18N_API DecimalFormat : public NumberFormat {
* By default, setMaximumIntegerDigits truncates high-order digits silently.
*
* @param value Whether to set an error code if high-order digits are truncated.
* @draft ICU 64
* @stable ICU 64
*/
void setFormatFailIfMoreThanMaxDigits(UBool value);
#endif /* U_HIDE_DRAFT_API */
/**
* Synthesizes a pattern string that represents the current state
@ -2067,7 +2059,6 @@ class U_I18N_API DecimalFormat : public NumberFormat {
#endif /* U_HIDE_INTERNAL_API */
#ifndef U_HIDE_DRAFT_API
/**
* Converts this DecimalFormat to a (Localized)NumberFormatter. Starting
* in ICU 60, NumberFormatter is the recommended way to format numbers.
@ -2111,10 +2102,9 @@ class U_I18N_API DecimalFormat : public NumberFormat {
* @param status Set on failure, like U_MEMORY_ALLOCATION_ERROR.
* @return A pointer to an internal object, or nullptr on failure.
* Do not delete the return value!
* @draft ICU 64
* @stable ICU 64
*/
const number::LocalizedNumberFormatter* toNumberFormatter(UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
/**
* Return the class ID for this class. This is useful only for

View File

@ -38,7 +38,6 @@ U_NAMESPACE_BEGIN
class FormattedDateIntervalData;
class DateIntervalFormat;
#ifndef U_HIDE_DRAFT_API
/**
* An immutable class containing the result of a date interval formatting operation.
*
@ -54,25 +53,25 @@ class DateIntervalFormat;
*
* Not intended for public subclassing.
*
* @draft ICU 64
* @stable ICU 64
*/
class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue {
public:
/**
* Default constructor; makes an empty FormattedDateInterval.
* @draft ICU 64
* @stable ICU 64
*/
FormattedDateInterval() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
/**
* Move constructor: Leaves the source FormattedDateInterval in an undefined state.
* @draft ICU 64
* @stable ICU 64
*/
FormattedDateInterval(FormattedDateInterval&& src) U_NOEXCEPT;
/**
* Destruct an instance of FormattedDateInterval.
* @draft ICU 64
* @stable ICU 64
*/
virtual ~FormattedDateInterval() U_OVERRIDE;
@ -84,7 +83,7 @@ class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue {
/**
* Move assignment: Leaves the source FormattedDateInterval in an undefined state.
* @draft ICU 64
* @stable ICU 64
*/
FormattedDateInterval& operator=(FormattedDateInterval&& src) U_NOEXCEPT;
@ -109,7 +108,6 @@ class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue {
: fData(nullptr), fErrorCode(errorCode) {}
friend class DateIntervalFormat;
};
#endif /* U_HIDE_DRAFT_API */
/**
@ -504,7 +502,6 @@ public:
FieldPosition& fieldPosition,
UErrorCode& status) const ;
#ifndef U_HIDE_DRAFT_API
/**
* Format a DateInterval to produce a FormattedDateInterval.
*
@ -513,12 +510,11 @@ public:
* @param dtInterval DateInterval to be formatted.
* @param status Set if an error occurs.
* @return A FormattedDateInterval containing the format result.
* @draft ICU 64
* @stable ICU 64
*/
FormattedDateInterval formatToValue(
const DateInterval& dtInterval,
UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
/**
* Format 2 Calendars to produce a string.
@ -549,7 +545,6 @@ public:
FieldPosition& fieldPosition,
UErrorCode& status) const ;
#ifndef U_HIDE_DRAFT_API
/**
* Format 2 Calendars to produce a FormattedDateInterval.
*
@ -564,13 +559,12 @@ public:
* to be formatted into date interval string
* @param status Set if an error occurs.
* @return A FormattedDateInterval containing the format result.
* @draft ICU 64
* @stable ICU 64
*/
FormattedDateInterval formatToValue(
Calendar& fromCalendar,
Calendar& toCalendar,
UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
/**
* Date interval parsing is not supported. Please do not use.

View File

@ -25,11 +25,6 @@ U_NAMESPACE_BEGIN
* of APIs throughout ICU use these classes for expressing their localized output.
*/
// The following cannot have #ifndef U_HIDE_DRAFT_API because
// class FormattedValue depends on it, and FormattedValue cannot be
// hidden becauseclass FormattedNumber (stable ICU 60) depends on it.
#ifndef U_FORCE_HIDE_DRAFT_API
/**
* Represents a span of a string containing a given field.
*
@ -41,7 +36,7 @@ U_NAMESPACE_BEGIN
*
* This class is not intended for public subclassing.
*
* @draft ICU 64
* @stable ICU 64
*/
class U_I18N_API ConstrainedFieldPosition : public UMemory {
public:
@ -51,21 +46,20 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
*
* By default, the ConstrainedFieldPosition has no iteration constraints.
*
* @draft ICU 64
* @stable ICU 64
*/
ConstrainedFieldPosition();
/** @draft ICU 64 */
/** @stable ICU 64 */
~ConstrainedFieldPosition();
#ifndef U_HIDE_DRAFT_API
/**
* Resets this ConstrainedFieldPosition to its initial state, as if it were newly created:
*
* - Removes any constraints that may have been set on the instance.
* - Resets the iteration position.
*
* @draft ICU 64
* @stable ICU 64
*/
void reset();
@ -89,7 +83,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* does not generally have well-defined behavior.
*
* @param category The field category to fix when iterating.
* @draft ICU 64
* @stable ICU 64
*/
void constrainCategory(int32_t category);
@ -114,7 +108,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
*
* @param category The field category to fix when iterating.
* @param field The field to fix when iterating.
* @draft ICU 64
* @stable ICU 64
*/
void constrainField(int32_t category, int32_t field);
@ -125,7 +119,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* FormattedValue#nextPosition returns TRUE.
*
* @return The field category saved in the instance.
* @draft ICU 64
* @stable ICU 64
*/
inline int32_t getCategory() const {
return fCategory;
@ -138,7 +132,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* FormattedValue#nextPosition returns TRUE.
*
* @return The field saved in the instance.
* @draft ICU 64
* @stable ICU 64
*/
inline int32_t getField() const {
return fField;
@ -150,7 +144,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* The return value is well-defined only after FormattedValue#nextPosition returns TRUE.
*
* @return The start index saved in the instance.
* @draft ICU 64
* @stable ICU 64
*/
inline int32_t getStart() const {
return fStart;
@ -162,7 +156,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* The return value is well-defined only after FormattedValue#nextPosition returns TRUE.
*
* @return The end index saved in the instance.
* @draft ICU 64
* @stable ICU 64
*/
inline int32_t getLimit() const {
return fLimit;
@ -181,7 +175,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* Users of FormattedValue should not need to call this method.
*
* @return The current iteration context from {@link #setInt64IterationContext}.
* @draft ICU 64
* @stable ICU 64
*/
inline int64_t getInt64IterationContext() const {
return fContext;
@ -193,7 +187,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* Intended to be used by FormattedValue implementations.
*
* @param context The new iteration context.
* @draft ICU 64
* @stable ICU 64
*/
void setInt64IterationContext(int64_t context);
@ -205,7 +199,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
*
* @param category The category to test.
* @param field The field to test.
* @draft ICU 64
* @stable ICU 64
*/
UBool matchesField(int32_t category, int32_t field) const;
@ -221,39 +215,32 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* @param field The new field.
* @param start The new inclusive start index.
* @param limit The new exclusive end index.
* @draft ICU 64
* @stable ICU 64
*/
void setState(
int32_t category,
int32_t field,
int32_t start,
int32_t limit);
#endif /* U_HIDE_DRAFT_API */
private:
int64_t fContext = 0LL;
int32_t fField = 0;
int32_t fStart = 0;
int32_t fLimit = 0;
#ifndef U_HIDE_DRAFT_API
int32_t fCategory = UFIELD_CATEGORY_UNDEFINED;
#else /* U_HIDE_DRAFT_API */
int32_t fCategory = 0;
#endif /* U_HIDE_DRAFT_API */
int8_t fConstraint = 0;
};
// The following cannot have #ifndef U_HIDE_DRAFT_API because
// class FormattedNumber (stable ICU 60) depends on it.
/**
* An abstract formatted value: a string with associated field attributes.
* Many formatters format to classes implementing FormattedValue.
*
* @draft ICU 64
* @stable ICU 64
*/
class U_I18N_API FormattedValue /* not : public UObject because this is an interface/mixin class */ {
public:
/** @draft ICU 64 */
/** @stable ICU 64 */
virtual ~FormattedValue();
/**
@ -264,7 +251,7 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @param status Set if an error occurs.
* @return a UnicodeString containing the formatted string.
*
* @draft ICU 64
* @stable ICU 64
*/
virtual UnicodeString toString(UErrorCode& status) const = 0;
@ -280,7 +267,7 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @param status Set if an error occurs.
* @return a temporary UnicodeString containing the formatted string.
*
* @draft ICU 64
* @stable ICU 64
*/
virtual UnicodeString toTempString(UErrorCode& status) const = 0;
@ -292,7 +279,7 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @param status Set if an error occurs.
* @return The same Appendable, for chaining.
*
* @draft ICU 64
* @stable ICU 64
* @see Appendable
*/
virtual Appendable& appendTo(Appendable& appendable, UErrorCode& status) const = 0;
@ -317,11 +304,10 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @return TRUE if a new occurrence of the field was found;
* FALSE otherwise or if an error was set.
*
* @draft ICU 64
* @stable ICU 64
*/
virtual UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const = 0;
};
#endif // U_FORCE_HIDE_DRAFT_API
U_NAMESPACE_END

View File

@ -66,7 +66,6 @@ struct ListFormatData : public UMemory {
#if !UCONFIG_NO_FORMATTING
#ifndef U_HIDE_DRAFT_API
/**
* An immutable class containing the result of a list formatting operation.
*
@ -81,25 +80,25 @@ struct ListFormatData : public UMemory {
*
* Not intended for public subclassing.
*
* @draft ICU 64
* @stable ICU 64
*/
class U_I18N_API FormattedList : public UMemory, public FormattedValue {
public:
/**
* Default constructor; makes an empty FormattedList.
* @draft ICU 64
* @stable ICU 64
*/
FormattedList() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
/**
* Move constructor: Leaves the source FormattedList in an undefined state.
* @draft ICU 64
* @stable ICU 64
*/
FormattedList(FormattedList&& src) U_NOEXCEPT;
/**
* Destruct an instance of FormattedList.
* @draft ICU 64
* @stable ICU 64
*/
virtual ~FormattedList() U_OVERRIDE;
@ -111,7 +110,7 @@ class U_I18N_API FormattedList : public UMemory, public FormattedValue {
/**
* Move assignment: Leaves the source FormattedList in an undefined state.
* @draft ICU 64
* @stable ICU 64
*/
FormattedList& operator=(FormattedList&& src) U_NOEXCEPT;
@ -136,7 +135,6 @@ class U_I18N_API FormattedList : public UMemory, public FormattedValue {
: fData(nullptr), fErrorCode(errorCode) {}
friend class ListFormatter;
};
#endif /* U_HIDE_DRAFT_API */
#endif // !UCONFIG_NO_FORMATTING
@ -240,7 +238,6 @@ class U_I18N_API ListFormatter : public UObject{
UnicodeString& appendTo, UErrorCode& errorCode) const;
#if !UCONFIG_NO_FORMATTING
#ifndef U_HIDE_DRAFT_API
/**
* Formats a list of strings to a FormattedList, which exposes field
* position information. The FormattedList contains more information than
@ -250,13 +247,12 @@ class U_I18N_API ListFormatter : public UObject{
* @param n_items Length of the array items.
* @param errorCode ICU error code returned here.
* @return A FormattedList containing field information.
* @draft ICU 64
* @stable ICU 64
*/
FormattedList formatStringsToValue(
const UnicodeString items[],
int32_t n_items,
UErrorCode& errorCode) const;
#endif /* U_HIDE_DRAFT_API */
#endif // !UCONFIG_NO_FORMATTING
#ifndef U_HIDE_INTERNAL_API

File diff suppressed because it is too large Load Diff

View File

@ -2095,7 +2095,6 @@ class U_I18N_API NumberFormatterSettings {
*/
UnicodeString toSkeleton(UErrorCode& status) const;
#ifndef U_HIDE_DRAFT_API
/**
* Returns the current (Un)LocalizedNumberFormatter as a LocalPointer
* wrapping a heap-allocated copy of the current object.
@ -2105,7 +2104,7 @@ class U_I18N_API NumberFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberFormatter pointer, or a wrapped
* nullptr on failure.
* @draft ICU 64
* @stable ICU 64
*/
LocalPointer<Derived> clone() const &;
@ -2114,10 +2113,9 @@ class U_I18N_API NumberFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberFormatter pointer, or a wrapped
* nullptr on failure.
* @draft ICU 64
* @stable ICU 64
*/
LocalPointer<Derived> clone() &&;
#endif /* U_HIDE_DRAFT_API */
/**
* Sets the UErrorCode if an error occurred in the fluent chain.
@ -2429,14 +2427,12 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
public:
// Default constructor cannot have #ifndef U_HIDE_DRAFT_API
#ifndef U_FORCE_HIDE_DRAFT_API
/**
* Default constructor; makes an empty FormattedNumber.
* @draft ICU 64
* @stable ICU 64
*/
FormattedNumber()
: fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
#endif // U_FORCE_HIDE_DRAFT_API
/**
* Move constructor: Leaves the source FormattedNumber in an undefined state.
@ -2610,7 +2606,6 @@ class U_I18N_API NumberFormatter final {
*/
static UnlocalizedNumberFormatter forSkeleton(const UnicodeString& skeleton, UErrorCode& status);
#ifndef U_HIDE_DRAFT_API
/**
* Call this method at the beginning of a NumberFormatter fluent chain to create an instance based
* on a given number skeleton string.
@ -2626,11 +2621,10 @@ class U_I18N_API NumberFormatter final {
* @param status
* Set to U_NUMBER_SKELETON_SYNTAX_ERROR if the skeleton was invalid.
* @return An UnlocalizedNumberFormatter, to be used for chaining.
* @draft ICU 64
* @stable ICU 64
*/
static UnlocalizedNumberFormatter forSkeleton(const UnicodeString& skeleton,
UParseError& perror, UErrorCode& status);
#endif
/**
* Use factory methods instead of the constructor to create a NumberFormatter.

View File

@ -449,7 +449,6 @@ class U_I18N_API NumberRangeFormatterSettings {
*/
Derived identityFallback(UNumberRangeIdentityFallback identityFallback) &&;
#ifndef U_HIDE_DRAFT_API
/**
* Returns the current (Un)LocalizedNumberRangeFormatter as a LocalPointer
* wrapping a heap-allocated copy of the current object.
@ -459,7 +458,7 @@ class U_I18N_API NumberRangeFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberRangeFormatter pointer, or a wrapped
* nullptr on failure.
* @draft ICU 64
* @stable ICU 64
*/
LocalPointer<Derived> clone() const &;
@ -468,10 +467,9 @@ class U_I18N_API NumberRangeFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberRangeFormatter pointer, or a wrapped
* nullptr on failure.
* @draft ICU 64
* @stable ICU 64
*/
LocalPointer<Derived> clone() &&;
#endif /* U_HIDE_DRAFT_API */
/**
* Sets the UErrorCode if an error occurred in the fluent chain.

View File

@ -239,12 +239,10 @@ public:
kPermillField = UNUM_PERMILL_FIELD,
/** @stable ICU 2.0 */
kSignField = UNUM_SIGN_FIELD,
#ifndef U_HIDE_DRAFT_API
/** @draft ICU 64 */
/** @stable ICU 64 */
kMeasureUnitField = UNUM_MEASURE_UNIT_FIELD,
/** @draft ICU 64 */
/** @stable ICU 64 */
kCompactField = UNUM_COMPACT_FIELD,
#endif // U_HIDE_DRAFT_API
/**
* These constants are provided for backwards compatibility only.

View File

@ -350,7 +350,6 @@ public:
*/
UnicodeString select(double number) const;
#ifndef U_HIDE_DRAFT_API
/**
* Given a formatted number, returns the keyword of the first rule
* that applies to the number. This function can be used with
@ -364,10 +363,9 @@ public:
* @param status Set if an error occurs while selecting plural keyword.
* This could happen if the FormattedNumber is invalid.
* @return The keyword of the selected rule.
* @draft ICU 64
* @stable ICU 64
*/
UnicodeString select(const number::FormattedNumber& number, UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API
/**

View File

@ -264,7 +264,6 @@ class UnicodeString;
class FormattedRelativeDateTime;
class FormattedRelativeDateTimeData;
#ifndef U_HIDE_DRAFT_API
/**
* An immutable class containing the result of a relative datetime formatting operation.
*
@ -272,25 +271,25 @@ class FormattedRelativeDateTimeData;
*
* Not intended for public subclassing.
*
* @draft ICU 64
* @stable ICU 64
*/
class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedValue {
public:
/**
* Default constructor; makes an empty FormattedRelativeDateTime.
* @draft ICU 64
* @stable ICU 64
*/
FormattedRelativeDateTime() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
/**
* Move constructor: Leaves the source FormattedRelativeDateTime in an undefined state.
* @draft ICU 64
* @stable ICU 64
*/
FormattedRelativeDateTime(FormattedRelativeDateTime&& src) U_NOEXCEPT;
/**
* Destruct an instance of FormattedRelativeDateTime.
* @draft ICU 64
* @stable ICU 64
*/
virtual ~FormattedRelativeDateTime() U_OVERRIDE;
@ -302,7 +301,7 @@ class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedVal
/**
* Move assignment: Leaves the source FormattedRelativeDateTime in an undefined state.
* @draft ICU 64
* @stable ICU 64
*/
FormattedRelativeDateTime& operator=(FormattedRelativeDateTime&& src) U_NOEXCEPT;
@ -327,7 +326,6 @@ class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedVal
: fData(nullptr), fErrorCode(errorCode) {}
friend class RelativeDateTimeFormatter;
};
#endif /* U_HIDE_DRAFT_API */
/**
* Formats simple relative dates. There are two types of relative dates that
@ -492,7 +490,6 @@ public:
UnicodeString& appendTo,
UErrorCode& status) const;
#ifndef U_HIDE_DRAFT_API
/**
* Formats a relative date with a quantity such as "in 5 days" or
* "3 months ago"
@ -508,14 +505,13 @@ public:
* @param unit the unit e.g day? month? year?
* @param status ICU error code returned here.
* @return The formatted relative datetime
* @draft ICU 64
* @stable ICU 64
*/
FormattedRelativeDateTime formatToValue(
double quantity,
UDateDirection direction,
UDateRelativeUnit unit,
UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
/**
* Formats a relative date without a quantity.
@ -539,7 +535,6 @@ public:
UnicodeString& appendTo,
UErrorCode& status) const;
#ifndef U_HIDE_DRAFT_API
/**
* Formats a relative date without a quantity.
*
@ -553,13 +548,12 @@ public:
* @param unit e.g SATURDAY, DAY, MONTH
* @param status ICU error code returned here.
* @return The formatted relative datetime
* @draft ICU 64
* @stable ICU 64
*/
FormattedRelativeDateTime formatToValue(
UDateDirection direction,
UDateAbsoluteUnit unit,
UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
@ -587,7 +581,6 @@ public:
UnicodeString& appendTo,
UErrorCode& status) const;
#ifndef U_HIDE_DRAFT_API
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
* using a numeric style, e.g. "1 week ago", "in 1 week",
@ -604,13 +597,12 @@ public:
* UDAT_REL_UNIT_FRIDAY.
* @param status ICU error code returned here.
* @return The formatted relative datetime
* @draft ICU 64
* @stable ICU 64
*/
FormattedRelativeDateTime formatNumericToValue(
double offset,
URelativeDateTimeUnit unit,
UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
@ -638,7 +630,6 @@ public:
UnicodeString& appendTo,
UErrorCode& status) const;
#ifndef U_HIDE_DRAFT_API
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
* using a text style if possible, e.g. "last week", "this week",
@ -655,13 +646,12 @@ public:
* UDAT_REL_UNIT_FRIDAY.
* @param status ICU error code returned here.
* @return The formatted relative datetime
* @draft ICU 64
* @stable ICU 64
*/
FormattedRelativeDateTime formatToValue(
double offset,
URelativeDateTimeUnit unit,
UErrorCode& status) const;
#endif /* U_HIDE_DRAFT_API */
/**
* Combines a relative date string and a time string in this object's
@ -724,13 +714,11 @@ private:
UErrorCode& status,
Args... args) const;
#ifndef U_HIDE_DRAFT_API // for FormattedRelativeDateTime
template<typename F, typename... Args>
FormattedRelativeDateTime doFormatToValue(
F callback,
UErrorCode& status,
Args... args) const;
#endif // U_HIDE_DRAFT_API
void formatImpl(
double quantity,

View File

@ -83,14 +83,12 @@
struct UDateIntervalFormat;
typedef struct UDateIntervalFormat UDateIntervalFormat; /**< C typedef for struct UDateIntervalFormat. @stable ICU 4.8 */
#ifndef U_HIDE_DRAFT_API
struct UFormattedDateInterval;
/**
* Opaque struct to contain the results of a UDateIntervalFormat operation.
* @draft ICU 64
* @stable ICU 64
*/
typedef struct UFormattedDateInterval UFormattedDateInterval;
#endif /* U_HIDE_DRAFT_API */
/**
* Open a new UDateIntervalFormat object using the predefined rules for a
@ -133,8 +131,6 @@ udtitvfmt_open(const char* locale,
U_STABLE void U_EXPORT2
udtitvfmt_close(UDateIntervalFormat *formatter);
#ifndef U_HIDE_DRAFT_API
/**
* Creates an object to hold the result of a UDateIntervalFormat
* operation. The object can be used repeatedly; it is cleared whenever
@ -142,7 +138,7 @@ udtitvfmt_close(UDateIntervalFormat *formatter);
*
* @param ec Set if an error occurs.
* @return A pointer needing ownership.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI UFormattedDateInterval* U_EXPORT2
udtitvfmt_openResult(UErrorCode* ec);
@ -167,7 +163,7 @@ udtitvfmt_openResult(UErrorCode* ec);
* @param uresult The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI const UFormattedValue* U_EXPORT2
udtitvfmt_resultAsValue(const UFormattedDateInterval* uresult, UErrorCode* ec);
@ -176,11 +172,10 @@ udtitvfmt_resultAsValue(const UFormattedDateInterval* uresult, UErrorCode* ec);
* Releases the UFormattedDateInterval created by udtitvfmt_openResult().
*
* @param uresult The object to release.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI void U_EXPORT2
udtitvfmt_closeResult(UFormattedDateInterval* uresult);
#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
@ -198,7 +193,6 @@ U_NAMESPACE_BEGIN
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateIntervalFormatPointer, UDateIntervalFormat, udtitvfmt_close);
#ifndef U_HIDE_DRAFT_API
/**
* \class LocalUFormattedDateIntervalPointer
* "Smart pointer" class, closes a UFormattedDateInterval via udtitvfmt_close().
@ -206,10 +200,9 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateIntervalFormatPointer, UDateIntervalFormat
*
* @see LocalPointerBase
* @see LocalPointer
* @draft ICU 64
* @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedDateIntervalPointer, UFormattedDateInterval, udtitvfmt_closeResult);
#endif /* U_HIDE_DRAFT_API */
U_NAMESPACE_END

View File

@ -10,8 +10,6 @@
#include "unicode/ufieldpositer.h"
#ifndef U_HIDE_DRAFT_API
/**
* \file
* \brief C API: Abstract operations for localized strings.
@ -31,41 +29,41 @@
* categories 2^28 and higher or below zero (with the highest bit turned on)
* are private-use and will not be used by ICU in the future.
*
* @draft ICU 64
* @stable ICU 64
*/
typedef enum UFieldCategory {
/**
* For an undefined field category.
*
* @draft ICU 64
* @stable ICU 64
*/
UFIELD_CATEGORY_UNDEFINED = 0,
/**
* For fields in UDateFormatField (udat.h), from ICU 3.0.
*
* @draft ICU 64
* @stable ICU 64
*/
UFIELD_CATEGORY_DATE,
/**
* For fields in UNumberFormatFields (unum.h), from ICU 49.
*
* @draft ICU 64
* @stable ICU 64
*/
UFIELD_CATEGORY_NUMBER,
/**
* For fields in UListFormatterField (ulistformatter.h), from ICU 63.
*
* @draft ICU 64
* @stable ICU 64
*/
UFIELD_CATEGORY_LIST,
/**
* For fields in URelativeDateTimeFormatterField (ureldatefmt.h), from ICU 64.
*
* @draft ICU 64
* @stable ICU 64
*/
UFIELD_CATEGORY_RELATIVE_DATETIME,
@ -84,14 +82,14 @@ typedef enum UFieldCategory {
/**
* Category for spans in a list.
*
* @draft ICU 64
* @stable ICU 64
*/
UFIELD_CATEGORY_LIST_SPAN = 0x1000 + UFIELD_CATEGORY_LIST,
/**
* Category for spans in a date interval.
*
* @draft ICU 64
* @stable ICU 64
*/
UFIELD_CATEGORY_DATE_INTERVAL_SPAN = 0x1000 + UFIELD_CATEGORY_DATE_INTERVAL,
@ -108,7 +106,7 @@ struct UConstrainedFieldPosition;
* 2. It allows you to set constraints to use when iterating over field positions.
* 3. It is used for the newer FormattedValue APIs.
*
* @draft ICU 64
* @stable ICU 64
*/
typedef struct UConstrainedFieldPosition UConstrainedFieldPosition;
@ -120,9 +118,9 @@ typedef struct UConstrainedFieldPosition UConstrainedFieldPosition;
*
* @param ec Set if an error occurs.
* @return The new object, or NULL if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT UConstrainedFieldPosition* U_EXPORT2
U_STABLE UConstrainedFieldPosition* U_EXPORT2
ucfpos_open(UErrorCode* ec);
@ -133,9 +131,9 @@ ucfpos_open(UErrorCode* ec);
*
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ucfpos_reset(
UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@ -145,9 +143,9 @@ ucfpos_reset(
* Destroys a UConstrainedFieldPosition and releases its memory.
*
* @param ucfpos The instance of UConstrainedFieldPosition.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ucfpos_close(UConstrainedFieldPosition* ucfpos);
@ -174,9 +172,9 @@ ucfpos_close(UConstrainedFieldPosition* ucfpos);
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param category The field category to fix when iterating.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ucfpos_constrainCategory(
UConstrainedFieldPosition* ucfpos,
int32_t category,
@ -207,9 +205,9 @@ ucfpos_constrainCategory(
* @param category The field category to fix when iterating.
* @param field The field to fix when iterating.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ucfpos_constrainField(
UConstrainedFieldPosition* ucfpos,
int32_t category,
@ -227,9 +225,9 @@ ucfpos_constrainField(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
* @return The field category saved in the instance.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT int32_t U_EXPORT2
U_STABLE int32_t U_EXPORT2
ucfpos_getCategory(
const UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@ -245,9 +243,9 @@ ucfpos_getCategory(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
* @return The field saved in the instance.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT int32_t U_EXPORT2
U_STABLE int32_t U_EXPORT2
ucfpos_getField(
const UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@ -262,9 +260,9 @@ ucfpos_getField(
* @param pStart Set to the start index saved in the instance. Ignored if nullptr.
* @param pLimit Set to the end index saved in the instance. Ignored if nullptr.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ucfpos_getIndexes(
const UConstrainedFieldPosition* ucfpos,
int32_t* pStart,
@ -282,9 +280,9 @@ ucfpos_getIndexes(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
* @return The current iteration context from ucfpos_setInt64IterationContext.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT int64_t U_EXPORT2
U_STABLE int64_t U_EXPORT2
ucfpos_getInt64IterationContext(
const UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@ -298,9 +296,9 @@ ucfpos_getInt64IterationContext(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param context The new iteration context.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ucfpos_setInt64IterationContext(
UConstrainedFieldPosition* ucfpos,
int64_t context,
@ -317,9 +315,9 @@ ucfpos_setInt64IterationContext(
* @param category The category to test.
* @param field The field to test.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT UBool U_EXPORT2
U_STABLE UBool U_EXPORT2
ucfpos_matchesField(
const UConstrainedFieldPosition* ucfpos,
int32_t category,
@ -341,9 +339,9 @@ ucfpos_matchesField(
* @param start The new inclusive start index.
* @param limit The new exclusive end index.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ucfpos_setState(
UConstrainedFieldPosition* ucfpos,
int32_t category,
@ -358,7 +356,7 @@ struct UFormattedValue;
* An abstract formatted value: a string with associated field attributes.
* Many formatters format to types compatible with UFormattedValue.
*
* @draft ICU 64
* @stable ICU 64
*/
typedef struct UFormattedValue UFormattedValue;
@ -374,9 +372,9 @@ typedef struct UFormattedValue UFormattedValue;
* @param pLength Output variable for the length of the string. Ignored if NULL.
* @param ec Set if an error occurs.
* @return A NUL-terminated char16 string owned by the UFormattedValue.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT const UChar* U_EXPORT2
U_STABLE const UChar* U_EXPORT2
ufmtval_getString(
const UFormattedValue* ufmtval,
int32_t* pLength,
@ -404,9 +402,9 @@ ufmtval_getString(
* and ucfpos_constrainField.
* @param ec Set if an error occurs.
* @return TRUE if another position was found; FALSE otherwise.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT UBool U_EXPORT2
U_STABLE UBool U_EXPORT2
ufmtval_nextPosition(
const UFormattedValue* ufmtval,
UConstrainedFieldPosition* ucfpos,
@ -426,7 +424,7 @@ U_NAMESPACE_BEGIN
* LocalUConstrainedFieldPositionPointer ucfpos(ucfpos_open(ec));
* // no need to explicitly call ucfpos_close()
*
* @draft ICU 64
* @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUConstrainedFieldPositionPointer,
UConstrainedFieldPosition,
@ -436,6 +434,5 @@ U_NAMESPACE_END
#endif // U_SHOW_CPLUSPLUS_API
#endif /* U_HIDE_DRAFT_API */
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // __UFORMATTEDVALUE_H__

View File

@ -34,34 +34,32 @@
struct UListFormatter;
typedef struct UListFormatter UListFormatter; /**< C typedef for struct UListFormatter. @stable ICU 55 */
#ifndef U_HIDE_DRAFT_API
struct UFormattedList;
/**
* Opaque struct to contain the results of a UListFormatter operation.
* @draft ICU 64
* @stable ICU 64
*/
typedef struct UFormattedList UFormattedList;
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
* FieldPosition and UFieldPosition selectors for format fields
* defined by ListFormatter.
* @draft ICU 63
* @stable ICU 63
*/
typedef enum UListFormatterField {
/**
* The literal text in the result which came from the resources.
* @draft ICU 63
* @stable ICU 63
*/
ULISTFMT_LITERAL_FIELD,
/**
* The element text in the result which came from the input strings.
* @draft ICU 63
* @stable ICU 63
*/
ULISTFMT_ELEMENT_FIELD
} UListFormatterField;
#ifndef U_HIDE_DRAFT_API
/**
* Type of meaning expressed by the list.
*
@ -163,7 +161,7 @@ ulistfmt_open(const char* locale,
* or NULL if an error occurred.
* @draft ICU 67
*/
U_CAPI UListFormatter* U_EXPORT2
U_DRAFT UListFormatter* U_EXPORT2
ulistfmt_openForType(const char* locale, UListFormatterType type,
UListFormatterWidth width, UErrorCode* status);
#endif /* U_HIDE_DRAFT_API */
@ -177,7 +175,6 @@ ulistfmt_openForType(const char* locale, UListFormatterType type,
U_CAPI void U_EXPORT2
ulistfmt_close(UListFormatter *listfmt);
#ifndef U_HIDE_DRAFT_API
/**
* Creates an object to hold the result of a UListFormatter
* operation. The object can be used repeatedly; it is cleared whenever
@ -185,7 +182,7 @@ ulistfmt_close(UListFormatter *listfmt);
*
* @param ec Set if an error occurs.
* @return A pointer needing ownership.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI UFormattedList* U_EXPORT2
ulistfmt_openResult(UErrorCode* ec);
@ -209,7 +206,7 @@ ulistfmt_openResult(UErrorCode* ec);
* @param uresult The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI const UFormattedValue* U_EXPORT2
ulistfmt_resultAsValue(const UFormattedList* uresult, UErrorCode* ec);
@ -218,11 +215,10 @@ ulistfmt_resultAsValue(const UFormattedList* uresult, UErrorCode* ec);
* Releases the UFormattedList created by ulistfmt_openResult().
*
* @param uresult The object to release.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI void U_EXPORT2
ulistfmt_closeResult(UFormattedList* uresult);
#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
@ -240,7 +236,6 @@ U_NAMESPACE_BEGIN
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUListFormatterPointer, UListFormatter, ulistfmt_close);
#ifndef U_HIDE_DRAFT_API
/**
* \class LocalUFormattedListPointer
* "Smart pointer" class, closes a UFormattedList via ulistfmt_closeResult().
@ -248,10 +243,9 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalUListFormatterPointer, UListFormatter, ulistfmt
*
* @see LocalPointerBase
* @see LocalPointer
* @draft ICU 64
* @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedListPointer, UFormattedList, ulistfmt_closeResult);
#endif /* U_HIDE_DRAFT_API */
U_NAMESPACE_END
@ -300,7 +294,6 @@ ulistfmt_format(const UListFormatter* listfmt,
int32_t resultCapacity,
UErrorCode* status);
#ifndef U_HIDE_DRAFT_API
/**
* Formats a list of strings to a UFormattedList, which exposes more
* information than the string exported by ulistfmt_format().
@ -325,7 +318,7 @@ ulistfmt_format(const UListFormatter* listfmt,
* operation. See ulistfmt_openResult().
* @param status
* Error code set if an error occurred during formatting.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI void U_EXPORT2
ulistfmt_formatStringsToResult(
@ -335,7 +328,6 @@ ulistfmt_formatStringsToResult(
int32_t stringCount,
UFormattedList* uresult,
UErrorCode* status);
#endif /* U_HIDE_DRAFT_API */
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -377,12 +377,10 @@ typedef enum UNumberFormatFields {
UNUM_PERMILL_FIELD,
/** @stable ICU 49 */
UNUM_SIGN_FIELD,
#ifndef U_HIDE_DRAFT_API
/** @draft ICU 64 */
/** @stable ICU 64 */
UNUM_MEASURE_UNIT_FIELD,
/** @draft ICU 64 */
/** @stable ICU 64 */
UNUM_COMPACT_FIELD,
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DEPRECATED_API
/**
@ -1032,17 +1030,15 @@ typedef enum UNumberFormatAttribute {
* @stable ICU 51 */
UNUM_SCALE = 21,
#ifndef U_HIDE_DRAFT_API
/**
* Minimum grouping digits; most commonly set to 2 to print "1000" instead of "1,000".
* See DecimalFormat::getMinimumGroupingDigits().
*
* For better control over grouping strategies, use UNumberFormatter.
*
* @draft ICU 64
* @stable ICU 64
*/
UNUM_MINIMUM_GROUPING_DIGITS = 22,
#endif /* U_HIDE_DRAFT_API */
/**
* if this attribute is set to 0, it is set to UNUM_CURRENCY_STANDARD purpose,
@ -1083,12 +1079,10 @@ typedef enum UNumberFormatAttribute {
*/
UNUM_PARSE_DECIMAL_MARK_REQUIRED = 0x1002,
#ifndef U_HIDE_DRAFT_API
/**
* Parsing: if set to 1, parsing is sensitive to case (lowercase/uppercase).
*
* @draft ICU 64
* @stable ICU 64
*/
UNUM_PARSE_CASE_SENSITIVE = 0x1003,
@ -1097,12 +1091,10 @@ typedef enum UNumberFormatAttribute {
*
* For better control over sign display, use UNumberFormatter.
*
* @draft ICU 64
* @stable ICU 64
*/
UNUM_SIGN_ALWAYS_SHOWN = 0x1004,
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API
/** Limit of boolean attributes. (value should
* not depend on U_HIDE conditionals)

View File

@ -437,7 +437,6 @@ unumf_openForSkeletonAndLocale(const UChar* skeleton, int32_t skeletonLen, const
UErrorCode* ec);
#ifndef U_HIDE_DRAFT_API
/**
* Like unumf_openForSkeletonAndLocale, but accepts a UParseError, which will be populated with the
* location of a skeleton syntax error if such a syntax error exists.
@ -448,12 +447,11 @@ unumf_openForSkeletonAndLocale(const UChar* skeleton, int32_t skeletonLen, const
* @param perror A parse error struct populated if an error occurs when parsing. Can be NULL.
* If no error occurs, perror->offset will be set to -1.
* @param ec Set if an error occurs.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT UNumberFormatter* U_EXPORT2
U_STABLE UNumberFormatter* U_EXPORT2
unumf_openForSkeletonAndLocaleWithError(
const UChar* skeleton, int32_t skeletonLen, const char* locale, UParseError* perror, UErrorCode* ec);
#endif // U_HIDE_DRAFT_API
/**
@ -531,7 +529,6 @@ U_STABLE void U_EXPORT2
unumf_formatDecimal(const UNumberFormatter* uformatter, const char* value, int32_t valueLen,
UFormattedNumber* uresult, UErrorCode* ec);
#ifndef U_HIDE_DRAFT_API
/**
* Returns a representation of a UFormattedNumber as a UFormattedValue,
* which can be subsequently passed to any API requiring that type.
@ -544,11 +541,10 @@ unumf_formatDecimal(const UNumberFormatter* uformatter, const char* value, int32
* @param uresult The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT const UFormattedValue* U_EXPORT2
U_STABLE const UFormattedValue* U_EXPORT2
unumf_resultAsValue(const UFormattedNumber* uresult, UErrorCode* ec);
#endif /* U_HIDE_DRAFT_API */
/**

View File

@ -152,7 +152,6 @@ uplrules_select(const UPluralRules *uplrules,
UChar *keyword, int32_t capacity,
UErrorCode *status);
#ifndef U_HIDE_DRAFT_API
/**
* Given a formatted number, returns the keyword of the first rule
* that applies to the number, according to the supplied UPluralRules object.
@ -168,14 +167,13 @@ uplrules_select(const UPluralRules *uplrules,
* @param capacity The capacity of the keyword buffer.
* @param status A pointer to a UErrorCode to receive any errors.
* @return The length of the keyword.
* @draft ICU 64
* @stable ICU 64
*/
U_CAPI int32_t U_EXPORT2
uplrules_selectFormatted(const UPluralRules *uplrules,
const struct UFormattedNumber* number,
UChar *keyword, int32_t capacity,
UErrorCode *status);
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API
/**

View File

@ -175,25 +175,23 @@ typedef enum URelativeDateTimeUnit {
#endif /* U_HIDE_DEPRECATED_API */
} URelativeDateTimeUnit;
#ifndef U_HIDE_DRAFT_API
/**
* FieldPosition and UFieldPosition selectors for format fields
* defined by RelativeDateTimeFormatter.
* @draft ICU 64
* @stable ICU 64
*/
typedef enum URelativeDateTimeFormatterField {
/**
* Represents a literal text string, like "tomorrow" or "days ago".
* @draft ICU 64
* @stable ICU 64
*/
UDAT_REL_LITERAL_FIELD,
/**
* Represents a number quantity, like "3" in "3 days ago".
* @draft ICU 64
* @stable ICU 64
*/
UDAT_REL_NUMERIC_FIELD,
} URelativeDateTimeFormatterField;
#endif // U_HIDE_DRAFT_API
/**
@ -252,11 +250,10 @@ ureldatefmt_open( const char* locale,
U_STABLE void U_EXPORT2
ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt);
#ifndef U_HIDE_DRAFT_API
struct UFormattedRelativeDateTime;
/**
* Opaque struct to contain the results of a URelativeDateTimeFormatter operation.
* @draft ICU 64
* @stable ICU 64
*/
typedef struct UFormattedRelativeDateTime UFormattedRelativeDateTime;
@ -267,9 +264,9 @@ typedef struct UFormattedRelativeDateTime UFormattedRelativeDateTime;
*
* @param ec Set if an error occurs.
* @return A pointer needing ownership.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT UFormattedRelativeDateTime* U_EXPORT2
U_STABLE UFormattedRelativeDateTime* U_EXPORT2
ureldatefmt_openResult(UErrorCode* ec);
/**
@ -284,20 +281,19 @@ ureldatefmt_openResult(UErrorCode* ec);
* @param ufrdt The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT const UFormattedValue* U_EXPORT2
U_STABLE const UFormattedValue* U_EXPORT2
ureldatefmt_resultAsValue(const UFormattedRelativeDateTime* ufrdt, UErrorCode* ec);
/**
* Releases the UFormattedRelativeDateTime created by ureldatefmt_openResult.
*
* @param ufrdt The object to release.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ureldatefmt_closeResult(UFormattedRelativeDateTime* ufrdt);
#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
@ -315,7 +311,6 @@ U_NAMESPACE_BEGIN
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close);
#ifndef U_HIDE_DRAFT_API
/**
* \class LocalUFormattedRelativeDateTimePointer
* "Smart pointer" class, closes a UFormattedRelativeDateTime via ureldatefmt_closeResult().
@ -323,10 +318,9 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDat
*
* @see LocalPointerBase
* @see LocalPointer
* @draft ICU 64
* @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedRelativeDateTimePointer, UFormattedRelativeDateTime, ureldatefmt_closeResult);
#endif /* U_HIDE_DRAFT_API */
U_NAMESPACE_END
@ -368,7 +362,6 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
int32_t resultCapacity,
UErrorCode* status);
#ifndef U_HIDE_DRAFT_API
/**
* Format a combination of URelativeDateTimeUnit and numeric
* offset using a numeric style, e.g. "1 week ago", "in 1 week",
@ -390,16 +383,15 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
* A pointer to a UErrorCode to receive any errors. In
* case of error status, the contents of result are
* undefined.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ureldatefmt_formatNumericToResult(
const URelativeDateTimeFormatter* reldatefmt,
double offset,
URelativeDateTimeUnit unit,
UFormattedRelativeDateTime* result,
UErrorCode* status);
#endif /* U_HIDE_DRAFT_API */
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
@ -437,7 +429,6 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
int32_t resultCapacity,
UErrorCode* status);
#ifndef U_HIDE_DRAFT_API
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
* using a text style if possible, e.g. "last week", "this week",
@ -462,16 +453,15 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
* A pointer to a UErrorCode to receive any errors. In
* case of error status, the contents of result are
* undefined.
* @draft ICU 64
* @stable ICU 64
*/
U_DRAFT void U_EXPORT2
U_STABLE void U_EXPORT2
ureldatefmt_formatToResult(
const URelativeDateTimeFormatter* reldatefmt,
double offset,
URelativeDateTimeUnit unit,
UFormattedRelativeDateTime* result,
UErrorCode* status);
#endif /* U_HIDE_DRAFT_API */
/**
* Combines a relative date string and a time string in this object's