ICU-20796 BRS 65 update C API guard macros (manual version) (#827)

This commit is contained in:
Peter Edberg 2019-09-11 16:27:29 -07:00 committed by pedberg-icu
parent f894302ebe
commit c4ea7681ee
12 changed files with 34 additions and 27 deletions

View file

@ -97,6 +97,7 @@ public:
return *this;
}
#ifndef U_HIDE_DRAFT_API
/**
* Returns the state of this trie as a 64-bit integer.
* The state value is never 0.
@ -129,6 +130,7 @@ public:
pos_ = bytes_ + (state & kState64PosMask);
return *this;
}
#endif /* U_HIDE_DRAFT_API */
/**
* BytesTrie state object, for saving a trie's current state

View file

@ -279,6 +279,7 @@ public:
*/
Locale build(UErrorCode& status);
#ifndef U_HIDE_DRAFT_API
/**
* Sets the UErrorCode if an error occurred while recording sets.
* Preserves older error codes in the outErrorCode.
@ -289,6 +290,7 @@ public:
* @draft ICU 65
*/
UBool copyErrorTo(UErrorCode &outErrorCode) const;
#endif /* U_HIDE_DRAFT_API */
private:
friend class LocaleMatcher::Result;

View file

@ -97,6 +97,7 @@ public:
return *this;
}
#ifndef U_HIDE_DRAFT_API
/**
* Returns the state of this trie as a 64-bit integer.
* The state value is never 0.
@ -129,6 +130,7 @@ public:
pos_ = uchars_ + (state & kState64PosMask);
return *this;
}
#endif /* U_HIDE_DRAFT_API */
/**
* UCharsTrie state object, for saving a trie's current state

View file

@ -1655,11 +1655,10 @@ private:
const UnicodeSet* inclusions,
UErrorCode &status);
#ifndef U_HIDE_DRAFT_API // Skipped: ucpmap.h is draft only.
// UCPMap is now stable ICU 63
void applyIntPropertyValue(const UCPMap *map,
UCPMapValueFilter *filter, const void *context,
UErrorCode &errorCode);
#endif /* U_HIDE_DRAFT_API */
/**
* Set the new pattern to cache.

View file

@ -2283,7 +2283,6 @@ private:
* should only be called if this calendar is not lenient.
* @see #isLenient
* @see #validateField(int, int&)
* @internal
*/
void validateFields(UErrorCode &status);
@ -2293,7 +2292,6 @@ private:
* <code>U_ILLEGAL_ARGUMENT_ERROR</code> will be set. Subclasses may
* use this method in their implementation of {@link
* #validateField(int, int&)}.
* @internal
*/
void validateField(UCalendarDateFields field, int32_t min, int32_t max, UErrorCode& status);

View file

@ -457,13 +457,11 @@ private:
* to non-resource bundle strings,
* then regular UnicodeString copies must be used instead of fastCopyFrom().
*
* @internal
*/
UnicodeString fSymbols[kFormatSymbolCount];
/**
* Non-symbol variable for getConstSymbol(). Always empty.
* @internal
*/
UnicodeString fNoSymbol;

View file

@ -565,12 +565,10 @@ private:
void setDateTimeFromCalendar(const Locale& locale, UErrorCode& status);
void setDecimalSymbols(const Locale& locale, UErrorCode& status);
UDateTimePatternField getAppendFormatNumber(const char* field) const;
#ifndef U_HIDE_DRAFT_API
// The following three have to be U_HIDE_DRAFT_API (though private) because UDateTimePGDisplayWidth is
// Note for the next 3: UDateTimePGDisplayWidth is now stable ICU 61
UDateTimePatternField getFieldAndWidthIndices(const char* key, UDateTimePGDisplayWidth* widthP) const;
void setFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width, const UnicodeString& value);
UnicodeString& getMutableFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width);
#endif // U_HIDE_DRAFT_API
void getAppendName(UDateTimePatternField field, UnicodeString& value);
UnicodeString mapSkeletonMetacharacters(const UnicodeString& patternForm, int32_t* flags, UErrorCode& status);
const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields, UErrorCode& status, const PtnSkeleton** specifiedSkeletonPtr = 0);

View file

