ICU 78.2 78.2
Loading...
Searching...
No Matches
icu::message2::data_model::SelectorKeys Class Reference

The SelectorKeys class represents the key list for a single variant. More...

#include <messageformat2_data_model.h>

Inheritance diagram for icu::message2::data_model::SelectorKeys:
icu::UObject icu::UMemory

Data Structures

class  Builder
 The mutable SelectorKeys::Builder class allows the key list to be constructed one key at a time. More...

Public Member Functions

U_I18N_API std::vector< KeygetKeys () const
 Returns the underlying list of keys.
U_I18N_API bool operator< (const SelectorKeys &other) const
 Less than operator.
U_I18N_API SelectorKeys ()
 Default constructor.
U_I18N_API SelectorKeys (const SelectorKeys &other)
 Copy constructor.
U_I18N_API SelectorKeysoperator= (SelectorKeys other) noexcept
 Assignment operator.
virtual U_I18N_API ~SelectorKeys ()
 Destructor.
Public Member Functions inherited from icu::UObject
virtual ~UObject ()
 Destructor.
virtual UClassID getDynamicClassID () const
 ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.

Friends

class Builder
class message2::Checker
class message2::MessageFormatter
class message2::Serializer
U_I18N_API friend void swap (SelectorKeys &s1, SelectorKeys &s2) noexcept
 Non-member swap function.

Detailed Description

The SelectorKeys class represents the key list for a single variant.

It corresponds to the keys array in the Variant interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#messages

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

Constructor & Destructor Documentation

◆ SelectorKeys() [1/2]

U_I18N_API icu::message2::data_model::SelectorKeys::SelectorKeys ( )
inline

Default constructor.

Puts the SelectorKeys 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 560 of file messageformat2_data_model.h.

References U_I18N_API.

Referenced by operator<(), operator=(), SelectorKeys(), swap, and ~SelectorKeys().

◆ SelectorKeys() [2/2]

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

References SelectorKeys(), and U_I18N_API.

◆ ~SelectorKeys()

virtual U_I18N_API icu::message2::data_model::SelectorKeys::~SelectorKeys ( )
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 SelectorKeys(), and U_I18N_API.

Member Function Documentation

◆ getKeys()

U_I18N_API std::vector< Key > icu::message2::data_model::SelectorKeys::getKeys ( ) const
inline

Returns the underlying list of keys.

Returns
The list of keys for this variant. Returns an empty list if allocating this SelectorKeys object previously failed.
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 473 of file messageformat2_data_model.h.

References U_I18N_API.

◆ operator<()

U_I18N_API bool icu::message2::data_model::SelectorKeys::operator< ( const SelectorKeys & other) const

Less than operator.

Compares the two key lists lexicographically. This method makes it possible for a SelectorKeys to be used as a map key, which allows variants to be represented as a map. It is not expected to be useful otherwise.

Parameters
otherThe SelectorKeys to compare to this one.
Returns
true if this is less than other, comparing the two key lists lexicographically. Returns false otherwise.
Internal
Do not use. This API is for internal use only. ICU 75 technology preview
Deprecated
This API is for technology preview only.

References SelectorKeys(), and U_I18N_API.

◆ operator=()

U_I18N_API SelectorKeys & icu::message2::data_model::SelectorKeys::operator= ( SelectorKeys other)
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.

References SelectorKeys(), and U_I18N_API.

◆ Builder

friend class Builder
friend

Definition at line 597 of file messageformat2_data_model.h.

◆ message2::Checker

friend class message2::Checker
friend

Definition at line 598 of file messageformat2_data_model.h.

◆ message2::MessageFormatter

friend class message2::MessageFormatter
friend

Definition at line 599 of file messageformat2_data_model.h.

◆ message2::Serializer

friend class message2::Serializer
friend

Definition at line 600 of file messageformat2_data_model.h.

◆ swap

U_I18N_API friend void swap ( SelectorKeys & s1,
SelectorKeys & s2 )
friend

Non-member swap function.

Parameters
s1will get s2's contents
s2will get s1'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 569 of file messageformat2_data_model.h.

References SelectorKeys(), swap, and U_I18N_API.

Referenced by swap.


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