|
ICU 76.1 76.1
|
The Expression class corresponds to the expression nonterminal in the MessageFormat 2 grammar and the Expression interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#patterns.
More...
#include <messageformat2_data_model.h>
Data Structures | |
| class | Builder |
The mutable Expression::Builder class allows the operator to be constructed incrementally. More... | |
Public Member Functions | |
| UBool | isStandaloneAnnotation () const |
| Checks if this expression is an annotation with no operand. | |
| UBool | isFunctionCall () const |
| Checks if this expression has a function annotation (with or without an operand). | |
| const Operator * | getOperator (UErrorCode &status) const |
| Accesses the function annotating this expression. | |
| const Operand & | getOperand () const |
| Accesses the operand of this expression. | |
| std::vector< Option > | getAttributes () const |
| Gets the attributes of this expression. | |
| Expression (const Expression &other) | |
| Copy constructor. | |
| Expression & | operator= (Expression) noexcept |
| Assignment operator. | |
| Expression () | |
| Default constructor. | |
| virtual | ~Expression () |
| 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 | |
| class | message2::Serializer |
| void | swap (Expression &e1, Expression &e2) noexcept |
| Non-member swap function. | |
The Expression class corresponds to the expression nonterminal in the MessageFormat 2 grammar and the Expression interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#patterns.
It represents either an operand with no annotation; an annotation with no operand; or an operand annotated with an annotation.
Expression is immutable, copyable and movable.
Definition at line 1265 of file messageformat2_data_model.h.
| icu::message2::data_model::Expression::Expression | ( | const Expression & | other | ) |
Copy constructor.
| icu::message2::data_model::Expression::Expression | ( | ) |
Default constructor.
Puts the Expression into a valid but undefined state.
|
virtual |
Destructor.
|
inline |
Gets the attributes of this expression.
Definition at line 1321 of file messageformat2_data_model.h.
| const Operand & icu::message2::data_model::Expression::getOperand | ( | ) | const |
Accesses the operand of this expression.
| const Operator * icu::message2::data_model::Expression::getOperator | ( | UErrorCode & | status | ) | const |
Accesses the function annotating this expression.
If !(isFunctionCall()), sets status to U_INVALID_STATE_ERROR.
| status | Input/output error code. |
| UBool icu::message2::data_model::Expression::isFunctionCall | ( | ) | const |
Checks if this expression has a function annotation (with or without an operand).
| UBool icu::message2::data_model::Expression::isStandaloneAnnotation | ( | ) | const |
Checks if this expression is an annotation with no operand.
|
noexcept |
Assignment operator.
|
friend |
Definition at line 1458 of file messageformat2_data_model.h.
|
friend |
Non-member swap function.
| e1 | will get e2's contents |
| e2 | will get e1's contents |
Definition at line 1421 of file messageformat2_data_model.h.