ICU4C 79
Loading...
Searching...
No Matches
icu::message2::MFFunctionRegistry Class Reference

Defines mappings from names of formatters and selectors to functions implementing them. More...

#include <messageformat2_function_registry.h>

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

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

const Function * getFunction (const FunctionName &functionName) const
 Looks up a function by the name of the function.
UBool getDefaultFormatterNameByType (const UnicodeString &formatterType, FunctionName &name) const
 Looks up a function 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.

Static Public Member Functions

static const MFFunctionRegistry * getStandardFunctionsRegistry (UErrorCode &status)
 Get the standard function registry.

Friends

class MessageContext
class MessageFormatter
class MF2RegistrySingleton

Detailed Description

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 46 of file messageformat2_function_registry.h.

Constructor & Destructor Documentation

◆ MFFunctionRegistry()

icu::message2::MFFunctionRegistry::MFFunctionRegistry ( MFFunctionRegistry && other)
inline

Move constructor: 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.

Definition at line 198 of file messageformat2_function_registry.h.

References MFFunctionRegistry().

Referenced by icu::message2::MFFunctionRegistry::Builder::build(), getStandardFunctionsRegistry(), MFFunctionRegistry(), and operator=().

◆ ~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.

Member Function Documentation

◆ getDefaultFormatterNameByType()

UBool icu::message2::MFFunctionRegistry::getDefaultFormatterNameByType ( const UnicodeString & formatterType,
FunctionName & name ) const

Looks up a function 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
formatterTypeType tag for the desired FormattableObject type to be formatted.
nameOutput 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.

◆ getFunction()

const Function * icu::message2::MFFunctionRegistry::getFunction ( const FunctionName & functionName) const

Looks up a function by the name of the function.

Returns the result by pointer rather than by reference since it can fail.

Parameters
functionNameName of the desired function.
Returns
A pointer to the function registered under functionName, or null if no function 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 79 technology preview
Deprecated
This API is for technology preview only.

◆ getStandardFunctionsRegistry()

const MFFunctionRegistry * icu::message2::MFFunctionRegistry::getStandardFunctionsRegistry ( UErrorCode & status)
static

Get the standard function registry.

Internal
Do not use. This API is for internal use only. ICU 79 technology preview
Deprecated
This API is for technology preview only.
Parameters
statusInput/output error code
Returns
A const alias to the registry, or nullptr on error

References MFFunctionRegistry(), and operator=().

◆ operator=()

MFFunctionRegistry & icu::message2::MFFunctionRegistry::operator= ( MFFunctionRegistry && )
noexcept

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.

References MFFunctionRegistry().

Referenced by getStandardFunctionsRegistry().

◆ MessageContext

friend class MessageContext
friend

Definition at line 217 of file messageformat2_function_registry.h.

◆ MessageFormatter

friend class MessageFormatter
friend

Definition at line 218 of file messageformat2_function_registry.h.

◆ MF2RegistrySingleton

friend class MF2RegistrySingleton
friend

Definition at line 219 of file messageformat2_function_registry.h.


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