ICU 76.1: icu::DisplayOptions Class Reference

ICU 76.1 76.1

Data Structures | Public Member Functions | Static Public Member Functions
icu::DisplayOptions Class Reference

Represents all the display options that are supported by CLDR such as grammatical case, noun class, ... etc. More...

`#include <displayoptions.h>`

## Data Structures
class | Builder
| Responsible for building `DisplayOptions`. More...

## Public Member Functions
Builder | copyToBuilder () const
| Creates a builder with the same parameters from this object.
UDisplayOptionsGrammaticalCase | getGrammaticalCase () const
| Gets the grammatical case.
UDisplayOptionsNounClass | getNounClass () const
| Gets the noun class.
UDisplayOptionsPluralCategory | getPluralCategory () const
| Gets the plural category.
UDisplayOptionsCapitalization | getCapitalization () const
| Gets the capitalization.
UDisplayOptionsNameStyle | getNameStyle () const
| Gets the dialect handling.
UDisplayOptionsDisplayLength | getDisplayLength () const
| Gets the display length.
UDisplayOptionsSubstituteHandling | getSubstituteHandling () const
| Gets the substitute handling.
DisplayOptions & | operator= (const DisplayOptions &other)=default
| Copies the DisplayOptions.
DisplayOptions & | operator= (DisplayOptions &&other) noexcept=default
| Moves the DisplayOptions.
| DisplayOptions (const DisplayOptions &other)=default
| Copies the DisplayOptions.

## Static Public Member Functions
static Builder | builder ()
| Creates a builder with the `UNDEFINED` values for all the parameters.

## Detailed Description

Represents all the display options that are supported by CLDR such as grammatical case, noun class, ... etc.

It currently supports enums, but may be extended in the future to have other types of data. It replaces a DisplayContext[] as a method parameter.

NOTE: This class is Immutable, and uses a Builder interface.

For example:

DisplayOptions x =
DisplayOptions::builder().
.setGrammaticalCase(UDISPOPT_GRAMMATICAL_CASE_DATIVE)
.setPluralCategory(UDISPOPT_PLURAL_CATEGORY_FEW)
.build();
icu::DisplayOptions::Builder::setGrammaticalCase
Builder & setGrammaticalCase(UDisplayOptionsGrammaticalCase grammaticalCase)
Sets the grammatical case.
Definition displayoptions.h:59
icu::DisplayOptions::Builder::build
DisplayOptions build()
Builds the display options.
Definition displayoptions.h:142
icu::DisplayOptions::Builder::setPluralCategory
Builder & setPluralCategory(UDisplayOptionsPluralCategory pluralCategory)
Sets the plural category.
Definition displayoptions.h:83
icu::DisplayOptions
Represents all the display options that are supported by CLDR such as grammatical case,...
Definition displayoptions.h:43
icu::DisplayOptions::builder
static Builder builder()
Creates a builder with the UNDEFINED values for all the parameters.
UDISPOPT_PLURAL_CATEGORY_FEW
@ UDISPOPT_PLURAL_CATEGORY_FEW
Definition udisplayoptions.h:103
UDISPOPT_GRAMMATICAL_CASE_DATIVE
@ UDISPOPT_GRAMMATICAL_CASE_DATIVE
Definition udisplayoptions.h:40

Stable
  ICU 72

Definition at line 43 of file displayoptions.h.

## Constructor & Destructor Documentation

## ◆ DisplayOptions()

icu::DisplayOptions::DisplayOptions | ( | const DisplayOptions & | other | ) |
| default

Copies the DisplayOptions.

Parameters

  other | The options to copy.

Stable
  ICU 72

## Member Function Documentation

## ◆ builder()

static Builder icu::DisplayOptions::builder | ( |  | ) |
| static

Creates a builder with the `UNDEFINED` values for all the parameters.

Returns
  Builder

Stable
  ICU 72

## ◆ copyToBuilder()

Builder icu::DisplayOptions::copyToBuilder | ( |  | ) | const

Creates a builder with the same parameters from this object.

Returns
  Builder

Stable
  ICU 72

## ◆ getCapitalization()

UDisplayOptionsCapitalization icu::DisplayOptions::getCapitalization | ( |  | ) | const
| inline

Gets the capitalization.

Returns
  UDisplayOptionsCapitalization

Stable
  ICU 72

Definition at line 203 of file displayoptions.h.

## ◆ getDisplayLength()

UDisplayOptionsDisplayLength icu::DisplayOptions::getDisplayLength | ( |  | ) | const
| inline

Gets the display length.

Returns
  UDisplayOptionsDisplayLength

Stable
  ICU 72

Definition at line 219 of file displayoptions.h.

## ◆ getGrammaticalCase()

UDisplayOptionsGrammaticalCase icu::DisplayOptions::getGrammaticalCase | ( |  | ) | const
| inline

Gets the grammatical case.

Returns
  UDisplayOptionsGrammaticalCase

Stable
  ICU 72

Definition at line 179 of file displayoptions.h.

## ◆ getNameStyle()

UDisplayOptionsNameStyle icu::DisplayOptions::getNameStyle | ( |  | ) | const
| inline

Gets the dialect handling.

Returns
  UDisplayOptionsNameStyle

Stable
  ICU 72

Definition at line 211 of file displayoptions.h.

## ◆ getNounClass()

UDisplayOptionsNounClass icu::DisplayOptions::getNounClass | ( |  | ) | const
| inline

Gets the noun class.

Returns
  UDisplayOptionsNounClass

Stable
  ICU 72

Definition at line 187 of file displayoptions.h.

## ◆ getPluralCategory()

UDisplayOptionsPluralCategory icu::DisplayOptions::getPluralCategory | ( |  | ) | const
| inline

Gets the plural category.

Returns
  UDisplayOptionsPluralCategory

Stable
  ICU 72

Definition at line 195 of file displayoptions.h.

## ◆ getSubstituteHandling()

UDisplayOptionsSubstituteHandling icu::DisplayOptions::getSubstituteHandling | ( |  | ) | const
| inline

Gets the substitute handling.

Returns
  UDisplayOptionsSubstituteHandling

Stable
  ICU 72

Definition at line 227 of file displayoptions.h.

## ◆ operator=() [1/2]

DisplayOptions & icu::DisplayOptions::operator= | ( | const DisplayOptions & | other | ) |
| default

Copies the DisplayOptions.

Parameters

  other | The options to copy.

Stable
  ICU 72

## ◆ operator=() [2/2]

DisplayOptions & icu::DisplayOptions::operator= | ( | DisplayOptions && | other | ) |
| defaultnoexcept

Moves the DisplayOptions.

Parameters

  other | The options to move from.

Stable
  ICU 72

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

- i18n/unicode/displayoptions.h