ICU 77.1
77.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. More... | |
UBool | isMarkup () const |
Checks if the part is a markup part. More... | |
UBool | isExpression () const |
Checks if the part is an expression part. More... | |
const Expression & | contents () const |
Accesses the expression of the part. More... | |
const Markup & | asMarkup () const |
Accesses the expression of the part. More... | |
const UnicodeString & | asText () const |
Accesses the text contents of the part. More... | |
PatternPart (const PatternPart &other) | |
Copy constructor. More... | |
PatternPart & | operator= (PatternPart) noexcept |
Assignment operator. More... | |
virtual | ~PatternPart () |
Destructor. More... | |
PatternPart (const UnicodeString &t) | |
Text part constructor. More... | |
PatternPart (Expression &&e) | |
Expression part constructor. More... | |
PatternPart (Markup &&m) | |
Markup part constructor. More... | |
PatternPart ()=default | |
Default constructor. More... | |
![]() | |
virtual | ~UObject () |
Destructor. More... | |
virtual UClassID | getDynamicClassID () const |
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More... | |
Friends | |
class | Pattern |
void | swap (PatternPart &p1, PatternPart &p2) noexcept |
Non-member swap function. More... | |
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 1515 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 1617 of file messageformat2_data_model.h.
|
inlineexplicit |
Expression part constructor.
Returns an Expression pattern part with expression e
.
e | An Expression. |
Definition at line 1627 of file messageformat2_data_model.h.
|
inlineexplicit |
Markup part constructor.
Returns a Markup pattern part with markup m
m | A Markup. |
Definition at line 1637 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 1543 of file messageformat2_data_model.h.
|
inline |
Checks if the part is a markup part.
Definition at line 1534 of file messageformat2_data_model.h.
|
inline |
Checks if the part is a text part.
Definition at line 1525 of file messageformat2_data_model.h.
|
noexcept |
Assignment operator.
|
friend |
Non-member swap function.
p1 | will get p2's contents |
p2 | will get p1's contents |
Definition at line 1582 of file messageformat2_data_model.h.