Home | History | Annotate | Download | only in i18n

Lines Matching refs:pattern

91  * every currency format pattern,
92 * including the pattern of default currecny style
96 // negative prefix pattern
98 // negative suffix pattern
100 // positive prefix pattern
102 // positive suffix pattern
119 /* affix for currency formatting when the currency sign in the pattern
120 * equals to 3, such as the pattern contains 3 currency sign or
233 * CURRENCY_SIGN is seen in a pattern, then the decimal separator is
270 // pattern in the default locale.
272 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
276 construct(status, parseError, &pattern);
281 // pattern and the number format symbols in the default locale. The
284 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
291 construct(status, parseError, &pattern, symbolsToAdopt);
294 DecimalFormat::DecimalFormat( const UnicodeString& pattern,
301 construct(status,parseErr, &pattern, symbolsToAdopt);
306 // pattern and the number format symbols in the default locale. The
309 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
314 construct(status, parseError, &pattern, new DecimalFormatSymbols(symbols));
319 // pattern, the number format symbols, and the number format style.
322 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
329 construct(status, parseError, &pattern, symbolsToAdopt);
381 // pattern and the number format symbols in the desired locale. The
387 const UnicodeString* pattern,
424 // Uses the default locale's number format pattern if there isn't
426 if (pattern == NULL)
443 pattern = &str;
455 if (pattern->indexOf((UChar)kCurrencySign) >= 0) {
456 // If it looks like we are going to use a currency pattern
465 // apply pattern
472 // the pattern used in format is not fixed until formatting,
474 // will be used to pick the right pattern based on plural count.
475 // Here, set the pattern as the pattern of plural count == "other".
477 // plural count. If not, the right pattern need to be re-applied
485 patternUsed = pattern;
602 DecimalFormat::setupCurrencyAffixes(const UnicodeString& pattern,
616 applyPatternWithoutExpandAffix(pattern, false, parseErr, status);
1609 // The exponent is output using the pattern-specified minimum
1993 // First, parse against current pattern.
1994 // Since current pattern could be set by applyPattern(),
1995 // it could be an arbitrary pattern, and it may not be the one
2591 // "x" with pattern "#0.00" (return index and error index both 0)
2592 // parse "$" with pattern "$#0.00". (return index 0 and error index
2701 * the input. Pattern white space and input white space are
2707 * @param affixPat affix pattern used for currency affix comparison.
2756 * the input. Pattern white space and input white space are
2758 * @param affix pattern string, taken as a literal
2790 // We may have a pattern like: \u200F \u0020
2794 // match of the run of Pattern_White_Space in the pattern,
2812 // Advance over run in pattern
2824 // If we skip UWhiteSpace in the input text, we need to skip it in the pattern.
2906 * @param affixPat pattern string
3173 // only setup the affixes of the plural pattern.
3237 // Gets the positive prefix of the number pattern.
3247 // Sets the positive prefix of the number pattern.
3261 // Gets the negative prefix of the number pattern.
3271 // Gets the negative prefix of the number pattern.
3285 // Gets the positive suffix of the number pattern.
3295 // Sets the positive suffix of the number pattern.
3309 // Gets the negative suffix of the number pattern.
3319 // Sets the negative suffix of the number pattern.
3333 // Gets the multiplier of the number pattern.
3349 // Sets the multiplier of the number pattern.
3636 // Gets the grouping size of the number pattern. For example, thousand or 10
3646 // Gets the grouping size of the number pattern.
3698 // Emits the pattern of this DecimalFormat instance.
3707 // Emits the localized pattern this DecimalFormat instance.
3717 * Expand the affix pattern strings into the expanded affix strings. If any
3718 * affix pattern string is null, do not expand it. This method should be
3757 * Expand an affix pattern into an affix string. All characters in the
3758 * pattern are literal unless prefixed by kQuote. The following characters
3766 * itself at the end of the pattern.
3777 * in this locale is a ChoiceFormat pattern (very rare). It only does this
3780 * @param pattern the non-null, fPossibly empty pattern
3781 * @param affix string to receive the expanded equivalent of pattern.
3783 * @param doFormat if false, then the pattern will be expanded, and if a
3795 void DecimalFormat::expandAffix(const UnicodeString& pattern,
3802 for (int i=0; i<pattern.length(); ) {
3803 UChar32 c = pattern.char32At(i);
3806 c = pattern.char32At(i);
3816 UBool intl = i<pattern.length() &&
3817 pattern.char32At(i) == kCurrencySign;
3821 plural = i<pattern.length() &&
3822 pattern.char32At(i) == kCurrencySign;
3885 // pattern. We use the CURRENCY_SIGN as a
3968 // else someone called a function that reset the pattern.
4034 * Appends an affix pattern to the given StringBuffer, quoting special
4035 * characters as needed. Uses the internal affix pattern, if that exists,
4036 * or the literal affix, if the internal affix pattern is null. The
4037 * appended string will generate the same affix pattern (or literal affix)
4041 * @param affixPattern a pattern such as fPosPrefixPattern; may be null
4045 * @param localized true if the appended pattern should contain localized
4046 * pattern characters; otherwise, non-localized pattern chars are appended
4161 // the prefix or suffix pattern might not be defined yet,
4164 // but it might not be the actual pattern used in formatting.
4165 // the actual pattern used in formatting depends on the
4393 DecimalFormat::applyPattern(const UnicodeString& pattern, UErrorCode& status)
4396 applyPattern(pattern, FALSE, parseError, status);
4402 DecimalFormat::applyPattern(const UnicodeString& pattern,
4406 applyPattern(pattern, FALSE, parseError, status);
4411 DecimalFormat::applyLocalizedPattern(const UnicodeString& pattern, UErrorCode& status)
4414 applyPattern(pattern, TRUE,parseError,status);
4420 DecimalFormat::applyLocalizedPattern(const UnicodeString& pattern,
4424 applyPattern(pattern, TRUE,parseError,status);
4430 DecimalFormat::applyPatternWithoutExpandAffix(const UnicodeString& pattern,
4443 // Set the significant pattern symbols
4477 int32_t patLen = pattern.length();
4478 // Part 0 is the positive pattern. Part 1, if present, is the negative
4479 // pattern.
4481 // The subpart ranges from 0 to 4: 0=pattern proper, 1=prefix,
4483 // between the prefix and suffix, and consists of pattern
4517 ch = pattern.char32At(pos);
4519 case 0: // Pattern proper subpart (between prefix & suffix)
4522 // to occur in the pattern ####00.00####, and we record the
4529 if (pattern.compare(pos, digitLen, digit) == 0) {
4545 syntaxError(pattern,pos,parseError);
4563 } else if (pattern.compare(pos, groupSepLen, groupingSeparator) == 0) {
4568 syntaxError(pattern,pos,parseError);
4574 } else if (pattern.compare(pos, decimalSepLen, decimalSeparator) == 0) {
4579 syntaxError(pattern,pos,parseError);
4584 // at this point. We check pattern syntax below.
4588 if (pattern.compare(pos, exponent.length(), exponent) == 0) {
4593 syntaxError(pattern,pos,parseError);
4597 // Grouping separator in exponential pattern
4598 debug("Grouping separator in exponential pattern")
4600 syntaxError(pattern,pos,parseError);
4606 && pattern.compare(pos, plus.length(), plus) == 0) {
4611 // pattern, then jump into suffix subpart.
4614 pattern.char32At(pos) == zeroDigit) {
4619 // 1. Require at least one mantissa pattern digit
4621 // 3. Require at least one exponent pattern digit
4626 // Malformed exponential pattern
4627 debug("Malformed exponential pattern")
4629 syntaxError(pattern,pos,parseError);
4649 if (!pattern.compare(pos, digitLen, digit) ||
4650 !pattern.compare(pos, groupSepLen, groupingSeparator) ||
4651 !pattern.compare(pos, decimalSepLen, decimalSeparator) ||
4655 subpart = 0; // pattern proper subpart
4660 syntaxError(pattern,pos,parseError);
4668 if ((pos+1) < pattern.length() && pattern[pos+1] == kCurrencySign) {
4671 if ((pos+1) < pattern.length() &&
4672 pattern[pos+1] == kCurrencySign) {
4689 if (pos < pattern.length() && pattern[pos] == kQuote) {
4696 } else if (pattern.compare(pos, separator.length(), separator) == 0) {
4698 // separators in the second pattern (part == 1).
4703 syntaxError(pattern,pos,parseError);
4710 } else if (pattern.compare(pos, percent.length(), percent) == 0) {
4716 syntaxError(pattern,pos,parseError);
4720 affix->append(kPatternPercent); // Use unlocalized pattern char
4724 } else if (pattern.compare(pos, perMill.length(), perMill) == 0) {
4730 syntaxError(pattern,pos,parseError);
4734 affix->append(kPatternPerMill); // Use unlocalized pattern char
4738 } else if (pattern.compare(pos, padEscape.length(), padEscape) == 0) {
4740 (pos+1) == pattern.length()) { // Nothing after padEscape
4743 syntaxError(pattern,pos,parseError);
4748 padChar = pattern.char32At(pos);
4751 } else if (pattern.compare(pos, minus.length(), minus) == 0) {
4756 } else if (pattern.compare(pos, plus.length(), plus) == 0) {
4775 if (pos < pattern.length() && pattern[pos] == kQuote) {
4790 sub0Limit = pattern.length();
4794 sub2Limit = pattern.length();
4797 /* Handle patterns with no '0' pattern character. These patterns
4833 syntaxError(pattern,pos,parseError);
4851 syntaxError(pattern,pos,parseError);
4958 if (pattern.length() == 0) {
5001 // If there was no negative pattern, or if the negative pattern is
5002 // identical to the positive pattern, then prepend the minus sign to the
5003 // positive pattern to form the negative pattern.
5023 s.append((UnicodeString)"\"").append(pattern).append((UnicodeString)"\"->");
5027 // save the pattern
5028 fFormatPattern = pattern;
5045 DecimalFormat::applyPattern(const UnicodeString& pattern,
5051 // apply pattern again.
5052 if (pattern.indexOf(kCurrencySign) != -1) {
5060 if (pattern.indexOf(fgTripleCurrencySign, 3, 0) != -1) {
5061 // only setup the affixes of the current pattern.
5062 setupCurrencyAffixes(pattern, TRUE, FALSE, status);
5065 applyPatternWithoutExpandAffix(pattern, localized, parseError, status);
5075 const UnicodeString& pattern,
5079 applyPatternWithoutExpandAffix(pattern, localized, parseError, status);
5227 // set the currency after apply pattern to get the correct rounding/fraction