Defines mappings from names of formatters and selectors to functions implementing them.
More...
#include <messageformat2_function_registry.h>
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.
- 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 117 of file messageformat2_function_registry.h.
◆ MFFunctionRegistry()
◆ ~MFFunctionRegistry()
virtual icu::message2::MFFunctionRegistry::~MFFunctionRegistry |
( |
| ) |
|
|
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.
◆ getDefaultFormatterNameByType()
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.
- Parameters
-
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. |
- Returns
- True if and only if the function registry contains a default formatter for
formatterType
. If the return value is false, then the value of name
is undefined.
- Internal
- Do not use. This API is for internal use only. ICU 75 technology preview
- Deprecated
- This API is for technology preview only.
◆ getFormatter()
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.
- Parameters
-
formatterName | Name of the desired formatter. |
- Returns
- A pointer to the
FormatterFactory
registered under formatterName
, or null if no formatter was registered under that name. The pointer is not owned by the caller.
- Internal
- Do not use. This API is for internal use only. ICU 75 technology preview
- Deprecated
- This API is for technology preview only.
◆ getSelector()
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.)
- Parameters
-
selectorName | Name of the desired selector. |
- Returns
- A pointer to the
SelectorFactory
registered under selectorName
, or null if no formatter was registered under that name.
- Internal
- Do not use. This API is for internal use only. ICU 75 technology preview
- Deprecated
- This API is for technology preview only.
◆ operator=()
Move assignment operator: The source MFFunctionRegistry will be left in 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.
◆ MessageContext
friend class MessageContext |
|
friend |
◆ MessageFormatter
The documentation for this class was generated from the following file: