ICU 73.2 73.2

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:61
icu::DisplayOptions::Builder::build
DisplayOptions build()
Builds the display options.
Definition displayoptions.h:144
icu::DisplayOptions::Builder::setPluralCategory
Builder & setPluralCategory(UDisplayOptionsPluralCategory pluralCategory)
Sets the plural category.
Definition displayoptions.h:85
icu::DisplayOptions
Represents all the display options that are supported by CLDR such as grammatical case,...
Definition displayoptions.h:45
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:105
UDISPOPT_GRAMMATICAL_CASE_DATIVE
@ UDISPOPT_GRAMMATICAL_CASE_DATIVE
Definition udisplayoptions.h:42

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 45 of file displayoptions.h.

## Constructor & Destructor Documentation

## ◆ DisplayOptions()

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

Copies the DisplayOptions.

Parameters

  other | The options to copy.

Draft:
  This API may be changed in the future versions and was introduced in 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

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

## ◆ copyToBuilder()

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

Creates a builder with the same parameters from this object.

Returns
  Builder

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

## ◆ getCapitalization()

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

Gets the capitalization.

Returns
  UDisplayOptionsCapitalization

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 205 of file displayoptions.h.

## ◆ getDisplayLength()

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

Gets the display length.

Returns
  UDisplayOptionsDisplayLength

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 221 of file displayoptions.h.

## ◆ getGrammaticalCase()

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

Gets the grammatical case.

Returns
  UDisplayOptionsGrammaticalCase

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 181 of file displayoptions.h.

## ◆ getNameStyle()

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

Gets the dialect handling.

Returns
  UDisplayOptionsNameStyle

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 213 of file displayoptions.h.

## ◆ getNounClass()

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

Gets the noun class.

Returns
  UDisplayOptionsNounClass

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 189 of file displayoptions.h.

## ◆ getPluralCategory()

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

Gets the plural category.

Returns
  UDisplayOptionsPluralCategory

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 197 of file displayoptions.h.

## ◆ getSubstituteHandling()

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

Gets the substitute handling.

Returns
  UDisplayOptionsSubstituteHandling

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

Definition at line 229 of file displayoptions.h.

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

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

Copies the DisplayOptions.

Parameters

  other | The options to copy.

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

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

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

Moves the DisplayOptions.

Parameters

  other | The options to move from.

Draft:
  This API may be changed in the future versions and was introduced in ICU 72

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

- displayoptions.h