|
ICU 76.1 76.1
|
A PatternPart is a single element (text or expression) in a Pattern.
More...
#include <messageformat2_data_model.h>
Public Member Functions | |
| UBool | isText () const |
| Checks if the part is a text part. | |
| UBool | isMarkup () const |
| Checks if the part is a markup part. | |
| UBool | isExpression () const |
| Checks if the part is an expression part. | |
| const Expression & | contents () const |
| Accesses the expression of the part. | |
| const Markup & | asMarkup () const |
| Accesses the expression of the part. | |
| const UnicodeString & | asText () const |
| Accesses the text contents of the part. | |
| PatternPart (const PatternPart &other) | |
| Copy constructor. | |
| PatternPart & | operator= (PatternPart) noexcept |
| Assignment operator. | |
| virtual | ~PatternPart () |
| Destructor. | |
| PatternPart (const UnicodeString &t) | |
| Text part constructor. | |
| PatternPart (Expression &&e) | |
| Expression part constructor. | |
| PatternPart (Markup &&m) | |
| Markup part constructor. | |
| PatternPart ()=default | |
| Default constructor. | |
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 | Pattern |
| void | swap (PatternPart &p1, PatternPart &p2) noexcept |
| Non-member swap function. | |
A PatternPart is a single element (text or expression) in a Pattern.
It corresponds to the body field of the Pattern interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#patterns
PatternPart is immutable, copyable and movable.
Definition at line 1513 of file messageformat2_data_model.h.
| icu::message2::data_model::PatternPart::PatternPart | ( | const PatternPart & | other | ) |
Copy constructor.
|
virtual |
Destructor.
|
inlineexplicit |
Text part constructor.
Returns a text pattern part with text t.
| t | A text string. |
Definition at line 1615 of file messageformat2_data_model.h.
|
inlineexplicit |
Expression part constructor.
Returns an Expression pattern part with expression e.
| e | An Expression. |
Definition at line 1625 of file messageformat2_data_model.h.
|
inlineexplicit |
Markup part constructor.
Returns a Markup pattern part with markup m
| m | A Markup. |
Definition at line 1635 of file messageformat2_data_model.h.
|
default |
Default constructor.
Puts the PatternPart into a valid but undefined state.
| const Markup & icu::message2::data_model::PatternPart::asMarkup | ( | ) | const |
Accesses the expression of the part.
Precondition: isMarkup()
| const UnicodeString & icu::message2::data_model::PatternPart::asText | ( | ) | const |
Accesses the text contents of the part.
Precondition: isText()
| const Expression & icu::message2::data_model::PatternPart::contents | ( | ) | const |
Accesses the expression of the part.
Precondition: isExpression()
|
inline |
Checks if the part is an expression part.
Definition at line 1541 of file messageformat2_data_model.h.
|
inline |
Checks if the part is a markup part.
Definition at line 1532 of file messageformat2_data_model.h.
|
inline |
Checks if the part is a text part.
Definition at line 1523 of file messageformat2_data_model.h.
|
noexcept |
Assignment operator.
|
friend |
Definition at line 1645 of file messageformat2_data_model.h.
|
friend |
Non-member swap function.
| p1 | will get p2's contents |
| p2 | will get p1's contents |
Definition at line 1580 of file messageformat2_data_model.h.