4 #ifndef __NUMBERRANGEFORMATTER_H__ 5 #define __NUMBERRANGEFORMATTER_H__ 9 #if U_SHOW_CPLUSPLUS_API 11 #if !UCONFIG_NO_FORMATTING 56 class UnlocalizedNumberRangeFormatter;
57 class LocalizedNumberRangeFormatter;
58 class FormattedNumberRange;
63 struct RangeMacroProps;
64 class DecimalQuantity;
65 class UFormattedNumberRangeData;
66 class NumberRangeFormatterImpl;
67 struct UFormattedNumberRangeImpl;
85 bool singleFormatter =
true;
114 template<
typename Derived>
352 fMacros.copyErrorTo(outErrorCode);
371 extern template class NumberRangeFormatterSettings<UnlocalizedNumberRangeFormatter>;
372 extern template class NumberRangeFormatterSettings<LocalizedNumberRangeFormatter>;
540 #ifndef U_HIDE_INTERNAL_API 552 U_I18N_API void formatImpl(impl::UFormattedNumberRangeData &results,
bool equalBeforeRounding,
564 std::atomic<impl::NumberRangeFormatterImpl*> fAtomicFormatter = {};
566 const impl::NumberRangeFormatterImpl* getFormatter(
UErrorCode& stauts)
const;
643 template<
typename StringClass>
644 inline std::pair<StringClass, StringClass> getDecimalNumbers(
UErrorCode& status)
const;
696 const impl::UFormattedNumberRangeData *fData;
707 explicit FormattedNumberRange(
UErrorCode errorCode)
708 : fData(nullptr), fErrorCode(errorCode) {}
710 void getDecimalNumbers(ByteSink& sink1, ByteSink& sink2,
UErrorCode& status)
const;
712 const impl::UFormattedNumberRangeData* getData(
UErrorCode& status)
const;
715 friend class ::icu::PluralRules;
718 friend class LocalizedNumberRangeFormatter;
721 friend struct impl::UFormattedNumberRangeImpl;
725 template<
typename StringClass>
726 std::pair<StringClass, StringClass> FormattedNumberRange::getDecimalNumbers(
UErrorCode& status)
const {
731 getDecimalNumbers(sink1, sink2, status);
732 return std::make_pair(str1, str2);
775 #endif // __NUMBERRANGEFORMATTER_H__
#define U_FAILURE(x)
Does the error code indicate a failure?
C++ API: FieldPosition Iterator.
"Smart pointer" class, deletes objects via the standard C++ delete operator.
C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (char16_ts).
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
C++ API: FieldPosition identifies the fields in a formatted output.
#define U_I18N_API_CLASS
Set to export library symbols from inside the i18n library, and to import them from outside...
Represents a span of a string containing a given field.
UnlocalizedNumberFormatter formatter2
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
UnlocalizedNumberFormatter formatter1
Basic definitions for ICU, for both C and C++ APIs.
Implementation of ByteSink that writes to a "string".
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UMemory is the common ICU base class.
Requested operation can not be completed with ICU in its current state.
bool copyErrorTo(UErrorCode &status) const
Check all members for errors.
int8_t UBool
The ICU boolean type, a signed-byte integer.
Base class for objects to which Unicode characters and strings can be appended.
A Locale object represents a specific geographical, political, or cultural region.