ICU 78.1
78.1
|
A PatternPart
is a single element (text or expression) in a Pattern
.
More...
#include <messageformat2_data_model.h>
Public Member Functions | |
U_I18N_API UBool | isText () const |
Checks if the part is a text part. More... | |
U_I18N_API UBool | isMarkup () const |
Checks if the part is a markup part. More... | |
U_I18N_API UBool | isExpression () const |
Checks if the part is an expression part. More... | |
U_I18N_API const Expression & | contents () const |
Accesses the expression of the part. More... | |
U_I18N_API const Markup & | asMarkup () const |
Accesses the expression of the part. More... | |
U_I18N_API const UnicodeString & | asText () const |
Accesses the text contents of the part. More... | |
U_I18N_API | PatternPart (const PatternPart &other) |
Copy constructor. More... | |
U_I18N_API PatternPart & | operator= (PatternPart) noexcept |
Assignment operator. More... | |
virtual U_I18N_API | ~PatternPart () |
Destructor. More... | |
U_I18N_API | PatternPart (const UnicodeString &t) |
Text part constructor. More... | |
U_I18N_API | PatternPart (Expression &&e) |
Expression part constructor. More... | |
U_I18N_API | PatternPart (Markup &&m) |
Markup part constructor. More... | |
U_I18N_API | 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 |
U_I18N_API friend 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 1392 of file messageformat2_data_model.h.
U_I18N_API 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 1494 of file messageformat2_data_model.h.
|
inlineexplicit |
Expression part constructor.
Returns an Expression pattern part with expression e
.
e | An Expression. |
Definition at line 1504 of file messageformat2_data_model.h.
|
inlineexplicit |
Markup part constructor.
Returns a Markup pattern part with markup m
m | A Markup. |
Definition at line 1514 of file messageformat2_data_model.h.
|
default |
Default constructor.
Puts the PatternPart into a valid but undefined state.
U_I18N_API const Markup& icu::message2::data_model::PatternPart::asMarkup | ( | ) | const |
Accesses the expression of the part.
Precondition: isMarkup()
U_I18N_API const UnicodeString& icu::message2::data_model::PatternPart::asText | ( | ) | const |
Accesses the text contents of the part.
Precondition: isText()
U_I18N_API 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 1420 of file messageformat2_data_model.h.
|
inline |
Checks if the part is a markup part.
Definition at line 1411 of file messageformat2_data_model.h.
|
inline |
Checks if the part is a text part.
Definition at line 1402 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 1459 of file messageformat2_data_model.h.