LEFT | RIGHT |
(no file at all) | |
1 // © 2016 and later: Unicode, Inc. and others. | 1 // © 2016 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html | 2 // License & terms of use: http://www.unicode.org/copyright.html |
3 /* | 3 /* |
4 ******************************************************************************* | 4 ******************************************************************************* |
5 * Copyright (C) 1997-2015, International Business Machines Corporation and * | 5 * Copyright (C) 1997-2015, International Business Machines Corporation and * |
6 * others. All Rights Reserved. * | 6 * others. All Rights Reserved. * |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 */ | 8 */ |
9 | 9 |
10 #include "uassert.h" | 10 #include "uassert.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // for pre-context | 44 // for pre-context |
45 int32_t start = (pos < U_PARSE_CONTEXT_LEN)? 0 : (pos - (U_PARSE_CONTEXT_LEN
-1 | 45 int32_t start = (pos < U_PARSE_CONTEXT_LEN)? 0 : (pos - (U_PARSE_CONTEXT_LEN
-1 |
46 /* subtract 1 so th
at we have room for null*/)); | 46 /* subtract 1 so th
at we have room for null*/)); |
47 int32_t stop = pos; | 47 int32_t stop = pos; |
48 pattern.extract(start,stop-start,parseError.preContext,0); | 48 pattern.extract(start,stop-start,parseError.preContext,0); |
49 //null terminate the buffer | 49 //null terminate the buffer |
50 parseError.preContext[stop-start] = 0; | 50 parseError.preContext[stop-start] = 0; |
51 | 51 |
52 //for post-context | 52 //for post-context |
53 start = pos+1; | 53 start = pattern.moveIndex32(pos, 1); |
54 stop = ((pos+U_PARSE_CONTEXT_LEN)<=pattern.length()) ? (pos+(U_PARSE_CONTEX
T_LEN-1)) : | 54 stop = pos + U_PARSE_CONTEXT_LEN - 1; |
55 pattern.length(); | 55 if (stop > pattern.length()) { |
56 pattern.extract(start,stop-start,parseError.postContext,0); | 56 stop = pattern.length(); |
| 57 } |
| 58 pattern.extract(start, stop - start, parseError.postContext, 0); |
57 //null terminate the buffer | 59 //null terminate the buffer |
58 parseError.postContext[stop-start]= 0; | 60 parseError.postContext[stop-start]= 0; |
59 } | 61 } |
60 | 62 |
61 DecimalFormatPattern::DecimalFormatPattern() | 63 DecimalFormatPattern::DecimalFormatPattern() |
62 : fMinimumIntegerDigits(1), | 64 : fMinimumIntegerDigits(1), |
63 fMaximumIntegerDigits(gDefaultMaxIntegerDigits), | 65 fMaximumIntegerDigits(gDefaultMaxIntegerDigits), |
64 fMinimumFractionDigits(0), | 66 fMinimumFractionDigits(0), |
65 fMaximumFractionDigits(3), | 67 fMaximumFractionDigits(3), |
66 fUseSignificantDigits(FALSE), | 68 fUseSignificantDigits(FALSE), |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 out.fPosSuffixPattern, out.fPosSuffixAffix, status); | 647 out.fPosSuffixPattern, out.fPosSuffixAffix, status); |
646 AffixPattern::parseAffixString( | 648 AffixPattern::parseAffixString( |
647 out.fNegPrefixPattern, out.fNegPrefixAffix, status); | 649 out.fNegPrefixPattern, out.fNegPrefixAffix, status); |
648 AffixPattern::parseAffixString( | 650 AffixPattern::parseAffixString( |
649 out.fPosPrefixPattern, out.fPosPrefixAffix, status); | 651 out.fPosPrefixPattern, out.fPosPrefixAffix, status); |
650 } | 652 } |
651 | 653 |
652 U_NAMESPACE_END | 654 U_NAMESPACE_END |
653 | 655 |
654 #endif /* !UCONFIG_NO_FORMATTING */ | 656 #endif /* !UCONFIG_NO_FORMATTING */ |
LEFT | RIGHT |