ICU 76.1 76.1

Data Structures | Public Member Functions | Friends
icu::message2::data_model::Pattern Class Reference

A `Pattern` is a sequence of formattable parts. More...

`#include <messageformat2_data_model.h>`

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

## Data Structures
class | Builder
| The mutable `Pattern::Builder` class allows the pattern to be constructed one part at a time. More...
struct | Iterator
| The `Pattern::Iterator` class provides an iterator over the formattable parts of a pattern. More...

## Public Member Functions
Iterator | begin () const
| Returns the parts of this pattern. More...
Iterator | end () const
| Returns a special value to mark the end of iteration. More...
| Pattern ()
| Default constructor. More...
| Pattern (const Pattern &other)
| Copy constructor. More...
Pattern & | operator= (Pattern) noexcept
| Assignment operator. More...
virtual | ~Pattern ()
| Destructor. More...
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor. More...
virtual UClassID | getDynamicClassID () const
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More...

## Friends
class | PatternPart
class | Builder
class | message2::MessageFormatter
class | message2::Serializer
void | swap (Pattern &p1, Pattern &p2) noexcept
| Non-member swap function. More...

## Detailed Description

A `Pattern` is a sequence of formattable parts.

It corresponds to the `Pattern` interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#patterns

`Pattern` 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 1676 of file messageformat2_data_model.h.

## Constructor & Destructor Documentation

## ◆ Pattern() [1/2]

icu::message2::data_model::Pattern::Pattern | ( |  | ) |
| inline

Default constructor.

Puts the Pattern 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.

Definition at line 1798 of file messageformat2_data_model.h.

## ◆ Pattern() [2/2]

icu::message2::data_model::Pattern::Pattern | ( | const Pattern & | 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.

## ◆ ~Pattern()

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

## Member Function Documentation

## ◆ begin()

Iterator icu::message2::data_model::Pattern::begin | ( |  | ) | const
| inline

Returns the parts of this pattern.

Returns
  A forward iterator of variants. Each element is either a string (text part) or 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 1691 of file messageformat2_data_model.h.

## ◆ end()

Iterator icu::message2::data_model::Pattern::end | ( |  | ) | const
| inline

Returns a special value to mark the end of iteration.

Returns
  A forward iterator of variants. This should only be used for comparisons against an iterator returned by incrementing begin().

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

## ◆ operator=()

Pattern& icu::message2::data_model::Pattern::operator= | ( | Pattern |  | ) |
| 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 Function Documentation

## ◆ swap

void swap | ( | Pattern & | p1,
|  | Pattern & | p2
| ) |  |
| friend

Non-member swap function.

Parameters

  p1 | will get p2's contents
  p2 | will 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 1807 of file messageformat2_data_model.h.

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

- i18n/unicode/messageformat2_data_model.h