#endif
UBool
-NFRuleSet::parse(const UnicodeString& text, ParsePosition& pos, double upperBound, int32_t nonNumericalExecutedRuleMask, Formattable& result) const
+NFRuleSet::parse(const UnicodeString& text, ParsePosition& pos, double upperBound, uint32_t nonNumericalExecutedRuleMask, Formattable& result) const
{
// try matching each rule in the rule set against the text being
// parsed. Whichever one matches the most characters is the one
void format(int64_t number, UnicodeString& toAppendTo, int32_t pos, int32_t recursionCount, UErrorCode& status) const;
void format(double number, UnicodeString& toAppendTo, int32_t pos, int32_t recursionCount, UErrorCode& status) const;
- UBool parse(const UnicodeString& text, ParsePosition& pos, double upperBound, int32_t nonNumericalExecutedRuleMask, Formattable& result) const;
+ UBool parse(const UnicodeString& text, ParsePosition& pos, double upperBound, uint32_t nonNumericalExecutedRuleMask, Formattable& result) const;
void appendRules(UnicodeString& result) const; // toString
ParsePosition& parsePosition,
UBool isFractionRule,
double upperBound,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& resVal) const
{
// internally we operate on a copy of the string being parsed
const UnicodeString& delimiter,
ParsePosition& pp,
const NFSubstitution* sub,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
double upperBound) const
{
UErrorCode status = U_ZERO_ERROR;
ParsePosition& pos,
UBool isFractional,
double upperBound,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const;
UBool shouldRollBack(int64_t number) const;
int32_t indexOfAnyRulePrefix() const;
double matchToDelimiter(const UnicodeString& text, int32_t startPos, double baseValue,
const UnicodeString& delimiter, ParsePosition& pp, const NFSubstitution* sub,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
double upperBound) const;
void stripPrefix(UnicodeString& text, const UnicodeString& prefix, ParsePosition& pp) const;
double baseValue,
double upperBound,
UBool lenientParse,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const;
virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const {
double baseValue,
double upperBound,
UBool lenientParse,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const;
virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const { return newRuleValue + oldRuleValue; }
double baseValue,
double upperBound,
UBool /*lenientParse*/,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const;
virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const { return newRuleValue / oldRuleValue; }
double baseValue,
double upperBound,
UBool lenientParse,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const
{
#ifdef RBNF_DEBUG
double baseValue,
double upperBound,
UBool lenientParse,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const
{
// if this isn't a >>> substitution, we can just use the
double baseValue,
double /*upperBound*/,
UBool lenientParse,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& resVal) const
{
// if we're not in byDigits mode, we can just use the inherited
double baseValue,
double upperBound,
UBool /*lenientParse*/,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const
{
// we don't have to do anything special to do the parsing here,
double baseValue,
double upperBound,
UBool lenientParse,
- int32_t nonNumericalExecutedRuleMask,
+ uint32_t nonNumericalExecutedRuleMask,
Formattable& result) const;
/**
void IntlTestRBNF::TestParseFailure() {
UErrorCode status = U_ZERO_ERROR;
RuleBasedNumberFormat rbnf(URBNF_SPELLOUT, Locale::getJapanese(), status);
- static const char* testData[][1] = {
- { "\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB\u30FB" },
- { NULL }
+ static const UChar* testData[] = {
+ u"・・・・・・・・・・・・・・・・・・・・・・・・"
};
- for (int i = 0; testData[i][0]; ++i) {
- const char* spelledNumber = testData[i][0]; // spelled-out number
-
- UnicodeString spelledNumberString = UnicodeString(spelledNumber).unescape();
+ for (int i = 0; i < UPRV_LENGTHOF(testData); ++i) {
+ UnicodeString spelledNumberString = UnicodeString(testData[i]).unescape();
Formattable actualNumber;
rbnf.parse(spelledNumberString, actualNumber, status);
if (status != U_INVALID_FORMAT_ERROR) { // I would have expected U_PARSE_ERROR, but NumberFormat::parse gives U_INVALID_FORMAT_ERROR
- errln("FAIL: string should be unparseable %s %s", spelledNumber, u_errorName(status));
+ errln("FAIL: string should be unparseable index=%d %s", i, u_errorName(status));
}
}
}