Home | History | Annotate | Download | only in i18n

Lines Matching refs:pattern

154  * CURRENCY_SIGN is seen in a pattern, then the decimal separator is
209 // pattern in the default locale.
211 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
238 construct(status, parseError, &pattern);
243 // pattern and the number format symbols in the default locale. The
246 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
276 construct(status, parseError, &pattern, symbolsToAdopt);
279 DecimalFormat::DecimalFormat( const UnicodeString& pattern,
309 construct(status,parseErr, &pattern, symbolsToAdopt);
313 // pattern and the number format symbols in the default locale. The
316 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
344 construct(status, parseError, &pattern, new DecimalFormatSymbols(symbols));
349 // pattern, the number format symbols, and the number format style.
352 DecimalFormat::DecimalFormat(const UnicodeString& pattern,
381 construct(status, parseError, &pattern, symbolsToAdopt);
386 // pattern and the number format symbols in the desired locale. The
392 const UnicodeString* pattern,
425 // Uses the default locale's number format pattern if there isn't
427 if (pattern == NULL)
435 pattern = &str;
444 if (pattern->indexOf((UChar)kCurrencySign) >= 0) {
445 // If it looks like we are going to use a currency pattern
454 // apply pattern
461 // the pattern used in format is not fixed until formatting,
463 // will be used to pick the right pattern based on plural count.
464 // Here, set the pattern as the pattern of plural count == "other".
466 // plural count. If not, the right pattern need to be re-applied
474 patternUsed = pattern;
570 DecimalFormat::setupCurrencyAffixes(const UnicodeString& pattern,
584 applyPatternWithoutExpandAffix(pattern, false, parseErr, status);
1406 // The exponent is output using the pattern-specified minimum
1842 // First, parse against current pattern.
1843 // Since current pattern could be set by applyPattern(),
1844 // it could be an arbitrary pattern, and it may not be the one
2198 // "x" with pattern "#0.00" (return index and error index both 0)
2199 // parse "$" with pattern "$#0.00". (return index 0 and error index
2270 * the input. Pattern white space and input white space are
2276 * @param affixPat affix pattern used for currency affix comparison.
2325 * the input. Pattern white space and input white space are
2327 * @param affix pattern string, taken as a literal
2340 // We may have a pattern like: \u200F \u0020
2344 // match of the run of RULE whitespace in the pattern,
2362 // Advance over run in pattern
2374 // If we skip UWhiteSpace in the input text, we need to skip it in the pattern.
2423 * @param affixPat pattern string
2631 // only setup the affixes of the plural pattern.
2686 // Gets the positive prefix of the number pattern.
2696 // Sets the positive prefix of the number pattern.
2707 // Gets the negative prefix of the number pattern.
2717 // Gets the negative prefix of the number pattern.
2728 // Gets the positive suffix of the number pattern.
2738 // Sets the positive suffix of the number pattern.
2749 // Gets the negative suffix of the number pattern.
2759 // Sets the negative suffix of the number pattern.
2770 // Gets the multiplier of the number pattern.
2778 // Sets the multiplier of the number pattern.
3029 // Gets the grouping size of the number pattern. For example, thousand or 10
3039 // Gets the grouping size of the number pattern.
3082 // Emits the pattern of this DecimalFormat instance.
3091 // Emits the localized pattern this DecimalFormat instance.
3102 * Expand the affix pattern strings into the expanded affix strings. If any
3103 * affix pattern string is null, do not expand it. This method should be
3140 void DecimalFormat::expandAffix(const UnicodeString& pattern,
3146 expandAffix(pattern, affix, number, NULL, doFormat, pluralCount);
3150 * Expand an affix pattern into an affix string. All characters in the
3151 * pattern are literal unless prefixed by kQuote. The following characters
3159 * itself at the end of the pattern.
3170 * in this locale is a ChoiceFormat pattern (very rare). It only does this
3173 * @param pattern the non-null, fPossibly empty pattern
3174 * @param affix string to receive the expanded equivalent of pattern.
3176 * @param doFormat if false, then the pattern will be expanded, and if a
3188 void DecimalFormat::expandAffix(const UnicodeString& pattern,
3195 for (int i=0; i<pattern.length(); ) {
3196 UChar32 c = pattern.char32At(i);
3199 c = pattern.char32At(i);
3209 UBool intl = i<pattern.length() &&
3210 pattern.char32At(i) == kCurrencySign;
3214 plural = i<pattern.length() &&
3215 pattern.char32At(i) == kCurrencySign;
3282 // pattern. We use the CURRENCY_SIGN as a
3370 // else someone called a function that reset the pattern.
3434 * Appends an affix pattern to the given StringBuffer, quoting special
3435 * characters as needed. Uses the internal affix pattern, if that exists,
3436 * or the literal affix, if the internal affix pattern is null. The
3437 * appended string will generate the same affix pattern (or literal affix)
3441 * @param affixPattern a pattern such as fPosPrefixPattern; may be null
3445 * @param localized true if the appended pattern should contain localized
3446 * pattern characters; otherwise, non-localized pattern chars are appended
3561 // the prefix or suffix pattern might not be defined yet,
3564 // but it might not be the actual pattern used in formatting.
3565 // the actual pattern used in formatting depends on the
3793 DecimalFormat::applyPattern(const UnicodeString& pattern, UErrorCode& status)
3796 applyPattern(pattern, FALSE, parseError, status);
3802 DecimalFormat::applyPattern(const UnicodeString& pattern,
3806 applyPattern(pattern, FALSE, parseError, status);
3811 DecimalFormat::applyLocalizedPattern(const UnicodeString& pattern, UErrorCode& status)
3814 applyPattern(pattern, TRUE,parseError,status);
3820 DecimalFormat::applyLocalizedPattern(const UnicodeString& pattern,
3824 applyPattern(pattern, TRUE,parseError,status);
3830 DecimalFormat::applyPatternWithoutExpandAffix(const UnicodeString& pattern,
3843 // Set the significant pattern symbols
3877 int32_t patLen = pattern.length();
3878 // Part 0 is the positive pattern. Part 1, if present, is the negative
3879 // pattern.
3881 // The subpart ranges from 0 to 4: 0=pattern proper, 1=prefix,
3883 // between the prefix and suffix, and consists of pattern
3917 ch = pattern.char32At(pos);
3919 case 0: // Pattern proper subpart (between prefix & suffix)
3922 // to occur in the pattern ####00.00####, and we record the
3929 if (pattern.compare(pos, digitLen, digit) == 0) {
3945 syntaxError(pattern,pos,parseError);
3963 } else if (pattern.compare(pos, groupSepLen, groupingSeparator) == 0) {
3968 syntaxError(pattern,pos,parseError);
3974 } else if (pattern.compare(pos, decimalSepLen, decimalSeparator) == 0) {
3979 syntaxError(pattern,pos,parseError);
3984 // at this point. We check pattern syntax below.
3988 if (pattern.compare(pos, exponent.length(), exponent) == 0) {
3993 syntaxError(pattern,pos,parseError);
3997 // Grouping separator in exponential pattern
3998 debug("Grouping separator in exponential pattern")
4000 syntaxError(pattern,pos,parseError);
4006 && pattern.compare(pos, plus.length(), plus) == 0) {
4011 // pattern, then jump into suffix subpart.
4014 pattern.char32At(pos) == zeroDigit) {
4019 // 1. Require at least one mantissa pattern digit
4021 // 3. Require at least one exponent pattern digit
4026 // Malformed exponential pattern
4027 debug("Malformed exponential pattern")
4029 syntaxError(pattern,pos,parseError);
4049 if (!pattern.compare(pos, digitLen, digit) ||
4050 !pattern.compare(pos, groupSepLen, groupingSeparator) ||
4051 !pattern.compare(pos, decimalSepLen, decimalSeparator) ||
4055 subpart = 0; // pattern proper subpart
4060 syntaxError(pattern,pos,parseError);
4068 if ((pos+1) < pattern.length() && pattern[pos+1] == kCurrencySign) {
4071 if ((pos+1) < pattern.length() &&
4072 pattern[pos+1] == kCurrencySign) {
4089 if (pos < pattern.length() && pattern[pos] == kQuote) {
4096 } else if (pattern.compare(pos, separator.length(), separator) == 0) {
4098 // separators in the second pattern (part == 1).
4103 syntaxError(pattern,pos,parseError);
4110 } else if (pattern.compare(pos, percent.length(), percent) == 0) {
4116 syntaxError(pattern,pos,parseError);
4120 affix->append(kPatternPercent); // Use unlocalized pattern char
4124 } else if (pattern.compare(pos, perMill.length(), perMill) == 0) {
4130 syntaxError(pattern,pos,parseError);
4134 affix->append(kPatternPerMill); // Use unlocalized pattern char
4138 } else if (pattern.compare(pos, padEscape.length(), padEscape) == 0) {
4140 (pos+1) == pattern.length()) { // Nothing after padEscape
4143 syntaxError(pattern,pos,parseError);
4148 padChar = pattern.char32At(pos);
4151 } else if (pattern.compare(pos, minus.length(), minus) == 0) {
4156 } else if (pattern.compare(pos, plus.length(), plus) == 0) {
4175 if (pos < pattern.length() && pattern[pos] == kQuote) {
4190 sub0Limit = pattern.length();
4194 sub2Limit = pattern.length();
4197 /* Handle patterns with no '0' pattern character. These patterns
4233 syntaxError(pattern,pos,parseError);
4251 syntaxError(pattern,pos,parseError);
4359 if (pattern.length() == 0) {
4402 // If there was no negative pattern, or if the negative pattern is
4403 // identical to the positive pattern, then prepend the minus sign to the
4404 // positive pattern to form the negative pattern.
4424 s.append("\"").append(pattern).append("\"->");
4428 // save the pattern
4429 fFormatPattern = pattern;
4446 DecimalFormat::applyPattern(const UnicodeString& pattern,
4452 // apply pattern again.
4453 if (pattern.indexOf(kCurrencySign) != -1) {
4461 if (pattern.indexOf(fgTripleCurrencySign) != -1) {
4462 // only setup the affixes of the current pattern.
4463 setupCurrencyAffixes(pattern, TRUE, FALSE, status);
4466 applyPatternWithoutExpandAffix(pattern, localized, parseError, status);
4473 const UnicodeString& pattern,
4477 applyPatternWithoutExpandAffix(pattern, localized, parseError, status);
4598 // set the currency after apply pattern to get the correct rounding/fraction