ICU 78.2 78.2
Loading...
Searching...
No Matches
icu::message2::data_model::PatternPart Class Reference

A PatternPart is a single element (text or expression) in a Pattern. More...

#include <messageformat2_data_model.h>

Inheritance diagram for icu::message2::data_model::PatternPart:
icu::UObject icu::UMemory

Public Member Functions

U_I18N_API UBool isText () const
 Checks if the part is a text part.
U_I18N_API UBool isMarkup () const
 Checks if the part is a markup part.
U_I18N_API UBool isExpression () const
 Checks if the part is an expression part.
U_I18N_API const Expressioncontents () const
 Accesses the expression of the part.
U_I18N_API const MarkupasMarkup () const
 Accesses the expression of the part.
U_I18N_API const UnicodeStringasText () const
 Accesses the text contents of the part.
U_I18N_API PatternPart (const PatternPart &other)
 Copy constructor.
U_I18N_API PatternPartoperator= (PatternPart) noexcept
 Assignment operator.
virtual U_I18N_API ~PatternPart ()
 Destructor.
U_I18N_API PatternPart (const UnicodeString &t)
 Text part constructor.
U_I18N_API PatternPart (Expression &&e)
 Expression part constructor.
U_I18N_API PatternPart (Markup &&m)
 Markup part constructor.
U_I18N_API 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
U_I18N_API friend void swap (PatternPart &p1, PatternPart &p2) noexcept
 Non-member swap function.

Detailed Description

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.

Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1392 of file messageformat2_data_model.h.

Constructor & Destructor Documentation

◆ PatternPart() [1/5]

U_I18N_API icu::message2::data_model::PatternPart::PatternPart ( const PatternPart & other)

Copy constructor.

Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References PatternPart(), and U_I18N_API.

Referenced by operator=(), PatternPart(), and swap.

◆ ~PatternPart()

virtual U_I18N_API icu::message2::data_model::PatternPart::~PatternPart ( )
virtual

Destructor.

Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ PatternPart() [2/5]

U_I18N_API icu::message2::data_model::PatternPart::PatternPart ( const UnicodeString & t)
inlineexplicit

Text part constructor.

Returns a text pattern part with text t.

Parameters
tA text string.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1494 of file messageformat2_data_model.h.

References U_I18N_API.

◆ PatternPart() [3/5]

U_I18N_API icu::message2::data_model::PatternPart::PatternPart ( Expression && e)
inlineexplicit

Expression part constructor.

Returns an Expression pattern part with expression e.

Parameters
eAn Expression.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1504 of file messageformat2_data_model.h.

References U_I18N_API.

◆ PatternPart() [4/5]

U_I18N_API icu::message2::data_model::PatternPart::PatternPart ( Markup && m)
inlineexplicit

Markup part constructor.

Returns a Markup pattern part with markup m

Parameters
mA Markup.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1514 of file messageformat2_data_model.h.

References U_I18N_API.

◆ PatternPart() [5/5]

U_I18N_API icu::message2::data_model::PatternPart::PatternPart ( )
default

Default constructor.

Puts the PatternPart into a valid but undefined state.

Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

Member Function Documentation

◆ asMarkup()

U_I18N_API const Markup & icu::message2::data_model::PatternPart::asMarkup ( ) const

Accesses the expression of the part.

Precondition: isMarkup()

Returns
A reference to the part's underlying expression.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ asText()

U_I18N_API const UnicodeString & icu::message2::data_model::PatternPart::asText ( ) const

Accesses the text contents of the part.

Precondition: isText()

Returns
A reference to a string representing the part's text..
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ contents()

U_I18N_API const Expression & icu::message2::data_model::PatternPart::contents ( ) const

Accesses the expression of the part.

Precondition: isExpression()

Returns
A reference to the part's underlying expression.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References U_I18N_API.

◆ isExpression()

U_I18N_API UBool icu::message2::data_model::PatternPart::isExpression ( ) const
inline

Checks if the part is an expression part.

Returns
True if and only if this is an expression part.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1420 of file messageformat2_data_model.h.

References U_I18N_API.

◆ isMarkup()

U_I18N_API UBool icu::message2::data_model::PatternPart::isMarkup ( ) const
inline

Checks if the part is a markup part.

Returns
True if and only if this is a markup part.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1411 of file messageformat2_data_model.h.

References U_I18N_API.

◆ isText()

U_I18N_API UBool icu::message2::data_model::PatternPart::isText ( ) const
inline

Checks if the part is a text part.

Returns
True if and only if this is a text part.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1402 of file messageformat2_data_model.h.

References U_I18N_API.

◆ operator=()

U_I18N_API PatternPart & icu::message2::data_model::PatternPart::operator= ( PatternPart )
noexcept

Assignment operator.

Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References PatternPart(), and U_I18N_API.

◆ Pattern

friend class Pattern
friend

Definition at line 1524 of file messageformat2_data_model.h.

◆ swap

U_I18N_API friend void swap ( PatternPart & p1,
PatternPart & p2 )
friend

Non-member swap function.

Parameters
p1will get p2's contents
p2will get p1's contents
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Definition at line 1459 of file messageformat2_data_model.h.

References PatternPart(), swap, and U_I18N_API.

Referenced by swap.


The documentation for this class was generated from the following file: