15 #ifndef __MESSAGEPATTERN_H__
16 #define __MESSAGEPATTERN_H__
25 #if !UCONFIG_NO_FORMATTING
268 #define UMSGPAT_ARG_TYPE_HAS_PLURAL_STYLE(argType) \
269 ((argType)==UMSGPAT_ARG_TYPE_PLURAL || (argType)==UMSGPAT_ARG_TYPE_SELECTORDINAL)
295 #define UMSGPAT_NO_NUMERIC_VALUE ((double)(-123456789))
299 class MessagePatternDoubleList;
300 class MessagePatternPartsList;
540 int32_t hashCode()
const;
576 return hasArgNumbers;
590 static int32_t validateArgumentName(
const UnicodeString &name);
634 return getPart(i).type;
645 return getPart(partIndex).index;
667 return 0==msg.compare(part.index, part.length, s);
676 double getNumericValue(
const Part &part)
const;
684 double getPluralOffset(int32_t pluralStart)
const;
695 int32_t limit=getPart(start).limitPartIndex;
812 return ((type*37+index)*37+length)*37+value;
818 static const int32_t MAX_LENGTH=0xffff;
819 static const int32_t MAX_VALUE=0x7fff;
827 int32_t limitPartIndex;
835 int32_t parseMessage(int32_t index, int32_t msgStartLength,
839 int32_t parseArg(int32_t index, int32_t argStartLength, int32_t nestingLevel,
844 int32_t parseChoiceStyle(int32_t index, int32_t nestingLevel,
858 static int32_t parseArgNumber(
const UnicodeString &s, int32_t start, int32_t limit);
860 int32_t parseArgNumber(int32_t start, int32_t limit) {
861 return parseArgNumber(msg, start, limit);
872 void parseDouble(int32_t start, int32_t limit,
UBool allowInfinity,
878 int32_t skipWhiteSpace(int32_t index);
880 int32_t skipIdentifier(int32_t index);
886 int32_t skipDouble(int32_t index);
890 UBool isChoice(int32_t index);
892 UBool isPlural(int32_t index);
894 UBool isSelect(int32_t index);
896 UBool isOrdinal(int32_t index);
902 UBool inMessageFormatPattern(int32_t nestingLevel);
913 void addLimitPart(int32_t start,
917 void addArgDoublePart(
double numericValue, int32_t start, int32_t length,
UErrorCode &errorCode);
919 void setParseError(
UParseError *parseError, int32_t index);
927 MessagePatternPartsList *partsList;
931 MessagePatternDoubleList *numericValuesList;
932 double *numericValues;
933 int32_t numericValuesLength;
936 UBool needsAutoQuoting;
941 #endif // !UCONFIG_NO_FORMATTING
943 #endif // __MESSAGEPATTERN_H__