Loading...
Searching...
No Matches
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:

## Public Member Functions

Builder & | add (Expression &&part, UErrorCode &status) noexcept
| Adds a single expression part to the pattern.
Builder & | add (Markup &&part, UErrorCode &status) noexcept
| Adds a single markup part to the pattern.
Builder & | add (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
Builder & | operator= (const Builder &)=delete
| Builder (Builder &&)=delete
Builder & | operator= (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 1580 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

  status | Input/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

  part | The part to be added (passed by move)
  status | Input/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

  part | The part to be added (passed by move)
  status | Input/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

  part | The part to be added (passed by move)
  status | Input/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

  status | Input/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.

## Friends And Related Symbol Documentation

## Pattern

friend class Pattern

friend

Definition at line 1582 of file messageformat2_data_model.h.

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

- i18n/unicode/messageformat2_data_model.h