15 #ifndef __MESSAGEPATTERN_H__
16 #define __MESSAGEPATTERN_H__
25 #if !UCONFIG_NO_FORMATTING
267 #define UMSGPAT_ARG_TYPE_HAS_PLURAL_STYLE(argType) \
268 ((argType)==UMSGPAT_ARG_TYPE_PLURAL || (argType)==UMSGPAT_ARG_TYPE_SELECTORDINAL)
294 #define UMSGPAT_NO_NUMERIC_VALUE ((double)(-123456789))
298 class MessagePatternDoubleList;
299 class MessagePatternPartsList;
539 int32_t hashCode()
const;
575 return hasArgNumbers;
589 static int32_t validateArgumentName(
const UnicodeString &name);
633 return getPart(i).type;
644 return getPart(partIndex).index;
666 return 0==msg.compare(part.index, part.length, s);
675 double getNumericValue(
const Part &part)
const;
683 double getPluralOffset(int32_t pluralStart)
const;
694 int32_t limit=getPart(start).limitPartIndex;
811 return ((type*37+index)*37+length)*37+value;
817 static const int32_t MAX_LENGTH=0xffff;
818 static const int32_t MAX_VALUE=0x7fff;
826 int32_t limitPartIndex;
834 int32_t parseMessage(int32_t index, int32_t msgStartLength,
838 int32_t parseArg(int32_t index, int32_t argStartLength, int32_t nestingLevel,
843 int32_t parseChoiceStyle(int32_t index, int32_t nestingLevel,
857 static int32_t parseArgNumber(
const UnicodeString &s, int32_t start, int32_t limit);
859 int32_t parseArgNumber(int32_t start, int32_t limit) {
860 return parseArgNumber(msg, start, limit);
871 void parseDouble(int32_t start, int32_t limit,
UBool allowInfinity,
877 int32_t skipWhiteSpace(int32_t index);
879 int32_t skipIdentifier(int32_t index);
885 int32_t skipDouble(int32_t index);
889 UBool isChoice(int32_t index);
891 UBool isPlural(int32_t index);
893 UBool isSelect(int32_t index);
895 UBool isOrdinal(int32_t index);
901 UBool inMessageFormatPattern(int32_t nestingLevel);
912 void addLimitPart(int32_t start,
916 void addArgDoublePart(
double numericValue, int32_t start, int32_t length,
UErrorCode &errorCode);
918 void setParseError(
UParseError *parseError, int32_t index);
929 MessagePatternPartsList *partsList;
933 MessagePatternDoubleList *numericValuesList;
934 double *numericValues;
935 int32_t numericValuesLength;
938 UBool needsAutoQuoting;
943 #endif // !UCONFIG_NO_FORMATTING
945 #endif // __MESSAGEPATTERN_H__