15 #ifndef __MESSAGEPATTERN_H__
16 #define __MESSAGEPATTERN_H__
25 #if !UCONFIG_NO_FORMATTING
250 #ifndef U_HIDE_DRAFT_API
264 #ifndef U_HIDE_DRAFT_API
270 #define UMSGPAT_ARG_TYPE_HAS_PLURAL_STYLE(argType) \
271 ((argType)==UMSGPAT_ARG_TYPE_PLURAL || (argType)==UMSGPAT_ARG_TYPE_SELECTORDINAL)
298 #define UMSGPAT_NO_NUMERIC_VALUE ((double)(-123456789))
302 class MessagePatternDoubleList;
303 class MessagePatternPartsList;
543 int32_t hashCode()
const;
579 return hasArgNumbers;
593 static int32_t validateArgumentName(
const UnicodeString &name);
637 return getPart(i).type;
648 return getPart(partIndex).index;
670 return 0==msg.compare(part.index, part.length, s);
679 double getNumericValue(
const Part &part)
const;
687 double getPluralOffset(int32_t pluralStart)
const;
698 int32_t limit=getPart(start).limitPartIndex;
815 return ((type*37+index)*37+length)*37+value;
821 static const int32_t MAX_LENGTH=0xffff;
822 static const int32_t MAX_VALUE=0x7fff;
830 int32_t limitPartIndex;
838 int32_t parseMessage(int32_t index, int32_t msgStartLength,
842 int32_t parseArg(int32_t index, int32_t argStartLength, int32_t nestingLevel,
847 int32_t parseChoiceStyle(int32_t index, int32_t nestingLevel,
861 static int32_t parseArgNumber(
const UnicodeString &s, int32_t start, int32_t limit);
863 int32_t parseArgNumber(int32_t start, int32_t limit) {
864 return parseArgNumber(msg, start, limit);
875 void parseDouble(int32_t start, int32_t limit,
UBool allowInfinity,
881 int32_t skipWhiteSpace(int32_t index);
883 int32_t skipIdentifier(int32_t index);
889 int32_t skipDouble(int32_t index);
893 UBool isChoice(int32_t index);
895 UBool isPlural(int32_t index);
897 UBool isSelect(int32_t index);
899 UBool isOrdinal(int32_t index);
905 UBool inMessageFormatPattern(int32_t nestingLevel);
916 void addLimitPart(int32_t start,
920 void addArgDoublePart(
double numericValue, int32_t start, int32_t length,
UErrorCode &errorCode);
922 void setParseError(
UParseError *parseError, int32_t index);
930 MessagePatternPartsList *partsList;
934 MessagePatternDoubleList *numericValuesList;
935 double *numericValues;
936 int32_t numericValuesLength;
939 UBool needsAutoQuoting;
944 #endif // !UCONFIG_NO_FORMATTING
946 #endif // __MESSAGEPATTERN_H__