ICU 76.1 76.1
icu::message2::data_model::Pattern::Builder Class Reference

The mutable Pattern::Builder class allows the pattern to be constructed one part at a time. More...

#include <messageformat2_data_model.h>

Inheritance diagram for icu::message2::data_model::Pattern::Builder:
icu::UMemory

Public Member Functions

Builderadd (Expression &&part, UErrorCode &status) noexcept
 Adds a single expression part to the pattern.
Builderadd (Markup &&part, UErrorCode &status) noexcept
 Adds a single markup part to the pattern.
Builderadd (UnicodeString &&part, UErrorCode &status) noexcept
 Adds a single text part to the pattern.
Pattern build (UErrorCode &status) const noexcept
 Constructs a new immutable Pattern using the list of parts set with previous add() calls.
 Builder (UErrorCode &status)
 Default constructor.
virtual ~Builder ()
 Destructor.
 Builder (const Builder &)=delete
Builderoperator= (const Builder &)=delete
 Builder (Builder &&)=delete
Builderoperator= (Builder &&)=delete

Friends

class Pattern

Detailed Description

The mutable Pattern::Builder class allows the pattern to be constructed one part at a time.

Builder is not copyable or 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 1715 of file messageformat2_data_model.h.

Constructor & Destructor Documentation

◆ Builder()

icu::message2::data_model::Pattern::Builder::Builder ( UErrorCode & status)

Default constructor.

Returns a Builder with an empty sequence of PatternParts.

Parameters
statusInput/output error code
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

Referenced by add(), add(), add(), and ~Builder().

◆ ~Builder()

virtual icu::message2::data_model::Pattern::Builder::~Builder ( )
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 Builder().

Member Function Documentation

◆ add() [1/3]

Builder & icu::message2::data_model::Pattern::Builder::add ( Expression && part,
UErrorCode & status )
noexcept

Adds a single expression part to the pattern.

Parameters
partThe part to be added (passed by move)
statusInput/output error code.
Returns
A reference to the builder.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References Builder().

◆ add() [2/3]

Builder & icu::message2::data_model::Pattern::Builder::add ( Markup && part,
UErrorCode & status )
noexcept

Adds a single markup part to the pattern.

Parameters
partThe part to be added (passed by move)
statusInput/output error code.
Returns
A reference to the builder.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References Builder().

◆ add() [3/3]

Builder & icu::message2::data_model::Pattern::Builder::add ( UnicodeString && part,
UErrorCode & status )
noexcept

Adds a single text part to the pattern.

Copies part.

Parameters
partThe part to be added (passed by move)
statusInput/output error code.
Returns
A reference to the builder.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References Builder().

◆ build()

Pattern icu::message2::data_model::Pattern::Builder::build ( UErrorCode & status) const
noexcept

Constructs a new immutable Pattern using the list of parts set with previous add() calls.

The builder object (this) can still be used after calling build().

Parameters
statusInput/output error code.
Returns
The pattern object
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

◆ Pattern

friend class Pattern
friend

Definition at line 1717 of file messageformat2_data_model.h.


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