ICU 76.1: icu::MessagePattern::Part Class Reference

ICU 76.1 76.1

Public Member Functions | Static Public Member Functions | Friends
icu::MessagePattern::Part Class Reference

A message pattern "part", representing a pattern parsing event. More...

`#include <messagepattern.h>`

Inheritance diagram for icu::MessagePattern::Part:

## Public Member Functions
| Part ()
| Default constructor, do not use.
UMessagePatternPartType | getType () const
| Returns the type of this part.
int32_t | getIndex () const
| Returns the pattern string index associated with this Part.
int32_t | getLength () const
| Returns the length of the pattern substring associated with this Part.
int32_t | getLimit () const
| Returns the pattern string limit (exclusive-end) index associated with this Part.
int32_t | getValue () const
| Returns a value associated with this part.
UMessagePatternArgType | getArgType () const
| Returns the argument type if this part is of type ARG_START or ARG_LIMIT, otherwise UMSGPAT_ARG_TYPE_NONE.
bool | operator== (const Part &other) const
bool | operator!= (const Part &other) const
int32_t | hashCode () const

## Static Public Member Functions
static UBool | hasNumericValue (UMessagePatternPartType type)
| Indicates whether the Part type has a numeric value.

## Friends
class | MessagePattern

## Detailed Description

A message pattern "part", representing a pattern parsing event.

There is a part for the start and end of a message or argument, for quoting and escaping of and with ASCII apostrophes, and for syntax elements of "complex" arguments.

Stable
  ICU 4.8

Definition at line 713 of file messagepattern.h.

## Constructor & Destructor Documentation

## ◆ Part()

icu::MessagePattern::Part::Part | ( |  | ) |
| inline

Default constructor, do not use.

Internal
  Do not use. This API is for internal use only.

Definition at line 719 of file messagepattern.h.

## Member Function Documentation

## ◆ getArgType()

UMessagePatternArgType icu::MessagePattern::Part::getArgType | ( |  | ) | const
| inline

Returns the argument type if this part is of type ARG_START or ARG_LIMIT, otherwise UMSGPAT_ARG_TYPE_NONE.

Returns
  the argument type for this part.

Stable
  ICU 4.8

Definition at line 775 of file messagepattern.h.

References UMSGPAT_ARG_TYPE_NONE, UMSGPAT_PART_TYPE_ARG_LIMIT, and UMSGPAT_PART_TYPE_ARG_START.

## ◆ getIndex()

int32_t icu::MessagePattern::Part::getIndex | ( |  | ) | const
| inline

Returns the pattern string index associated with this Part.

Returns
  this part's pattern string index.

Stable
  ICU 4.8

Definition at line 735 of file messagepattern.h.

## ◆ getLength()

int32_t icu::MessagePattern::Part::getLength | ( |  | ) | const
| inline

Returns the length of the pattern substring associated with this Part.

This is 0 for some parts.

Returns
  this part's pattern substring length.

Stable
  ICU 4.8

Definition at line 745 of file messagepattern.h.

## ◆ getLimit()

int32_t icu::MessagePattern::Part::getLimit | ( |  | ) | const
| inline

Returns the pattern string limit (exclusive-end) index associated with this Part.

Convenience method for getIndex()+getLength().

Returns
  this part's pattern string limit index, same as getIndex()+getLength().

Stable
  ICU 4.8

Definition at line 755 of file messagepattern.h.

## ◆ getType()

UMessagePatternPartType icu::MessagePattern::Part::getType | ( |  | ) | const
| inline

Returns the type of this part.

Returns
  the part type.

Stable
  ICU 4.8

Definition at line 726 of file messagepattern.h.

## ◆ getValue()

int32_t icu::MessagePattern::Part::getValue | ( |  | ) | const
| inline

Returns a value associated with this part.

See the documentation of each part type for details.

Returns
  the part value.

Stable
  ICU 4.8

Definition at line 765 of file messagepattern.h.

## ◆ hashCode()

int32_t icu::MessagePattern::Part::hashCode | ( |  | ) | const
| inline

Returns
  A hash code for this object.

Stable
  ICU 4.8

Definition at line 815 of file messagepattern.h.

## ◆ hasNumericValue()

static UBool icu::MessagePattern::Part::hasNumericValue | ( | UMessagePatternPartType | type | ) |
| inlinestatic

Indicates whether the Part type has a numeric value.

If so, then that numeric value can be retrieved via MessagePattern.getNumericValue().

Parameters

  type | The Part type to be tested.

Returns
  true if the Part type has a numeric value.

Stable
  ICU 4.8

Definition at line 791 of file messagepattern.h.

References UMSGPAT_PART_TYPE_ARG_DOUBLE, and UMSGPAT_PART_TYPE_ARG_INT.

## ◆ operator!=()

bool icu::MessagePattern::Part::operator!= | ( | const Part & | other | ) | const
| inline

Parameters

  other | another object to compare with.

Returns
  false if this object is equivalent to the other one.

Stable
  ICU 4.8

Definition at line 807 of file messagepattern.h.

References icu::operator==().

## ◆ operator==()

bool icu::MessagePattern::Part::operator== | ( | const Part & | other | ) | const

Parameters

  other | another object to compare with.

Returns
  true if this object is equivalent to the other one.

Stable
  ICU 4.8

## Friends And Related Symbol Documentation

## ◆ MessagePattern

friend class MessagePattern
| friend

Definition at line 820 of file messagepattern.h.

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

- common/unicode/messagepattern.h