ICU 75.1 75.1
Loading...
Searching...
No Matches
Public Member Functions
icu::message2::FormattedValue Class Reference

A FormattedValue represents the result of formatting a message2::Formattable. More...

#include <messageformat2_formattable.h>

Inheritance diagram for icu::message2::FormattedValue:
icu::UObject icu::UMemory

Public Member Functions

 FormattedValue (const UnicodeString &)
 Formatted string constructor.
 
 FormattedValue (number::FormattedNumber &&)
 Formatted number constructor.
 
 FormattedValue ()
 Default constructor.
 
bool isString () const
 Returns true iff this is a formatted string.
 
bool isNumber () const
 Returns true iff this is a formatted number.
 
const UnicodeStringgetString () const
 Gets the string contents of this value.
 
const number::FormattedNumbergetNumber () const
 Gets the number contents of this value.
 
FormattedValueoperator= (FormattedValue &&) noexcept
 Move assignment operator: The source FormattedValue will be left in a valid but undefined state.
 
 FormattedValue (FormattedValue &&other)
 Move constructor: The source FormattedValue will be left in a valid but undefined state.
 
virtual ~FormattedValue ()
 Destructor.
 
- Public Member Functions inherited from icu::UObject
virtual ~UObject ()
 Destructor.
 
virtual UClassID getDynamicClassID () const
 ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
 

Detailed Description

A FormattedValue represents the result of formatting a message2::Formattable.

It contains either a string or a formatted number. (More types could be added in the future.)

FormattedValue is immutable and movable. It is not copyable.

Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 586 of file messageformat2_formattable.h.

Constructor & Destructor Documentation

◆ FormattedValue() [1/4]

icu::message2::FormattedValue::FormattedValue ( const UnicodeString )
explicit

Formatted string constructor.

Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

◆ FormattedValue() [2/4]

icu::message2::FormattedValue::FormattedValue ( number::FormattedNumber &&  )
explicit

Formatted number constructor.

Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

◆ FormattedValue() [3/4]

icu::message2::FormattedValue::FormattedValue ( )
inline

Default constructor.

Leaves the FormattedValue in a valid but undefined state.

Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 606 of file messageformat2_formattable.h.

◆ FormattedValue() [4/4]

icu::message2::FormattedValue::FormattedValue ( FormattedValue &&  other)
inline

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

Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 656 of file messageformat2_formattable.h.

◆ ~FormattedValue()

virtual icu::message2::FormattedValue::~FormattedValue ( )
virtual

Destructor.

Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Member Function Documentation

◆ getNumber()

const number::FormattedNumber & icu::message2::FormattedValue::getNumber ( ) const
inline

Gets the number contents of this value.

If !isNumber(), then the result is undefined.

Returns
A reference to a formatted number.
Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 640 of file messageformat2_formattable.h.

◆ getString()

const UnicodeString & icu::message2::FormattedValue::getString ( ) const
inline

Gets the string contents of this value.

If !isString(), then the result is undefined.

Returns
A reference to a formatted string.
Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 632 of file messageformat2_formattable.h.

◆ isNumber()

bool icu::message2::FormattedValue::isNumber ( ) const
inline

Returns true iff this is a formatted number.

Returns
True if and only if this value is a formatted number.
Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 624 of file messageformat2_formattable.h.

◆ isString()

bool icu::message2::FormattedValue::isString ( ) const
inline

Returns true iff this is a formatted string.

Returns
True if and only if this value is a formatted string.
Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 615 of file messageformat2_formattable.h.

◆ operator=()

FormattedValue & icu::message2::FormattedValue::operator= ( FormattedValue &&  )
noexcept

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

Internal:
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated:
This API is for technology preview only.

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