ICU 73.2  73.2
Public Member Functions | Friends
icu::number::LocalizedNumberRangeFormatter Class Reference

A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available. More...

#include <numberrangeformatter.h>

Inheritance diagram for icu::number::LocalizedNumberRangeFormatter:
icu::number::NumberRangeFormatterSettings< Derived > icu::UMemory

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.
 LocalizedNumberRangeFormatter ()
 Default constructor: puts the formatter into a valid but undefined state.
 LocalizedNumberRangeFormatter (const LocalizedNumberRangeFormatter &other)
 Returns a copy of this LocalizedNumberRangeFormatter.
 LocalizedNumberRangeFormatter (LocalizedNumberRangeFormatter &&src) noexcept
 Move constructor: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state.
LocalizedNumberRangeFormatteroperator= (const LocalizedNumberRangeFormatter &other)
 Copy assignment operator.
LocalizedNumberRangeFormatteroperator= (LocalizedNumberRangeFormatter &&src) noexcept
 Move assignment operator: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state.
void formatImpl (impl::UFormattedNumberRangeData &results, bool equalBeforeRounding, UErrorCode &status) const
 ~LocalizedNumberRangeFormatter ()
 Destruct this LocalizedNumberRangeFormatter, cleaning up any memory it might own.

Friends

class NumberRangeFormatterSettings< UnlocalizedNumberRangeFormatter >
class NumberRangeFormatterSettings< LocalizedNumberRangeFormatter >
class UnlocalizedNumberRangeFormatter

Detailed Description

A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available.

Instances of this class are immutable and thread-safe.

See also:
NumberFormatter
Stable:
ICU 63

Definition at line 480 of file numberrangeformatter.h.


Constructor & Destructor Documentation

Default constructor: puts the formatter into a valid but undefined state.

Stable:
ICU 63

Returns a copy of this LocalizedNumberRangeFormatter.

Stable:
ICU 63

Move constructor: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state.

Stable:
ICU 63

Destruct this LocalizedNumberRangeFormatter, cleaning up any memory it might own.

Stable:
ICU 63

Member Function Documentation

Format the given Formattables to a string using the settings specified in the NumberRangeFormatter fluent setting chain.

Parameters:
firstThe first number in the range, usually to the left in LTR locales.
secondThe second number in the range, usually to the right in LTR locales.
statusSet if an error occurs while formatting.
Returns:
A FormattedNumberRange object; call .toString() to get the string.
Stable:
ICU 63
void icu::number::LocalizedNumberRangeFormatter::formatImpl ( impl::UFormattedNumberRangeData &  results,
bool  equalBeforeRounding,
UErrorCode status 
) const
Parameters:
resultsThe results object. This method will mutate it to save the results.
equalBeforeRoundingWhether the number was equal before copying it into a DecimalQuantity. Used for determining the identity fallback behavior.
statusSet if an error occurs while formatting.
Internal:
Do not use. This API is for internal use only.
LocalizedNumberRangeFormatter& icu::number::LocalizedNumberRangeFormatter::operator= ( const LocalizedNumberRangeFormatter other)

Copy assignment operator.

Stable:
ICU 63
LocalizedNumberRangeFormatter& icu::number::LocalizedNumberRangeFormatter::operator= ( LocalizedNumberRangeFormatter &&  src)

Move assignment operator: The source LocalizedNumberRangeFormatter will be left in a valid but undefined state.

Stable:
ICU 63

The documentation for this class was generated from the following file: