ICU 78.2 78.2
Loading...
Searching...
No Matches
icu::message2::data_model::Operand Class Reference

The Operand class corresponds to the operand nonterminal in the MessageFormat 2 grammar, https://github.com/unicode-org/message-format-wg/blob/main/spec/message.abnf . More...

#include <messageformat2_data_model.h>

Inheritance diagram for icu::message2::data_model::Operand:
icu::UObject icu::UMemory

Public Member Functions

U_I18N_API UBool isVariable () const
 Determines if this operand represents a variable.
U_I18N_API UBool isLiteral () const
 Determines if this operand represents a literal.
virtual U_I18N_API UBool isNull () const
 Determines if this operand is the null operand.
U_I18N_API const UnicodeStringasVariable () const
 Returns a reference to this operand's variable name.
U_I18N_API const LiteralasLiteral () const
 Returns a reference to this operand's literal contents.
U_I18N_API Operand ()
 Default constructor.
U_I18N_API Operand (const UnicodeString &v)
 Variable operand constructor.
U_I18N_API Operand (const Literal &l)
 Literal operand constructor.
virtual U_I18N_API Operandoperator= (Operand) noexcept
 Assignment operator.
U_I18N_API Operand (const Operand &)
 Copy constructor.
virtual U_I18N_API ~Operand ()
 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.

Friends

U_I18N_API friend void swap (Operand &o1, Operand &o2) noexcept
 Non-member swap function.

Detailed Description

The Operand class corresponds to the operand nonterminal in the MessageFormat 2 grammar, https://github.com/unicode-org/message-format-wg/blob/main/spec/message.abnf .

It represents a Literal | VariableRef – see the operand? field of the FunctionRef interface defined at: https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#expressions with the difference that it can also represent a null operand (the absent operand in an annotation with no operand).

Operand is immutable and is copyable and movable.

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 215 of file messageformat2_data_model.h.

Constructor & Destructor Documentation

◆ Operand() [1/4]

U_I18N_API icu::message2::data_model::Operand::Operand ( )
inline

Default constructor.

Creates a null Operand.

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 271 of file messageformat2_data_model.h.

References U_I18N_API.

Referenced by Operand(), operator=(), and swap.

◆ Operand() [2/4]

U_I18N_API icu::message2::data_model::Operand::Operand ( const UnicodeString & v)
inlineexplicit

Variable operand constructor.

Parameters
vThe variable name; an operand corresponding to a reference to v is returned.
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 281 of file messageformat2_data_model.h.

References U_I18N_API.

◆ Operand() [3/4]

U_I18N_API icu::message2::data_model::Operand::Operand ( const Literal & l)
inlineexplicit

Literal operand constructor.

Parameters
lThe literal to use for this operand; an operand corresponding to l is returned.
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 291 of file messageformat2_data_model.h.

References U_I18N_API.

◆ Operand() [4/4]

U_I18N_API icu::message2::data_model::Operand::Operand ( const Operand & )

Copy constructor.

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

References Operand(), and U_I18N_API.

◆ ~Operand()

virtual U_I18N_API icu::message2::data_model::Operand::~Operand ( )
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.

References U_I18N_API.

Member Function Documentation

◆ asLiteral()

U_I18N_API const Literal & icu::message2::data_model::Operand::asLiteral ( ) const

Returns a reference to this operand's literal contents.

Precondition: isLiteral()

Returns
A reference to the literal
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ asVariable()

U_I18N_API const UnicodeString & icu::message2::data_model::Operand::asVariable ( ) const

Returns a reference to this operand's variable name.

Precondition: isVariable()

Returns
A reference to the name of the variable
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ isLiteral()

U_I18N_API UBool icu::message2::data_model::Operand::isLiteral ( ) const

Determines if this operand represents a literal.

Returns
True if and only if the operand is a literal.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ isNull()

virtual U_I18N_API UBool icu::message2::data_model::Operand::isNull ( ) const
virtual

Determines if this operand is the null operand.

Returns
True if and only if the operand is the null operand.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ isVariable()

U_I18N_API UBool icu::message2::data_model::Operand::isVariable ( ) const

Determines if this operand represents a variable.

Returns
True if and only if the operand is a variable.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ operator=()

virtual U_I18N_API Operand & icu::message2::data_model::Operand::operator= ( Operand )
virtualnoexcept

Assignment operator.

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

References Operand(), and U_I18N_API.

◆ swap

U_I18N_API friend void swap ( Operand & o1,
Operand & o2 )
friend

Non-member swap function.

Parameters
o1will get o2's contents
o2will get o1's contents
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 300 of file messageformat2_data_model.h.

References Operand(), swap, and U_I18N_API.

Referenced by swap.


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