ICU 77.1
77.1
|
C++ API: MessagePattern class: Parses and represents ICU MessageFormat patterns. More...
Go to the source code of this file.
Data Structures | |
class | icu::MessagePattern |
Parses and represents ICU MessageFormat patterns. More... | |
class | icu::MessagePattern::Part |
A message pattern "part", representing a pattern parsing event. More... | |
Namespaces | |
icu | |
File coll.h. | |
Macros | |
#define | UMSGPAT_ARG_TYPE_HAS_PLURAL_STYLE(argType) ((argType)==UMSGPAT_ARG_TYPE_PLURAL || (argType)==UMSGPAT_ARG_TYPE_SELECTORDINAL) |
Returns true if the argument type has a plural style part sequence and semantics, for example UMSGPAT_ARG_TYPE_PLURAL and UMSGPAT_ARG_TYPE_SELECTORDINAL. More... | |
#define | UMSGPAT_NO_NUMERIC_VALUE ((double)(-123456789)) |
Special value that is returned by getNumericValue(Part) when no numeric value is defined for a part. More... | |
Typedefs | |
typedef enum UMessagePatternApostropheMode | UMessagePatternApostropheMode |
typedef enum UMessagePatternPartType | UMessagePatternPartType |
typedef enum UMessagePatternArgType | UMessagePatternArgType |
C++ API: MessagePattern class: Parses and represents ICU MessageFormat patterns.
Definition in file messagepattern.h.
#define UMSGPAT_ARG_TYPE_HAS_PLURAL_STYLE | ( | argType | ) | ((argType)==UMSGPAT_ARG_TYPE_PLURAL || (argType)==UMSGPAT_ARG_TYPE_SELECTORDINAL) |
Returns true if the argument type has a plural style part sequence and semantics, for example UMSGPAT_ARG_TYPE_PLURAL and UMSGPAT_ARG_TYPE_SELECTORDINAL.
Definition at line 272 of file messagepattern.h.
#define UMSGPAT_NO_NUMERIC_VALUE ((double)(-123456789)) |
Special value that is returned by getNumericValue(Part) when no numeric value is defined for a part.
Definition at line 299 of file messagepattern.h.
Definition at line 1 of file messagepattern.h.
typedef enum UMessagePatternArgType UMessagePatternArgType |
Definition at line 1 of file messagepattern.h.
typedef enum UMessagePatternPartType UMessagePatternPartType |
Definition at line 1 of file messagepattern.h.
anonymous enum |
Enumerator | |
---|---|
UMSGPAT_ARG_NAME_NOT_NUMBER | Return value from MessagePattern.validateArgumentName() for when the string is a valid "pattern identifier" but not a number.
|
UMSGPAT_ARG_NAME_NOT_VALID | Return value from MessagePattern.validateArgumentName() for when the string is invalid. It might not be a valid "pattern identifier", or it have only ASCII digits but there is a leading zero or the number is too large.
|
Definition at line 275 of file messagepattern.h.
Mode for when an apostrophe starts quoted literal text for MessageFormat output.
The default is DOUBLE_OPTIONAL unless overridden via uconfig.h (UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE).
A pair of adjacent apostrophes always results in a single apostrophe in the output, even when the pair is between two single, text-quoting apostrophes.
The following table shows examples of desired MessageFormat.format() output with the pattern strings that yield that output.
Desired output | DOUBLE_OPTIONAL | DOUBLE_REQUIRED |
---|---|---|
I see {many} | I see '{many}' | (same) |
I said {'Wow!'} | I said '{''Wow!''}' | (same) |
I don't know | I don't know OR I don''t know | I don''t know |
Enumerator | |
---|---|
UMSGPAT_APOS_DOUBLE_OPTIONAL | A literal apostrophe is represented by either a single or a double apostrophe pattern character. Within a MessageFormat pattern, a single apostrophe only starts quoted literal text if it immediately precedes a curly brace {}, or a pipe symbol | if inside a choice format, or a pound symbol # if inside a plural format. This is the default behavior starting with ICU 4.8.
|
UMSGPAT_APOS_DOUBLE_REQUIRED | A literal apostrophe must be represented by a double apostrophe pattern character. A single apostrophe always starts quoted literal text. This is the behavior of ICU 4.6 and earlier, and of the JDK.
|
Definition at line 70 of file messagepattern.h.