ICU 65.1
65.1
|
A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available. More...
#include <numberrangeformatter.h>
Public Member Functions | |
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 fluent setting chain. More... | |
LocalizedNumberRangeFormatter ()=default | |
Default constructor: puts the formatter into a valid but undefined state. More... | |
LocalizedNumberRangeFormatter (const LocalizedNumberRangeFormatter &other) | |
Returns a copy of this LocalizedNumberRangeFormatter. More... | |
LocalizedNumberRangeFormatter (LocalizedNumberRangeFormatter &&src) U_NOEXCEPT | |
Move constructor: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state. More... | |
LocalizedNumberRangeFormatter & | operator= (const LocalizedNumberRangeFormatter &other) |
Copy assignment operator. More... | |
LocalizedNumberRangeFormatter & | operator= (LocalizedNumberRangeFormatter &&src) U_NOEXCEPT |
Move assignment operator: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state. More... | |
void | formatImpl (impl::UFormattedNumberRangeData &results, bool equalBeforeRounding, UErrorCode &status) const |
~LocalizedNumberRangeFormatter () | |
Destruct this LocalizedNumberRangeFormatter, cleaning up any memory it might own. More... | |
Public Member Functions inherited from icu::number::NumberRangeFormatterSettings< Derived > | |
Derived | numberFormatterBoth (const UnlocalizedNumberFormatter &formatter) const & |
Sets the NumberFormatter instance to use for the numbers in the range. More... | |
Derived | numberFormatterBoth (const UnlocalizedNumberFormatter &formatter) && |
Overload of numberFormatterBoth() for use on an rvalue reference. More... | |
Derived | numberFormatterBoth (UnlocalizedNumberFormatter &&formatter) const & |
Overload of numberFormatterBoth() for use on an rvalue reference. More... | |
Derived | numberFormatterBoth (UnlocalizedNumberFormatter &&formatter) && |
Overload of numberFormatterBoth() for use on an rvalue reference. More... | |
Derived | numberFormatterFirst (const UnlocalizedNumberFormatter &formatterFirst) const & |
Sets the NumberFormatter instance to use for the first number in the range. More... | |
Derived | numberFormatterFirst (const UnlocalizedNumberFormatter &formatterFirst) && |
Overload of numberFormatterFirst() for use on an rvalue reference. More... | |
Derived | numberFormatterFirst (UnlocalizedNumberFormatter &&formatterFirst) const & |
Overload of numberFormatterFirst() for use on an rvalue reference. More... | |
Derived | numberFormatterFirst (UnlocalizedNumberFormatter &&formatterFirst) && |
Overload of numberFormatterFirst() for use on an rvalue reference. More... | |
Derived | numberFormatterSecond (const UnlocalizedNumberFormatter &formatterSecond) const & |
Sets the NumberFormatter instance to use for the second number in the range. More... | |
Derived | numberFormatterSecond (const UnlocalizedNumberFormatter &formatterSecond) && |
Overload of numberFormatterSecond() for use on an rvalue reference. More... | |
Derived | numberFormatterSecond (UnlocalizedNumberFormatter &&formatterSecond) const & |
Overload of numberFormatterSecond() for use on an rvalue reference. More... | |
Derived | numberFormatterSecond (UnlocalizedNumberFormatter &&formatterSecond) && |
Overload of numberFormatterSecond() for use on an rvalue reference. More... | |
Derived | collapse (UNumberRangeCollapse collapse) const & |
Sets the aggressiveness of "collapsing" fields across the range separator. More... | |
Derived | collapse (UNumberRangeCollapse collapse) && |
Overload of collapse() for use on an rvalue reference. More... | |
Derived | identityFallback (UNumberRangeIdentityFallback identityFallback) const & |
Sets the behavior when the two sides of the range are the same. More... | |
Derived | identityFallback (UNumberRangeIdentityFallback identityFallback) && |
Overload of identityFallback() for use on an rvalue reference. More... | |
LocalPointer< Derived > | clone () const & |
Returns the current (Un)LocalizedNumberRangeFormatter as a LocalPointer wrapping a heap-allocated copy of the current object. More... | |
LocalPointer< Derived > | clone () && |
Overload of clone for use on an rvalue reference. More... | |
UBool | copyErrorTo (UErrorCode &outErrorCode) const |
Sets the UErrorCode if an error occurred in the fluent chain. More... | |
Friends | |
class | NumberRangeFormatterSettings< UnlocalizedNumberRangeFormatter > |
class | NumberRangeFormatterSettings< LocalizedNumberRangeFormatter > |
class | UnlocalizedNumberRangeFormatter |
A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available.
Instances of this class are immutable and thread-safe.
Definition at line 592 of file numberrangeformatter.h.
|
default |
Default constructor: puts the formatter into a valid but undefined state.
icu::number::LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter | ( | const LocalizedNumberRangeFormatter & | other | ) |
Returns a copy of this LocalizedNumberRangeFormatter.
icu::number::LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter | ( | LocalizedNumberRangeFormatter && | src | ) |
Move constructor: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state.
icu::number::LocalizedNumberRangeFormatter::~LocalizedNumberRangeFormatter | ( | ) |
Destruct this LocalizedNumberRangeFormatter, cleaning up any memory it might own.
FormattedNumberRange icu::number::LocalizedNumberRangeFormatter::formatFormattableRange | ( | const Formattable & | first, |
const Formattable & | second, | ||
UErrorCode & | status | ||
) | const |
Format the given Formattables to a string using the settings specified in the NumberRangeFormatter fluent setting chain.
first | The first number in the range, usually to the left in LTR locales. |
second | The second number in the range, usually to the right in LTR locales. |
status | Set if an error occurs while formatting. |
void icu::number::LocalizedNumberRangeFormatter::formatImpl | ( | impl::UFormattedNumberRangeData & | results, |
bool | equalBeforeRounding, | ||
UErrorCode & | status | ||
) | const |
results | The results object. This method will mutate it to save the results. |
equalBeforeRounding | Whether the number was equal before copying it into a DecimalQuantity. Used for determining the identity fallback behavior. |
status | Set if an error occurs while formatting. |
LocalizedNumberRangeFormatter& icu::number::LocalizedNumberRangeFormatter::operator= | ( | const LocalizedNumberRangeFormatter & | other | ) |
Copy assignment operator.
LocalizedNumberRangeFormatter& icu::number::LocalizedNumberRangeFormatter::operator= | ( | LocalizedNumberRangeFormatter && | src | ) |
Move assignment operator: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state.