OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * Copyright (C) 1997-2014, International Business Machines Corporation and | 3 * Copyright (C) 1997-2015, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 ******************************************************************************* | 5 ******************************************************************************* |
6 * | 6 * |
7 * File DCFMTSYM.CPP | 7 * File DCFMTSYM.CPP |
8 * | 8 * |
9 * Modification History: | 9 * Modification History: |
10 * | 10 * |
11 * Date Name Description | 11 * Date Name Description |
12 * 02/19/97 aliu Converted from java. | 12 * 02/19/97 aliu Converted from java. |
13 * 03/18/97 clhuang Implemented with C++ APIs. | 13 * 03/18/97 clhuang Implemented with C++ APIs. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // fastCopyFrom is safe, see docs on fSymbols | 119 // fastCopyFrom is safe, see docs on fSymbols |
120 fSymbols[(ENumberFormatSymbol)i].fastCopyFrom(rhs.fSymbols[(ENumberF
ormatSymbol)i]); | 120 fSymbols[(ENumberFormatSymbol)i].fastCopyFrom(rhs.fSymbols[(ENumberF
ormatSymbol)i]); |
121 } | 121 } |
122 for(int32_t i = 0; i < (int32_t)UNUM_CURRENCY_SPACING_COUNT; ++i) { | 122 for(int32_t i = 0; i < (int32_t)UNUM_CURRENCY_SPACING_COUNT; ++i) { |
123 currencySpcBeforeSym[i].fastCopyFrom(rhs.currencySpcBeforeSym[i]); | 123 currencySpcBeforeSym[i].fastCopyFrom(rhs.currencySpcBeforeSym[i]); |
124 currencySpcAfterSym[i].fastCopyFrom(rhs.currencySpcAfterSym[i]); | 124 currencySpcAfterSym[i].fastCopyFrom(rhs.currencySpcAfterSym[i]); |
125 } | 125 } |
126 locale = rhs.locale; | 126 locale = rhs.locale; |
127 uprv_strcpy(validLocale, rhs.validLocale); | 127 uprv_strcpy(validLocale, rhs.validLocale); |
128 uprv_strcpy(actualLocale, rhs.actualLocale); | 128 uprv_strcpy(actualLocale, rhs.actualLocale); |
| 129 fIsCustomCurrencySymbol = rhs.fIsCustomCurrencySymbol; |
| 130 fIsCustomIntlCurrencySymbol = rhs.fIsCustomIntlCurrencySymbol; |
129 } | 131 } |
130 return *this; | 132 return *this; |
131 } | 133 } |
132 | 134 |
133 // ------------------------------------- | 135 // ------------------------------------- |
134 | 136 |
135 UBool | 137 UBool |
136 DecimalFormatSymbols::operator==(const DecimalFormatSymbols& that) const | 138 DecimalFormatSymbols::operator==(const DecimalFormatSymbols& that) const |
137 { | 139 { |
138 if (this == &that) { | 140 if (this == &that) { |
139 return TRUE; | 141 return TRUE; |
140 } | 142 } |
| 143 if (fIsCustomCurrencySymbol != that.fIsCustomCurrencySymbol) { |
| 144 return FALSE; |
| 145 } |
| 146 if (fIsCustomIntlCurrencySymbol != that.fIsCustomIntlCurrencySymbol) { |
| 147 return FALSE; |
| 148 } |
141 for(int32_t i = 0; i < (int32_t)kFormatSymbolCount; ++i) { | 149 for(int32_t i = 0; i < (int32_t)kFormatSymbolCount; ++i) { |
142 if(fSymbols[(ENumberFormatSymbol)i] != that.fSymbols[(ENumberFormatSymbo
l)i]) { | 150 if(fSymbols[(ENumberFormatSymbol)i] != that.fSymbols[(ENumberFormatSymbo
l)i]) { |
143 return FALSE; | 151 return FALSE; |
144 } | 152 } |
145 } | 153 } |
146 for(int32_t i = 0; i < (int32_t)UNUM_CURRENCY_SPACING_COUNT; ++i) { | 154 for(int32_t i = 0; i < (int32_t)UNUM_CURRENCY_SPACING_COUNT; ++i) { |
147 if(currencySpcBeforeSym[i] != that.currencySpcBeforeSym[i]) { | 155 if(currencySpcBeforeSym[i] != that.currencySpcBeforeSym[i]) { |
148 return FALSE; | 156 return FALSE; |
149 } | 157 } |
150 if(currencySpcAfterSym[i] != that.currencySpcAfterSym[i]) { | 158 if(currencySpcAfterSym[i] != that.currencySpcAfterSym[i]) { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 fSymbols[kIntlCurrencySymbol].setTo(TRUE, INTL_CURRENCY_SYMBOL_STR, 2); | 423 fSymbols[kIntlCurrencySymbol].setTo(TRUE, INTL_CURRENCY_SYMBOL_STR, 2); |
416 fSymbols[kMonetarySeparatorSymbol] = (UChar)0x2e; // '.' monetary decimal
separator | 424 fSymbols[kMonetarySeparatorSymbol] = (UChar)0x2e; // '.' monetary decimal
separator |
417 fSymbols[kExponentialSymbol] = (UChar)0x45; // 'E' exponential | 425 fSymbols[kExponentialSymbol] = (UChar)0x45; // 'E' exponential |
418 fSymbols[kPerMillSymbol] = (UChar)0x2030; // '%o' per mill | 426 fSymbols[kPerMillSymbol] = (UChar)0x2030; // '%o' per mill |
419 fSymbols[kPadEscapeSymbol] = (UChar)0x2a; // '*' pad escape symbol | 427 fSymbols[kPadEscapeSymbol] = (UChar)0x2a; // '*' pad escape symbol |
420 fSymbols[kInfinitySymbol] = (UChar)0x221e; // 'oo' infinite | 428 fSymbols[kInfinitySymbol] = (UChar)0x221e; // 'oo' infinite |
421 fSymbols[kNaNSymbol] = (UChar)0xfffd; // SUB NaN | 429 fSymbols[kNaNSymbol] = (UChar)0xfffd; // SUB NaN |
422 fSymbols[kSignificantDigitSymbol] = (UChar)0x0040; // '@' significant digit | 430 fSymbols[kSignificantDigitSymbol] = (UChar)0x0040; // '@' significant digit |
423 fSymbols[kMonetaryGroupingSeparatorSymbol].remove(); // | 431 fSymbols[kMonetaryGroupingSeparatorSymbol].remove(); // |
424 fSymbols[kExponentMultiplicationSymbol] = (UChar)0xd7; // 'x' multiplication
symbol for exponents | 432 fSymbols[kExponentMultiplicationSymbol] = (UChar)0xd7; // 'x' multiplication
symbol for exponents |
| 433 fIsCustomCurrencySymbol = FALSE; |
| 434 fIsCustomIntlCurrencySymbol = FALSE; |
| 435 |
425 } | 436 } |
426 | 437 |
427 Locale | 438 Locale |
428 DecimalFormatSymbols::getLocale(ULocDataLocaleType type, UErrorCode& status) con
st { | 439 DecimalFormatSymbols::getLocale(ULocDataLocaleType type, UErrorCode& status) con
st { |
429 U_LOCALE_BASED(locBased, *this); | 440 U_LOCALE_BASED(locBased, *this); |
430 return locBased.getLocale(type, status); | 441 return locBased.getLocale(type, status); |
431 } | 442 } |
432 | 443 |
433 const UnicodeString& | 444 const UnicodeString& |
434 DecimalFormatSymbols::getPatternForCurrencySpacing(UCurrencySpacing type, | 445 DecimalFormatSymbols::getPatternForCurrencySpacing(UCurrencySpacing type, |
(...skipping 17 matching lines...) Expand all Loading... |
452 currencySpcBeforeSym[(int32_t)type] = pattern; | 463 currencySpcBeforeSym[(int32_t)type] = pattern; |
453 } else { | 464 } else { |
454 currencySpcAfterSym[(int32_t)type] = pattern; | 465 currencySpcAfterSym[(int32_t)type] = pattern; |
455 } | 466 } |
456 } | 467 } |
457 U_NAMESPACE_END | 468 U_NAMESPACE_END |
458 | 469 |
459 #endif /* #if !UCONFIG_NO_FORMATTING */ | 470 #endif /* #if !UCONFIG_NO_FORMATTING */ |
460 | 471 |
461 //eof | 472 //eof |
OLD | NEW |