ICU 65.1  65.1
numberrangeformatter.h
Go to the documentation of this file.
1 // © 2018 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 
4 #ifndef __NUMBERRANGEFORMATTER_H__
5 #define __NUMBERRANGEFORMATTER_H__
6 
7 #include "unicode/utypes.h"
8 
9 #if U_SHOW_CPLUSPLUS_API
10 
11 #if !UCONFIG_NO_FORMATTING
12 
13 #include <atomic>
14 #include "unicode/appendable.h"
15 #include "unicode/fieldpos.h"
16 #include "unicode/formattedvalue.h"
17 #include "unicode/fpositer.h"
19 
52 typedef enum UNumberRangeCollapse {
62 
69 
77 
86 
101 
109 
117 
126 
142 
150 
158 
159 #ifndef U_HIDE_INTERNAL_API
160 
165 #endif
166 
168 
169 U_NAMESPACE_BEGIN
170 
171 namespace number { // icu::number
172 
173 // Forward declarations:
174 class UnlocalizedNumberRangeFormatter;
175 class LocalizedNumberRangeFormatter;
176 class FormattedNumberRange;
177 
178 namespace impl {
179 
180 // Forward declarations:
181 struct RangeMacroProps;
182 class DecimalQuantity;
183 class UFormattedNumberRangeData;
184 class NumberRangeFormatterImpl;
185 
186 } // namespace impl
187 
193 #if U_PLATFORM == U_PF_WINDOWS && !defined(U_IN_DOXYGEN)
194 } // namespace icu::number
195 U_NAMESPACE_END
196 
197 template struct U_I18N_API std::atomic< U_NAMESPACE_QUALIFIER number::impl::NumberRangeFormatterImpl*>;
198 
199 U_NAMESPACE_BEGIN
200 namespace number { // icu::number
201 #endif
202 
204 // Other helper classes would go here, but there are none.
205 
206 namespace impl { // icu::number::impl
207 
208 // Do not enclose entire MacroProps with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
212  UnlocalizedNumberFormatter formatter1; // = NumberFormatter::with();
213 
215  UnlocalizedNumberFormatter formatter2; // = NumberFormatter::with();
216 
218  bool singleFormatter = true;
219 
222 
225 
228 
229  // NOTE: Uses default copy and move constructors.
230 
235  bool copyErrorTo(UErrorCode &status) const {
236  return formatter1.copyErrorTo(status) || formatter2.copyErrorTo(status);
237  }
238 };
239 
240 } // namespace impl
241 
247 template<typename Derived>
249  public:
262  Derived numberFormatterBoth(const UnlocalizedNumberFormatter &formatter) const &;
263 
273  Derived numberFormatterBoth(const UnlocalizedNumberFormatter &formatter) &&;
274 
284  Derived numberFormatterBoth(UnlocalizedNumberFormatter &&formatter) const &;
285 
296 
308  Derived numberFormatterFirst(const UnlocalizedNumberFormatter &formatterFirst) const &;
309 
319  Derived numberFormatterFirst(const UnlocalizedNumberFormatter &formatterFirst) &&;
320 
330  Derived numberFormatterFirst(UnlocalizedNumberFormatter &&formatterFirst) const &;
331 
341  Derived numberFormatterFirst(UnlocalizedNumberFormatter &&formatterFirst) &&;
342 
354  Derived numberFormatterSecond(const UnlocalizedNumberFormatter &formatterSecond) const &;
355 
365  Derived numberFormatterSecond(const UnlocalizedNumberFormatter &formatterSecond) &&;
366 
376  Derived numberFormatterSecond(UnlocalizedNumberFormatter &&formatterSecond) const &;
377 
387  Derived numberFormatterSecond(UnlocalizedNumberFormatter &&formatterSecond) &&;
388 
406  Derived collapse(UNumberRangeCollapse collapse) const &;
407 
417  Derived collapse(UNumberRangeCollapse collapse) &&;
418 
439  Derived identityFallback(UNumberRangeIdentityFallback identityFallback) const &;
440 
450  Derived identityFallback(UNumberRangeIdentityFallback identityFallback) &&;
451 
452 #ifndef U_HIDE_DRAFT_API
453 
465 
473  LocalPointer<Derived> clone() &&;
474 #endif /* U_HIDE_DRAFT_API */
475 
482  UBool copyErrorTo(UErrorCode &outErrorCode) const {
483  if (U_FAILURE(outErrorCode)) {
484  // Do not overwrite the older error code
485  return TRUE;
486  }
487  fMacros.copyErrorTo(outErrorCode);
488  return U_FAILURE(outErrorCode);
489  }
490 
491  // NOTE: Uses default copy and move constructors.
492 
493  private:
494  impl::RangeMacroProps fMacros;
495 
496  // Don't construct me directly! Use (Un)LocalizedNumberFormatter.
497  NumberRangeFormatterSettings() = default;
498 
499  friend class LocalizedNumberRangeFormatter;
500  friend class UnlocalizedNumberRangeFormatter;
501 };
502 
513 
514  public:
525 
536 
543 
549 
556 
562 
569 
570  private:
573 
576 
577  // To give the fluent setters access to this class's constructor:
579 
580  // To give NumberRangeFormatter::with() access to this class's constructor:
581  friend class NumberRangeFormatter;
582 };
583 
594  public:
609  const Formattable& first, const Formattable& second, UErrorCode& status) const;
610 
617 
623 
630 
636 
643 
644 #ifndef U_HIDE_INTERNAL_API
645 
656  void formatImpl(impl::UFormattedNumberRangeData& results, bool equalBeforeRounding,
657  UErrorCode& status) const;
658 
659 #endif /* U_HIDE_INTERNAL_API */
660 
666 
667  private:
668  std::atomic<impl::NumberRangeFormatterImpl*> fAtomicFormatter = {};
669 
670  const impl::NumberRangeFormatterImpl* getFormatter(UErrorCode& stauts) const;
671 
674 
677 
678  LocalizedNumberRangeFormatter(const impl::RangeMacroProps &macros, const Locale &locale);
679 
681 
682  void clear();
683 
684  // To give the fluent setters access to this class's constructor:
687 
688  // To give UnlocalizedNumberRangeFormatter::locale() access to this class's constructor:
689  friend class UnlocalizedNumberRangeFormatter;
690 };
691 
701  public:
702  // Copybrief: this method is older than the parent method
711 
712  // Copydoc: this method is new in ICU 64
715 
716  // Copybrief: this method is older than the parent method
724  Appendable &appendTo(Appendable &appendable, UErrorCode& status) const U_OVERRIDE;
725 
726  // Copydoc: this method is new in ICU 64
729 
730 #ifndef U_HIDE_DRAFT_API
731 
760  UBool nextFieldPosition(FieldPosition& fieldPosition, UErrorCode& status) const;
761 
775  void getAllFieldPositions(FieldPositionIterator &iterator, UErrorCode &status) const;
776 
792 
808 #endif // U_HIDE_DRAFT_API
809 
820 
825 
830 
837 
844 
850 
851  private:
852  // Can't use LocalPointer because UFormattedNumberRangeData is forward-declared
853  const impl::UFormattedNumberRangeData *fData;
854 
855  // Error code for the terminal methods
856  UErrorCode fErrorCode;
857 
861  explicit FormattedNumberRange(impl::UFormattedNumberRangeData *results)
862  : fData(results), fErrorCode(U_ZERO_ERROR) {}
863 
864  explicit FormattedNumberRange(UErrorCode errorCode)
865  : fData(nullptr), fErrorCode(errorCode) {}
866 
867  void getAllFieldPositionsImpl(FieldPositionIteratorHandler& fpih, UErrorCode& status) const;
868 
869  // To give LocalizedNumberRangeFormatter format methods access to this class's constructor:
870  friend class LocalizedNumberRangeFormatter;
871 };
872 
879  public:
888 
899 
904 };
905 
906 } // namespace number
907 U_NAMESPACE_END
908 
909 #endif /* #if !UCONFIG_NO_FORMATTING */
910 
911 #endif /* U_SHOW_CPLUSPLUS_API */
912 
913 #endif // __NUMBERRANGEFORMATTER_H__
914 
icu::number::FormattedNumberRange::getSecondDecimal
UnicodeString getSecondDecimal(UErrorCode &status) const
Export the second formatted number as a decimal number.
UNUM_IDENTITY_RESULT_NOT_EQUAL
@ UNUM_IDENTITY_RESULT_NOT_EQUAL
Used to indicate that the two numbers in the range were not equal, even after rounding rules were app...
Definition: numberrangeformatter.h:157
icu::number::UnlocalizedNumberRangeFormatter::locale
LocalizedNumberRangeFormatter locale(const icu::Locale &locale) &&
Overload of locale() for use on an rvalue reference.
icu::FieldPosition
FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted out...
Definition: fieldpos.h:110
fpositer.h
C++ API: FieldPosition Iterator.
icu::number::FormattedNumberRange::FormattedNumberRange
FormattedNumberRange(const FormattedNumberRange &)=delete
Copying not supported; use move constructor instead.
icu::number::LocalizedNumberRangeFormatter::formatFormattableRange
FormattedNumberRange formatFormattableRange(const Formattable &first, const Formattable &second, UErrorCode &status) const
Format the given Formattables to a string using the settings specified in the NumberRangeFormatter fl...
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UNUM_IDENTITY_FALLBACK_APPROXIMATELY
@ UNUM_IDENTITY_FALLBACK_APPROXIMATELY
Show the number using a locale-sensitive approximation pattern.
Definition: numberrangeformatter.h:116
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition: utypes.h:301
icu::number::NumberRangeFormatter::NumberRangeFormatter
NumberRangeFormatter()=delete
Use factory methods instead of the constructor to create a NumberFormatter.
icu::number::FormattedNumberRange::nextPosition
UBool nextPosition(ConstrainedFieldPosition &cfpos, UErrorCode &status) const U_OVERRIDE
Iterates over field positions in the FormattedValue.
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:261
U_NOEXCEPT
#define U_NOEXCEPT
"noexcept" if supported, otherwise empty.
Definition: platform.h:529
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:64
icu::number::UnlocalizedNumberRangeFormatter
A NumberRangeFormatter that does not yet have a locale.
Definition: numberrangeformatter.h:512
icu::FieldPositionIterator
FieldPositionIterator returns the field ids and their start/limit positions generated by a call to Fo...
Definition: fpositer.h:58
icu::FormattedValue
An abstract formatted value: a string with associated field attributes.
Definition: formattedvalue.h:254
icu::number::NumberRangeFormatterSettings::collapse
Derived collapse(UNumberRangeCollapse collapse) &&
Overload of collapse() for use on an rvalue reference.
icu::number::NumberRangeFormatterSettings::numberFormatterFirst
Derived numberFormatterFirst(UnlocalizedNumberFormatter &&formatterFirst) const &
Overload of numberFormatterFirst() for use on an rvalue reference.
icu::number::FormattedNumberRange::~FormattedNumberRange
~FormattedNumberRange()
Destruct an instance of FormattedNumberRange, cleaning up any memory it might own.
icu::number::NumberRangeFormatter::with
static UnlocalizedNumberRangeFormatter with()
Call this method at the beginning of a NumberRangeFormatter fluent chain in which the locale is not c...
icu::number::NumberRangeFormatterSettings::numberFormatterFirst
Derived numberFormatterFirst(UnlocalizedNumberFormatter &&formatterFirst) &&
Overload of numberFormatterFirst() for use on an rvalue reference.
icu::number::impl::RangeMacroProps::locale
Locale locale
Definition: numberrangeformatter.h:227
UNUM_IDENTITY_RESULT_EQUAL_AFTER_ROUNDING
@ UNUM_IDENTITY_RESULT_EQUAL_AFTER_ROUNDING
Used to indicate that the two numbers in the range were equal, but only after rounding rules were app...
Definition: numberrangeformatter.h:149
icu::number::NumberRangeFormatterSettings::identityFallback
Derived identityFallback(UNumberRangeIdentityFallback identityFallback) &&
Overload of identityFallback() for use on an rvalue reference.
icu::number::LocalizedNumberRangeFormatter::operator=
LocalizedNumberRangeFormatter & operator=(LocalizedNumberRangeFormatter &&src) U_NOEXCEPT
Move assignment operator: The source LocalizedNumberRangeFormatter will be left in a valid but undefi...
U_OVERRIDE
#define U_OVERRIDE
Defined to the C++11 "override" keyword if available.
Definition: umachine.h:129
icu::number::FormattedNumberRange::toString
UnicodeString toString(UErrorCode &status) const U_OVERRIDE
Returns the formatted string as a self-contained UnicodeString.
UNumberRangeIdentityResult
UNumberRangeIdentityResult
Used in the result class FormattedNumberRange to indicate to the user whether the numbers formatted i...
Definition: numberrangeformatter.h:134
icu::number::NumberRangeFormatterSettings::collapse
Derived collapse(UNumberRangeCollapse collapse) const &
Sets the aggressiveness of "collapsing" fields across the range separator.
icu::LocalPointer
"Smart pointer" class, deletes objects via the standard C++ delete operator.
Definition: localpointer.h:191
icu::number::UnlocalizedNumberRangeFormatter::operator=
UnlocalizedNumberRangeFormatter & operator=(UnlocalizedNumberRangeFormatter &&src) U_NOEXCEPT
Move assignment operator: The source UnlocalizedNumberRangeFormatter will be left in a valid but unde...
icu::number::NumberRangeFormatterSettings::identityFallback
Derived identityFallback(UNumberRangeIdentityFallback identityFallback) const &
Sets the behavior when the two sides of the range are the same.
icu::number::NumberFormatterSettings::copyErrorTo
UBool copyErrorTo(UErrorCode &outErrorCode) const
Sets the UErrorCode if an error occurred in the fluent chain.
Definition: numberformatter.h:2115
icu::number::LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter
LocalizedNumberRangeFormatter(const LocalizedNumberRangeFormatter &other)
Returns a copy of this LocalizedNumberRangeFormatter.
icu::number::FormattedNumberRange::FormattedNumberRange
FormattedNumberRange(FormattedNumberRange &&src) U_NOEXCEPT
Move constructor: Leaves the source FormattedNumberRange in an undefined state.
icu::number::UnlocalizedNumberRangeFormatter::operator=
UnlocalizedNumberRangeFormatter & operator=(const UnlocalizedNumberRangeFormatter &other)
Copy assignment operator.
icu::number::impl::RangeMacroProps
Definition: numberrangeformatter.h:210
icu::number::NumberRangeFormatterSettings::numberFormatterSecond
Derived numberFormatterSecond(UnlocalizedNumberFormatter &&formatterSecond) &&
Overload of numberFormatterSecond() for use on an rvalue reference.
icu::number::UnlocalizedNumberRangeFormatter::locale
LocalizedNumberRangeFormatter locale(const icu::Locale &locale) const &
Associate the given locale with the number range formatter.
fieldpos.h
C++ API: FieldPosition identifies the fields in a formatted output.
icu::number::NumberRangeFormatterSettings::numberFormatterBoth
Derived numberFormatterBoth(UnlocalizedNumberFormatter &&formatter) const &
Overload of numberFormatterBoth() for use on an rvalue reference.
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:295
icu::number::FormattedNumberRange::operator=
FormattedNumberRange & operator=(FormattedNumberRange &&src) U_NOEXCEPT
Move assignment: Leaves the source FormattedNumberRange in an undefined state.
UNUM_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE
@ UNUM_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE
Show the number using a locale-sensitive approximation pattern.
Definition: numberrangeformatter.h:108
UNUM_IDENTITY_RESULT_EQUAL_BEFORE_ROUNDING
@ UNUM_IDENTITY_RESULT_EQUAL_BEFORE_ROUNDING
Used to indicate that the two numbers in the range were equal, even before any rounding rules were ap...
Definition: numberrangeformatter.h:141
U_FAILURE
#define U_FAILURE(x)
Does the error code indicate a failure?
Definition: utypes.h:709
icu::number::FormattedNumberRange::nextFieldPosition
UBool nextFieldPosition(FieldPosition &fieldPosition, UErrorCode &status) const
Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given fiel...
icu::number::NumberRangeFormatterSettings::numberFormatterSecond
Derived numberFormatterSecond(UnlocalizedNumberFormatter &&formatterSecond) const &
Overload of numberFormatterSecond() for use on an rvalue reference.
UNUM_IDENTITY_FALLBACK_RANGE
@ UNUM_IDENTITY_FALLBACK_RANGE
Show the number as the range of two equal values.
Definition: numberrangeformatter.h:124
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
icu::number::NumberRangeFormatterSettings::numberFormatterBoth
Derived numberFormatterBoth(const UnlocalizedNumberFormatter &formatter) const &
Sets the NumberFormatter instance to use for the numbers in the range.
icu::number::UnlocalizedNumberRangeFormatter::UnlocalizedNumberRangeFormatter
UnlocalizedNumberRangeFormatter()=default
Default constructor: puts the formatter into a valid but undefined state.
icu::number::FormattedNumberRange
The result of a number range formatting operation.
Definition: numberrangeformatter.h:700
TRUE
#define TRUE
The TRUE value of a UBool.
Definition: umachine.h:265
icu::number::UnlocalizedNumberFormatter
A NumberFormatter that does not yet have a locale.
Definition: numberformatter.h:2149
icu::UMemory
UMemory is the common ICU base class.
Definition: uobject.h:115
icu::number::NumberRangeFormatterSettings
An abstract base class for specifying settings related to number formatting.
Definition: numberrangeformatter.h:248
icu::number::FormattedNumberRange::toTempString
UnicodeString toTempString(UErrorCode &status) const U_OVERRIDE
Returns the formatted string as a read-only alias to memory owned by the FormattedValue.
icu::number::LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter
LocalizedNumberRangeFormatter()=default
Default constructor: puts the formatter into a valid but undefined state.
icu::number::FormattedNumberRange::getFirstDecimal
UnicodeString getFirstDecimal(UErrorCode &status) const
Export the first formatted number as a decimal number.
UNUM_IDENTITY_RESULT_COUNT
@ UNUM_IDENTITY_RESULT_COUNT
The number of entries in this enum.
Definition: numberrangeformatter.h:164
icu::number::FormattedNumberRange::getIdentityResult
UNumberRangeIdentityResult getIdentityResult(UErrorCode &status) const
Returns whether the pair of numbers was successfully formatted as a range or whether an identity fall...
icu::number::NumberRangeFormatterSettings::numberFormatterSecond
Derived numberFormatterSecond(const UnlocalizedNumberFormatter &formatterSecond) &&
Overload of numberFormatterSecond() for use on an rvalue reference.
U_ZERO_ERROR
@ U_ZERO_ERROR
No error, no warning.
Definition: utypes.h:449
appendable.h
C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (char16_ts).
UNUM_RANGE_COLLAPSE_UNIT
@ UNUM_RANGE_COLLAPSE_UNIT
Collapse the unit part of the number, but not the notation, if present.
Definition: numberrangeformatter.h:76
icu::number::LocalizedNumberRangeFormatter::operator=
LocalizedNumberRangeFormatter & operator=(const LocalizedNumberRangeFormatter &other)
Copy assignment operator.
icu::number::NumberRangeFormatterSettings::numberFormatterFirst
Derived numberFormatterFirst(const UnlocalizedNumberFormatter &formatterFirst) const &
Sets the NumberFormatter instance to use for the first number in the range.
icu::number::UnlocalizedNumberRangeFormatter::UnlocalizedNumberRangeFormatter
UnlocalizedNumberRangeFormatter(const UnlocalizedNumberRangeFormatter &other)
Returns a copy of this UnlocalizedNumberRangeFormatter.
icu::number::impl::RangeMacroProps::formatter2
UnlocalizedNumberFormatter formatter2
Definition: numberrangeformatter.h:215
formattedvalue.h
C++ API: Abstract operations for localized strings.
icu::number::NumberRangeFormatterSettings::numberFormatterFirst
Derived numberFormatterFirst(const UnlocalizedNumberFormatter &formatterFirst) &&
Overload of numberFormatterFirst() for use on an rvalue reference.
icu::Appendable
Base class for objects to which Unicode characters and strings can be appended.
Definition: appendable.h:54
icu::number::FormattedNumberRange::appendTo
Appendable & appendTo(Appendable &appendable, UErrorCode &status) const U_OVERRIDE
Appends the formatted string to an Appendable.
icu::number::NumberRangeFormatterSettings::copyErrorTo
UBool copyErrorTo(UErrorCode &outErrorCode) const
Sets the UErrorCode if an error occurred in the fluent chain.
Definition: numberrangeformatter.h:482
numberformatter.h
C++ API: Library for localized number formatting introduced in ICU 60.
icu::number::FormattedNumberRange::operator=
FormattedNumberRange & operator=(const FormattedNumberRange &)=delete
Copying not supported; use move assignment instead.
icu::number::LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter
LocalizedNumberRangeFormatter(LocalizedNumberRangeFormatter &&src) U_NOEXCEPT
Move constructor: The source LocalizedNumberRangeFormatter will be left in a valid but undefined stat...
icu::number::NumberRangeFormatter
See the main description in numberrangeformatter.h for documentation and examples.
Definition: numberrangeformatter.h:878
icu::number::UnlocalizedNumberRangeFormatter::UnlocalizedNumberRangeFormatter
UnlocalizedNumberRangeFormatter(UnlocalizedNumberRangeFormatter &&src) U_NOEXCEPT
Move constructor: The source UnlocalizedNumberRangeFormatter will be left in a valid but undefined st...
UNUM_RANGE_COLLAPSE_AUTO
@ UNUM_RANGE_COLLAPSE_AUTO
Use locale data and heuristics to determine how much of the string to collapse.
Definition: numberrangeformatter.h:61
icu::number::LocalizedNumberRangeFormatter::~LocalizedNumberRangeFormatter
~LocalizedNumberRangeFormatter()
Destruct this LocalizedNumberRangeFormatter, cleaning up any memory it might own.
UNUM_IDENTITY_FALLBACK_SINGLE_VALUE
@ UNUM_IDENTITY_FALLBACK_SINGLE_VALUE
Show the number as a single value rather than a range.
Definition: numberrangeformatter.h:100
icu::number::LocalizedNumberRangeFormatter
A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are av...
Definition: numberrangeformatter.h:593
icu::number::impl::RangeMacroProps::formatter1
UnlocalizedNumberFormatter formatter1
Definition: numberrangeformatter.h:212
UNUM_RANGE_COLLAPSE_ALL
@ UNUM_RANGE_COLLAPSE_ALL
Collapse any field that is equal across the range sign.
Definition: numberrangeformatter.h:84
icu::number::NumberRangeFormatterSettings::clone
LocalPointer< Derived > clone() const &
Returns the current (Un)LocalizedNumberRangeFormatter as a LocalPointer wrapping a heap-allocated cop...
icu::number::NumberRangeFormatterSettings::numberFormatterBoth
Derived numberFormatterBoth(const UnlocalizedNumberFormatter &formatter) &&
Overload of numberFormatterBoth() for use on an rvalue reference.
UNumberRangeCollapse
UNumberRangeCollapse
Defines how to merge fields that are identical across the range sign.
Definition: numberrangeformatter.h:52
icu::number::NumberRangeFormatterSettings::numberFormatterSecond
Derived numberFormatterSecond(const UnlocalizedNumberFormatter &formatterSecond) const &
Sets the NumberFormatter instance to use for the second number in the range.
icu::number::NumberRangeFormatterSettings::numberFormatterBoth
Derived numberFormatterBoth(UnlocalizedNumberFormatter &&formatter) &&
Overload of numberFormatterBoth() for use on an rvalue reference.
icu::number::LocalizedNumberRangeFormatter::formatImpl
void formatImpl(impl::UFormattedNumberRangeData &results, bool equalBeforeRounding, UErrorCode &status) const
UNUM_RANGE_COLLAPSE_NONE
@ UNUM_RANGE_COLLAPSE_NONE
Do not collapse any part of the number.
Definition: numberrangeformatter.h:68
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:195
icu::number::impl::RangeMacroProps::copyErrorTo
bool copyErrorTo(UErrorCode &status) const
Check all members for errors.
Definition: numberrangeformatter.h:235
UNumberRangeIdentityFallback
UNumberRangeIdentityFallback
Defines the behavior when the two numbers in the range are identical after rounding.
Definition: numberrangeformatter.h:94
icu::ConstrainedFieldPosition
Represents a span of a string containing a given field.
Definition: formattedvalue.h:46
icu::number::NumberRangeFormatter::withLocale
static LocalizedNumberRangeFormatter withLocale(const Locale &locale)
Call this method at the beginning of a NumberRangeFormatter fluent chain in which the locale is known...
icu::number::FormattedNumberRange::getAllFieldPositions
void getAllFieldPositions(FieldPositionIterator &iterator, UErrorCode &status) const
Export the formatted number range to a FieldPositionIterator.