ICU 75.1 75.1
Loading...
Searching...
No Matches
Public Member Functions | Friends
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

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 Expressioncontents () const
 Accesses the expression of the part.
 
const MarkupasMarkup () const
 Accesses the expression of the part.
 
const UnicodeStringasText () const
 Accesses the text contents of the part.
 
 PatternPart (const PatternPart &other)
 Copy constructor.
 
PatternPartoperator= (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.
 

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 1965 of file messageformat2_data_model.h.

Constructor & Destructor Documentation

◆ PatternPart() [1/5]

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.

◆ ~PatternPart()

virtual 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.

◆ PatternPart() [2/5]

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 2067 of file messageformat2_data_model.h.

◆ PatternPart() [3/5]

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 2077 of file messageformat2_data_model.h.

◆ PatternPart() [4/5]

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 2087 of file messageformat2_data_model.h.

◆ PatternPart() [5/5]

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.

Member Function Documentation

◆ asMarkup()

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.

◆ asText()

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.

◆ contents()

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.

◆ isExpression()

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 1993 of file messageformat2_data_model.h.

◆ isMarkup()

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 1984 of file messageformat2_data_model.h.

◆ isText()

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 1975 of file messageformat2_data_model.h.

◆ operator=()

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.

Friends And Related Symbol Documentation

◆ Pattern

friend class Pattern
friend

Definition at line 2097 of file messageformat2_data_model.h.

◆ swap

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 2032 of file messageformat2_data_model.h.


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