|
ICU 77.1
77.1
|
The mutable Markup::Builder class allows the markup to be constructed incrementally.
More...
#include <messageformat2_data_model.h>
Public Member Functions | |
| Builder & | setName (const UnicodeString &n) |
| Sets the name of this markup. More... | |
| Builder & | setOpen () |
| Sets this to be an opening markup. More... | |
| Builder & | setClose () |
| Sets this to be an closing markup. More... | |
| Builder & | setStandalone () |
| Sets this to be a standalone markup. More... | |
| Builder & | addOption (const UnicodeString &key, Operand &&value, UErrorCode &status) |
| Adds a single option. More... | |
| Builder & | addAttribute (const UnicodeString &key, Operand &&value, UErrorCode &status) |
| Adds a single attribute. More... | |
| Markup | build (UErrorCode &status) |
Constructs a new immutable Markup using the name and type and (optionally) options and attributes that were previously set. More... | |
| Builder (UErrorCode &status) | |
| Default constructor. More... | |
| virtual | ~Builder () |
| Destructor. More... | |
| Builder (const Builder &)=delete | |
| Builder & | operator= (const Builder &)=delete |
| Builder (Builder &&)=delete | |
| Builder & | operator= (Builder &&)=delete |
Friends | |
| class | Markup |
The mutable Markup::Builder class allows the markup to be constructed incrementally.
Builder is not copyable or movable.
Definition at line 1130 of file messageformat2_data_model.h.
| icu::message2::data_model::Markup::Builder::Builder | ( | UErrorCode & | status | ) |
Default constructor.
Returns a Builder with no name, type, options, or attributes set.
| status | Input/output error code. |
|
virtual |
Destructor.
| Builder& icu::message2::data_model::Markup::Builder::addAttribute | ( | const UnicodeString & | key, |
| Operand && | value, | ||
| UErrorCode & | status | ||
| ) |
Adds a single attribute.
| key | The name of the attribute. |
| value | The value (right-hand side) of the attribute. |
| status | Input/output error code. |
| Builder& icu::message2::data_model::Markup::Builder::addOption | ( | const UnicodeString & | key, |
| Operand && | value, | ||
| UErrorCode & | status | ||
| ) |
Adds a single option.
| key | The name of the option. |
| value | The value (right-hand side) of the option. |
| status | Input/output error code. |
| Markup icu::message2::data_model::Markup::Builder::build | ( | UErrorCode & | status | ) |
Constructs a new immutable Markup using the name and type and (optionally) options and attributes that were previously set.
If setName() and at least one of setOpen(), setClose(), and setStandalone() were not previously called, then status is set to U_INVALID_STATE_ERROR.
The builder object (this) can still be used after calling build(). The build() method is non-const for internal implementation reasons, but is observably const.
| status | Input/output error code. |
|
inline |
Sets this to be an closing markup.
Definition at line 1166 of file messageformat2_data_model.h.
|
inline |
Sets the name of this markup.
| n | A string representing the name. |
Definition at line 1148 of file messageformat2_data_model.h.
|
inline |
Sets this to be an opening markup.
Definition at line 1157 of file messageformat2_data_model.h.
|
inline |
Sets this to be a standalone markup.
Definition at line 1175 of file messageformat2_data_model.h.