ICU 75.1 75.1
Loading...
Searching...
No Matches
Public Member Functions
icu::message2::Selector Class Referenceabstract

Interface that selector classes must implement. More...

#include <messageformat2_function_registry.h>

Inheritance diagram for icu::message2::Selector:
icu::UObject icu::UMemory

Public Member Functions

virtual void selectKey (FormattedPlaceholder &&toFormat, FunctionOptions &&options, const UnicodeString *keys, int32_t keysLen, UnicodeString *prefs, int32_t &prefsLen, UErrorCode &status) const =0
 Compares the input to an array of keys, and returns an array of matching keys sorted by preference.
 
virtual ~Selector ()
 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.
 

Detailed Description

Interface that selector classes must implement.

Internal:
Do not use. This API is for internal use only. ICU 75.0 technology preview
Deprecated:
This API is for technology preview only.

Definition at line 373 of file messageformat2_function_registry.h.

Constructor & Destructor Documentation

◆ ~Selector()

virtual icu::message2::Selector::~Selector ( )
virtual

Destructor.

Internal:
Do not use. This API is for internal use only. ICU 75.0 technology preview
Deprecated:
This API is for technology preview only.

Member Function Documentation

◆ selectKey()

virtual void icu::message2::Selector::selectKey ( FormattedPlaceholder &&  toFormat,
FunctionOptions &&  options,
const UnicodeString keys,
int32_t  keysLen,
UnicodeString prefs,
int32_t prefsLen,
UErrorCode status 
) const
pure virtual

Compares the input to an array of keys, and returns an array of matching keys sorted by preference.

Parameters
toFormatThe unnamed function argument; passed by move.
optionsA reference to the named function options.
keysAn array of strings that are compared to the input (context.getFormattableInput()) in an implementation-specific way.
keysLenThe length of keys.
prefsAn array of strings with length keysLen. The contents of the array is undefined. selectKey() should set the contents of prefs to a subset of keys, with the best match placed at the lowest index.
prefsLenA reference that selectKey() should set to the length of prefs, which must be less than or equal to keysLen.
statusInput/output error code. Should not be set directly by the custom selector, which should use FormattingContext::setSelectorError() to signal errors. The custom selector may pass status to other ICU functions that can signal errors using this mechanism.
Internal:
Do not use. This API is for internal use only. ICU 75.0 technology preview
Deprecated:
This API is for technology preview only.

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