15 #ifndef __MESSAGEPATTERN_H__
16 #define __MESSAGEPATTERN_H__
25 #if !UCONFIG_NO_FORMATTING
283 #define UMSGPAT_NO_NUMERIC_VALUE ((double)(-123456789))
287 class MessagePatternDoubleList;
288 class MessagePatternPartsList;
528 int32_t hashCode()
const;
564 return hasArgNumbers;
578 static int32_t validateArgumentName(
const UnicodeString &name);
622 return getPart(i).type;
633 return getPart(partIndex).index;
655 return 0==msg.compare(part.index, part.length, s);
664 double getNumericValue(
const Part &part)
const;
672 double getPluralOffset(int32_t pluralStart)
const;
683 int32_t limit=getPart(start).limitPartIndex;
800 return ((type*37+index)*37+length)*37+value;
806 static const int32_t MAX_LENGTH=0xffff;
807 static const int32_t MAX_VALUE=0x7fff;
815 int32_t limitPartIndex;
823 int32_t parseMessage(int32_t index, int32_t msgStartLength,
827 int32_t parseArg(int32_t index, int32_t argStartLength, int32_t nestingLevel,
846 static int32_t parseArgNumber(
const UnicodeString &s, int32_t start, int32_t limit);
848 int32_t parseArgNumber(int32_t start, int32_t limit) {
849 return parseArgNumber(msg, start, limit);
860 void parseDouble(int32_t start, int32_t limit,
UBool allowInfinity,
866 int32_t skipWhiteSpace(int32_t index);
868 int32_t skipIdentifier(int32_t index);
874 int32_t skipDouble(int32_t index);
878 UBool isChoice(int32_t index);
880 UBool isPlural(int32_t index);
882 UBool isSelect(int32_t index);
888 UBool inMessageFormatPattern(int32_t nestingLevel);
899 void addLimitPart(int32_t start,
903 void addArgDoublePart(
double numericValue, int32_t start, int32_t length,
UErrorCode &errorCode);
905 void setParseError(
UParseError *parseError, int32_t index);
916 MessagePatternPartsList *partsList;
920 MessagePatternDoubleList *numericValuesList;
921 double *numericValues;
922 int32_t numericValuesLength;
925 UBool needsAutoQuoting;
930 #endif // !UCONFIG_NO_FORMATTING
932 #endif // __MESSAGEPATTERN_H__