|
ICU 78.1
78.1
|
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>
Public Member Functions | |
| U_I18N_API UBool | isVariable () const |
| Determines if this operand represents a variable. More... | |
| U_I18N_API UBool | isLiteral () const |
| Determines if this operand represents a literal. More... | |
| virtual U_I18N_API UBool | isNull () const |
| Determines if this operand is the null operand. More... | |
| U_I18N_API const UnicodeString & | asVariable () const |
| Returns a reference to this operand's variable name. More... | |
| U_I18N_API const Literal & | asLiteral () const |
| Returns a reference to this operand's literal contents. More... | |
| U_I18N_API | Operand () |
| Default constructor. More... | |
| U_I18N_API | Operand (const UnicodeString &v) |
| Variable operand constructor. More... | |
| U_I18N_API | Operand (const Literal &l) |
| Literal operand constructor. More... | |
| virtual U_I18N_API Operand & | operator= (Operand) noexcept |
| Assignment operator. More... | |
| U_I18N_API | Operand (const Operand &) |
| Copy constructor. More... | |
| virtual U_I18N_API | ~Operand () |
| Destructor. More... | |
Public Member Functions inherited from icu::UObject | |
| virtual | ~UObject () |
| Destructor. More... | |
| virtual UClassID | getDynamicClassID () const |
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More... | |
Friends | |
| U_I18N_API friend void | swap (Operand &o1, Operand &o2) noexcept |
| Non-member swap function. More... | |
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.
Definition at line 215 of file messageformat2_data_model.h.
|
inline |
Default constructor.
Creates a null Operand.
Definition at line 271 of file messageformat2_data_model.h.
|
inlineexplicit |
Variable operand constructor.
| v | The variable name; an operand corresponding to a reference to v is returned. |
Definition at line 281 of file messageformat2_data_model.h.
|
inlineexplicit |
Literal operand constructor.
| l | The literal to use for this operand; an operand corresponding to l is returned. |
Definition at line 291 of file messageformat2_data_model.h.
| U_I18N_API icu::message2::data_model::Operand::Operand | ( | const Operand & | ) |
Copy constructor.
|
virtual |
Destructor.
| U_I18N_API const Literal& icu::message2::data_model::Operand::asLiteral | ( | ) | const |
Returns a reference to this operand's literal contents.
Precondition: isLiteral()
| U_I18N_API const UnicodeString& icu::message2::data_model::Operand::asVariable | ( | ) | const |
Returns a reference to this operand's variable name.
Precondition: isVariable()
| U_I18N_API UBool icu::message2::data_model::Operand::isLiteral | ( | ) | const |
Determines if this operand represents a literal.
|
virtual |
Determines if this operand is the null operand.
| U_I18N_API UBool icu::message2::data_model::Operand::isVariable | ( | ) | const |
Determines if this operand represents a variable.
|
virtualnoexcept |
Assignment operator.
|
friend |
Non-member swap function.
| o1 | will get o2's contents |
| o2 | will get o1's contents |
Definition at line 300 of file messageformat2_data_model.h.