@ -26,7 +26,9 @@ U_NAMESPACE_BEGIN
*/
#ifndef U_HIDE_DRAFT_API
// 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.
/**
* Represents a span of a string containing a given field.
*
@ -55,6 +57,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
/** @draft ICU 64 */
~ConstrainedFieldPosition();
#ifndef U_HIDE_DRAFT_API
/**
* Resets this ConstrainedFieldPosition to its initial state, as if it were newly created:
*
@ -224,18 +227,23 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
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;
};
#endif // U_HIDE_DRAFT_API
// 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.
@ -288,7 +296,6 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
*/
virtual Appendable& appendTo(Appendable& appendable, UErrorCode& status) const = 0;
#ifndef U_HIDE_DRAFT_API
/**
* Iterates over field positions in the FormattedValue. This lets you determine the position
* of specific types of substrings, like a month or a decimal separator.
@ -312,7 +319,6 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @draft ICU 64
*/
virtual UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const = 0;
#endif
};

View file

@ -2410,14 +2410,14 @@ class U_I18N_API LocalizedNumberFormatter
class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
public:
#ifndef U_HIDE_DRAFT_API
// Default constructor cannot have #ifndef U_HIDE_DRAFT_API
/**
* Default constructor; makes an empty FormattedNumber.
* @draft ICU 64
*/
FormattedNumber()
: fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
#endif
/**
* Move constructor: Leaves the source FormattedNumber in an undefined state.
* @stable ICU 62
@ -2466,11 +2466,11 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
*/
Appendable &appendTo(Appendable& appendable, UErrorCode& status) const U_OVERRIDE;
#ifndef U_HIDE_DRAFT_API
// Copydoc: this method is new in ICU 64
/** @copydoc FormattedValue::nextPosition() */
UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const U_OVERRIDE;
#ifndef U_HIDE_DRAFT_API
/**
* Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
* <em>field</em> in the output string. This allows you to determine the locations of, for example,
@ -2522,7 +2522,9 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
* @see UNumberFormatFields
*/
void getAllFieldPositions(FieldPositionIterator &iterator, UErrorCode &status) const;
#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
* Export the formatted number as a "numeric string" conforming to the
* syntax defined in the Decimal Arithmetic Specification, available at

View file

@ -449,6 +449,7 @@ 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.
@ -470,6 +471,7 @@ class U_I18N_API NumberRangeFormatterSettings {
* @draft ICU 64
*/
LocalPointer<Derived> clone() &&;
#endif /* U_HIDE_DRAFT_API */
/**
* Sets the UErrorCode if an error occurred in the fluent chain.
@ -654,7 +656,7 @@ class U_I18N_API LocalizedNumberRangeFormatter
void formatImpl(impl::UFormattedNumberRangeData& results, bool equalBeforeRounding,
UErrorCode& status) const;
#endif
#endif /* U_HIDE_INTERNAL_API */
/**
* Destruct this LocalizedNumberRangeFormatter, cleaning up any memory it might own.
@ -721,11 +723,11 @@ class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue {
*/
Appendable &appendTo(Appendable &appendable, UErrorCode& status) const U_OVERRIDE;
#ifndef U_HIDE_DRAFT_API
// Copydoc: this method is new in ICU 64
/** @copydoc FormattedValue::nextPosition() */
UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const U_OVERRIDE;
#ifndef U_HIDE_DRAFT_API
/**
* Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
* <em>field</em> in the output string. This allows you to determine the locations of, for example,
@ -855,7 +857,6 @@ class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue {
/**
* Internal constructor from data type. Adopts the data pointer.
* @internal
*/
explicit FormattedNumberRange(impl::UFormattedNumberRangeData *results)
: fData(results), fErrorCode(U_ZERO_ERROR) {}

View file

@ -524,7 +524,7 @@ public:
private:
/**
* @internal
* @internal (private)
*/
class U_I18N_API PluralSelector : public UMemory {
public:
@ -536,14 +536,11 @@ private:
* @param number The number to be plural-formatted.
* @param ec Error code.
* @return The selected PluralFormat keyword.
* @internal
* @internal (private)
*/
virtual UnicodeString select(void *context, double number, UErrorCode& ec) const = 0;
};
/**
* @internal
*/
class U_I18N_API PluralSelectorAdapter : public PluralSelector {
public:
PluralSelectorAdapter() : pluralRules(NULL) {
@ -551,7 +548,7 @@ private:
virtual ~PluralSelectorAdapter();
virtual UnicodeString select(void *context, double number, UErrorCode& /*ec*/) const; /**< @internal */
virtual UnicodeString select(void *context, double number, UErrorCode& /*ec*/) const;
void reset();
@ -575,7 +572,7 @@ private:
UnicodeString& format(const Formattable& numberObject, double number,
UnicodeString& appendTo,
FieldPosition& pos,
UErrorCode& status) const; /**< @internal */
UErrorCode& status) const;
/**
* Finds the PluralFormat sub-message for the given number, or the "other" sub-message.

View file

@ -41,7 +41,9 @@ struct UFormattedList;
* @draft 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.