ICU 76.1 76.1
|
Interface that selector classes must implement. More...
#include <messageformat2_function_registry.h>
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. | |
Interface that selector classes must implement.
Definition at line 373 of file messageformat2_function_registry.h.
|
virtual |
Destructor.
|
pure virtual |
Compares the input to an array of keys, and returns an array of matching keys sorted by preference.
toFormat | The unnamed function argument; passed by move. |
options | A reference to the named function options. |
keys | An array of strings that are compared to the input (context.getFormattableInput() ) in an implementation-specific way. |
keysLen | The length of keys . |
prefs | An 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. |
prefsLen | A reference that selectKey() should set to the length of prefs , which must be less than or equal to keysLen . |
status | Input/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. |