ICU 76.1 76.1
|
Defines mappings from names of formatters and selectors to functions implementing them. More...
#include <messageformat2_function_registry.h>
Data Structures | |
class | Builder |
The mutable Builder class allows each formatter and selector factory to be initialized separately; calling its build() method yields an immutable MFFunctionRegistry object. More... | |
Public Member Functions | |
FormatterFactory * | getFormatter (const FunctionName &formatterName) const |
Looks up a formatter factory by the name of the formatter. | |
const SelectorFactory * | getSelector (const FunctionName &selectorName) const |
Looks up a selector factory by the name of the selector. | |
UBool | getDefaultFormatterNameByType (const UnicodeString &formatterType, FunctionName &name) const |
Looks up a formatter factory by a type tag. | |
MFFunctionRegistry & | operator= (MFFunctionRegistry &&) noexcept |
Move assignment operator: The source MFFunctionRegistry will be left in a valid but undefined state. | |
MFFunctionRegistry (MFFunctionRegistry &&other) | |
Move constructor: The source MFFunctionRegistry will be left in a valid but undefined state. | |
virtual | ~MFFunctionRegistry () |
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 | MessageContext |
class | MessageFormatter |
Defines mappings from names of formatters and selectors to functions implementing them.
The required set of formatter and selector functions is defined in the spec. Users can also define custom formatter and selector functions.
MFFunctionRegistry
is immutable and movable. It is not copyable.
Definition at line 117 of file messageformat2_function_registry.h.
|
inline |
Move constructor: The source MFFunctionRegistry will be left in a valid but undefined state.
Definition at line 291 of file messageformat2_function_registry.h.
|
virtual |
Destructor.
UBool icu::message2::MFFunctionRegistry::getDefaultFormatterNameByType | ( | const UnicodeString & | formatterType, |
FunctionName & | name | ||
) | const |
Looks up a formatter factory by a type tag.
This method gets the name of the default formatter registered for that type. If no formatter was explicitly registered for this type, it returns false.
formatterType | Type tag for the desired FormattableObject type to be formatted. |
name | Output parameter; initialized to the name of the default formatter for formatterType if one has been registered. Its value is undefined otherwise. |
formatterType
. If the return value is false, then the value of name
is undefined.FormatterFactory * icu::message2::MFFunctionRegistry::getFormatter | ( | const FunctionName & | formatterName | ) | const |
Looks up a formatter factory by the name of the formatter.
The result is non-const, since formatter factories may have local state. Returns the result by pointer rather than by reference since it can fail.
formatterName | Name of the desired formatter. |
FormatterFactory
registered under formatterName
, or null if no formatter was registered under that name. The pointer is not owned by the caller.const SelectorFactory * icu::message2::MFFunctionRegistry::getSelector | ( | const FunctionName & | selectorName | ) | const |
Looks up a selector factory by the name of the selector.
(This returns the result by pointer rather than by reference since FormatterFactory
is an abstract class.)
selectorName | Name of the desired selector. |
SelectorFactory
registered under selectorName
, or null if no formatter was registered under that name.
|
noexcept |
Move assignment operator: The source MFFunctionRegistry will be left in a valid but undefined state.
Definition at line 301 of file messageformat2_function_registry.h.
|
friend |
Definition at line 302 of file messageformat2_function_registry.h.