#include <messageformat2.h>
|
class | Builder |
|
class | MessageContext |
|
MessageFormatter is a Technical Preview API implementing MessageFormat 2.0.
See the description of the syntax with examples and use cases and the corresponding ABNF grammar.
The MessageFormatter class is mutable and movable. It is not copyable. (It is mutable because if it has a custom function registry, the registry may include FormatterFactory
objects implementing custom formatters, which are allowed to contain mutable 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 51 of file messageformat2.h.
◆ ~MessageFormatter()
virtual icu::message2::MessageFormatter::~MessageFormatter |
( |
| ) |
|
|
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.
◆ format()
Not yet implemented; formats the message to a FormattedMessage
object, using the data model that was previously set or parsed, and the given arguments
object.
- Parameters
-
arguments | Reference to message arguments |
status | Input/output error code used to indicate syntax errors, data model errors, resolution errors, formatting errors, selection errors, as well as other errors (such as memory allocation failures). Partial output is still provided in the presence of most error types. |
- Returns
- The
FormattedMessage
representing the formatted message.
- 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 102 of file messageformat2.h.
References U_SUCCESS, and U_UNSUPPORTED_ERROR.
◆ formatToString()
Formats the message to a string, using the data model that was previously set or parsed, and the given arguments
object.
- Parameters
-
arguments | Reference to message arguments |
status | Input/output error code used to indicate syntax errors, data model errors, resolution errors, formatting errors, selection errors, as well as other errors (such as memory allocation failures). Partial output is still provided in the presence of most error types. |
- Returns
- The string result of formatting the message with the given arguments.
- Internal:
- Do not use. This API is for internal use only. ICU 75 technology preview
- Deprecated:
- This API is for technology preview only.
◆ getDataModel()
const MFDataModel& icu::message2::MessageFormatter::getDataModel |
( |
| ) |
const |
Accesses the data model referred to by this MessageFormatter
object.
- Returns
- A reference to the data model.
- Internal:
- Do not use. This API is for internal use only. ICU 75 technology preview
- Deprecated:
- This API is for technology preview only.
◆ getLocale()
const Locale& icu::message2::MessageFormatter::getLocale |
( |
| ) |
const |
|
inline |
Accesses the locale that this MessageFormatter
object was created with.
- Returns
- A reference to the locale.
- 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 118 of file messageformat2.h.
◆ getNormalizedPattern()
const UnicodeString& icu::message2::MessageFormatter::getNormalizedPattern |
( |
| ) |
const |
|
inline |
Returns a string consisting of the input with optional spaces removed.
- Returns
- A normalized string representation of the input
- 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 266 of file messageformat2.h.
◆ getPattern()
UnicodeString icu::message2::MessageFormatter::getPattern |
( |
| ) |
const |
Serializes the data model as a string in MessageFormat 2.0 syntax.
- Returns
- result A string representation of the data model. The string is a valid MessageFormat 2.0 message.
- 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 MessageFormatter 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.
The documentation for this class was generated from the following file: