Go to the documentation of this file.
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;
76 #if U_PLATFORM == U_PF_WINDOWS && !defined(U_IN_DOXYGEN)
80 template struct U_I18N_API std::atomic< U_NAMESPACE_QUALIFIER number::impl::NumberRangeFormatterImpl*>;
101 bool singleFormatter =
true;
130 template<
typename Derived>
368 fMacros.copyErrorTo(outErrorCode);
525 #ifndef U_HIDE_INTERNAL_API
537 void formatImpl(impl::UFormattedNumberRangeData& results,
bool equalBeforeRounding,
549 std::atomic<impl::NumberRangeFormatterImpl*> fAtomicFormatter = {};
551 const impl::NumberRangeFormatterImpl* getFormatter(
UErrorCode& stauts)
const;
611 #ifndef U_HIDE_DEPRECATED_API
651 #endif // U_HIDE_DEPRECATED_API
654 #ifndef U_HIDE_DRAFT_API
674 template<
typename StringClass>
675 inline std::pair<StringClass, StringClass> getDecimalNumbers(
UErrorCode& status)
const;
676 #endif // U_HIDE_DRAFT_API
721 const impl::UFormattedNumberRangeData *fData;
733 : fData(
nullptr), fErrorCode(errorCode) {}
735 void getAllFieldPositionsImpl(FieldPositionIteratorHandler& fpih,
UErrorCode& status)
const;
739 const impl::UFormattedNumberRangeData* getData(
UErrorCode& status)
const;
742 friend class ::icu::PluralRules;
748 friend struct impl::UFormattedNumberRangeImpl;
751 #ifndef U_HIDE_DRAFT_API
753 template<
typename StringClass>
754 std::pair<StringClass, StringClass> FormattedNumberRange::getDecimalNumbers(
UErrorCode& status)
const {
759 getDecimalNumbers(sink1, sink2, status);
760 return std::make_pair(str1, str2);
762 #endif // U_HIDE_DRAFT_API
804 #endif // __NUMBERRANGEFORMATTER_H__
C++ API: FieldPosition Iterator.
Basic definitions for ICU, for both C and C++ APIs.
int8_t UBool
The ICU boolean type, a signed-byte integer.
"Smart pointer" class, deletes objects via the standard C++ delete operator.
C++ API: FieldPosition identifies the fields in a formatted output.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
#define U_FAILURE(x)
Does the error code indicate a failure?
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
A ByteSink can be filled with bytes.
UMemory is the common ICU base class.
@ U_ZERO_ERROR
No error, no warning.
C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (char16_ts).
UnlocalizedNumberFormatter formatter2
Base class for objects to which Unicode characters and strings can be appended.
Implementation of ByteSink that writes to a "string".
UnlocalizedNumberFormatter formatter1
A Locale object represents a specific geographical, political, or cultural region.
bool copyErrorTo(UErrorCode &status) const
Check all members for errors.
Represents a span of a string containing a given field.