ICU 77.1
77.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) More... | |
const UnicodeString & | unquoted () const |
Returns the parsed string contents of this literal. More... | |
UBool | isQuoted () const |
Determines if this literal appeared as a quoted literal in the message. More... | |
Literal (UBool q, const UnicodeString &s) | |
Literal constructor. More... | |
Literal (const Literal &other) | |
Copy constructor. More... | |
Literal & | operator= (Literal) noexcept |
Assignment operator. More... | |
Literal ()=default | |
Default constructor. More... | |
bool | operator< (const Literal &other) const |
Less than operator. More... | |
bool | operator== (const Literal &other) const |
Equality operator. More... | |
virtual | ~Literal () |
Destructor. More... | |
![]() | |
virtual | ~UObject () |
Destructor. More... | |
virtual UClassID | getDynamicClassID () const |
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More... | |
Friends | |
void | swap (Literal &l1, Literal &l2) noexcept |
Non-member swap function. More... | |
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 78 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 119 of file messageformat2_data_model.h.
|
inline |
Copy constructor.
Definition at line 126 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 107 of file messageformat2_data_model.h.
bool icu::message2::data_model::Literal::operator< | ( | const Literal & | other | ) | const |
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.
bool icu::message2::data_model::Literal::operator== | ( | const Literal & | other | ) | const |
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 135 of file messageformat2_data_model.h.