ICU 76.1 76.1
|
The Literal
class corresponds to the literal
nonterminal in the MessageFormat 2 grammar, https://github.com/unicode-org/message-format-wg/blob/main/spec/message.abnf and the Literal
interface defined in // https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#expressions.
More...
#include <messageformat2_data_model.h>
Public Member Functions | |
UnicodeString | quoted () const |
Returns the quoted representation of this literal (enclosed in '|' characters) | |
const UnicodeString & | unquoted () const |
Returns the parsed string contents of this literal. | |
UBool | isQuoted () const |
Determines if this literal appeared as a quoted literal in the message. | |
Literal (UBool q, const UnicodeString &s) | |
Literal constructor. | |
Literal (const Literal &other) | |
Copy constructor. | |
Literal & | operator= (Literal) noexcept |
Assignment operator. | |
Literal ()=default | |
Default constructor. | |
bool | operator< (const Literal &other) const |
Less than operator. | |
bool | operator== (const Literal &other) const |
Equality operator. | |
virtual | ~Literal () |
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 | |
void | swap (Literal &l1, Literal &l2) noexcept |
Non-member swap function. | |
The Literal
class corresponds to the literal
nonterminal in the MessageFormat 2 grammar, https://github.com/unicode-org/message-format-wg/blob/main/spec/message.abnf and the Literal
interface defined in // https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#expressions.
Literal
is immutable, copyable and movable.
Definition at line 76 of file messageformat2_data_model.h.
|
inline |
Literal constructor.
q | True if and only if this literal was parsed with the quoted nonterminal (appeared enclosed in '|' characters in the message text). |
s | The string contents of this literal; escape sequences are assumed to have been interpreted already. |
Definition at line 117 of file messageformat2_data_model.h.
Copy constructor.
Definition at line 124 of file messageformat2_data_model.h.
|
default |
Default constructor.
Puts the Literal into a valid but undefined state.
|
virtual |
Destructor.
|
inline |
Determines if this literal appeared as a quoted literal in the message.
Definition at line 105 of file messageformat2_data_model.h.
Less than operator.
Compares this.stringContents()
with other.stringContents()
. This method is used in representing the mapping from key lists to patterns in a message with variants, and is not expected to be useful otherwise.
other | The Literal to compare to this one. |
Literal
is less than the parsed string corresponding to the other Literal
(according to UnicodeString
's less-than operator). Returns false otherwise.Assignment operator.
Equality operator.
Compares this.stringContents()
with other.stringContents()
. This method is used in representing the mapping from key lists to patterns in a message with variants, and is not expected to be useful otherwise.
other | The Literal to compare to this one. |
Literal
equals the parsed string corresponding to the other Literal
(according to UnicodeString
's equality operator). Returns false otherwise.UnicodeString icu::message2::data_model::Literal::quoted | ( | ) | const |
Returns the quoted representation of this literal (enclosed in '|' characters)
const UnicodeString & icu::message2::data_model::Literal::unquoted | ( | ) | const |
Returns the parsed string contents of this literal.
Non-member swap function.
l1 | will get l2's contents |
l2 | will get l1's contents |
Definition at line 133 of file messageformat2_data_model.h.