| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************** | 2 ******************************************************************************** |
| 3 * Copyright (C) 1997-2013, International Business Machines | 3 * Copyright (C) 1997-2014, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ******************************************************************************** | 5 ******************************************************************************** |
| 6 * | 6 * |
| 7 * File DCFMTSYM.H | 7 * File DCFMTSYM.H |
| 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 Updated per C++ implementation. | 13 * 03/18/97 clhuang Updated per C++ implementation. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 */ | 156 */ |
| 157 kSevenDigitSymbol, | 157 kSevenDigitSymbol, |
| 158 /** Eight | 158 /** Eight |
| 159 * @stable ICU 4.6 | 159 * @stable ICU 4.6 |
| 160 */ | 160 */ |
| 161 kEightDigitSymbol, | 161 kEightDigitSymbol, |
| 162 /** Nine | 162 /** Nine |
| 163 * @stable ICU 4.6 | 163 * @stable ICU 4.6 |
| 164 */ | 164 */ |
| 165 kNineDigitSymbol, | 165 kNineDigitSymbol, |
| 166 /** Multiplication sign. |
| 167 * @draft ICU 54 |
| 168 */ |
| 169 kExponentMultiplicationSymbol, |
| 166 /** count symbol constants */ | 170 /** count symbol constants */ |
| 167 kFormatSymbolCount | 171 kFormatSymbolCount |
| 168 }; | 172 }; |
| 169 | 173 |
| 170 /** | 174 /** |
| 171 * Create a DecimalFormatSymbols object for the given locale. | 175 * Create a DecimalFormatSymbols object for the given locale. |
| 172 * | 176 * |
| 173 * @param locale The locale to get symbols for. | 177 * @param locale The locale to get symbols for. |
| 174 * @param status Input/output parameter, set to success or | 178 * @param status Input/output parameter, set to success or |
| 175 * failure code upon return. | 179 * failure code upon return. |
| 176 * @stable ICU 2.0 | 180 * @stable ICU 2.0 |
| 177 */ | 181 */ |
| 178 DecimalFormatSymbols(const Locale& locale, UErrorCode& status); | 182 DecimalFormatSymbols(const Locale& locale, UErrorCode& status); |
| 179 | 183 |
| 180 /** | 184 /** |
| 181 * Create a DecimalFormatSymbols object for the default locale. | 185 * Create a DecimalFormatSymbols object for the default locale. |
| 182 * This constructor will not fail. If the resource file data is | 186 * This constructor will not fail. If the resource file data is |
| 183 * not available, it will use hard-coded last-resort data and | 187 * not available, it will use hard-coded last-resort data and |
| 184 * set status to U_USING_FALLBACK_ERROR. | 188 * set status to U_USING_FALLBACK_ERROR. |
| 185 * | 189 * |
| 186 * @param status Input/output parameter, set to success or | 190 * @param status Input/output parameter, set to success or |
| 187 * failure code upon return. | 191 * failure code upon return. |
| 188 * @stable ICU 2.0 | 192 * @stable ICU 2.0 |
| 189 */ | 193 */ |
| 190 DecimalFormatSymbols(UErrorCode& status); | 194 DecimalFormatSymbols(UErrorCode& status); |
| 191 | 195 |
| 192 #ifndef U_HIDE_DRAFT_API | |
| 193 /** | 196 /** |
| 194 * Creates a DecimalFormatSymbols object with last-resort data. | 197 * Creates a DecimalFormatSymbols object with last-resort data. |
| 195 * Intended for callers who cache the symbols data and | 198 * Intended for callers who cache the symbols data and |
| 196 * set all symbols on the resulting object. | 199 * set all symbols on the resulting object. |
| 197 * | 200 * |
| 198 * The last-resort symbols are similar to those for the root data, | 201 * The last-resort symbols are similar to those for the root data, |
| 199 * except that the grouping separators are empty, | 202 * except that the grouping separators are empty, |
| 200 * the NaN symbol is U+FFFD rather than "NaN", | 203 * the NaN symbol is U+FFFD rather than "NaN", |
| 201 * and the CurrencySpacing patterns are empty. | 204 * and the CurrencySpacing patterns are empty. |
| 202 * | 205 * |
| 203 * @param status Input/output parameter, set to success or | 206 * @param status Input/output parameter, set to success or |
| 204 * failure code upon return. | 207 * failure code upon return. |
| 205 * @return last-resort symbols | 208 * @return last-resort symbols |
| 206 * @draft ICU 52 | 209 * @stable ICU 52 |
| 207 */ | 210 */ |
| 208 static DecimalFormatSymbols* createWithLastResortData(UErrorCode& status); | 211 static DecimalFormatSymbols* createWithLastResortData(UErrorCode& status); |
| 209 #endif /* U_HIDE_DRAFT_API */ | |
| 210 | 212 |
| 211 /** | 213 /** |
| 212 * Copy constructor. | 214 * Copy constructor. |
| 213 * @stable ICU 2.0 | 215 * @stable ICU 2.0 |
| 214 */ | 216 */ |
| 215 DecimalFormatSymbols(const DecimalFormatSymbols&); | 217 DecimalFormatSymbols(const DecimalFormatSymbols&); |
| 216 | 218 |
| 217 /** | 219 /** |
| 218 * Assignment operator. | 220 * Assignment operator. |
| 219 * @stable ICU 2.0 | 221 * @stable ICU 2.0 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 void initialize(const Locale& locale, UErrorCode& success, UBool useLastReso
rtData = FALSE); | 347 void initialize(const Locale& locale, UErrorCode& success, UBool useLastReso
rtData = FALSE); |
| 346 | 348 |
| 347 /** | 349 /** |
| 348 * Initialize the symbols with default values. | 350 * Initialize the symbols with default values. |
| 349 */ | 351 */ |
| 350 void initialize(); | 352 void initialize(); |
| 351 | 353 |
| 352 void setCurrencyForSymbols(); | 354 void setCurrencyForSymbols(); |
| 353 | 355 |
| 354 public: | 356 public: |
| 355 #ifndef U_HIDE_INTERNAL_API | |
| 356 /** | 357 /** |
| 357 * _Internal_ function - more efficient version of getSymbol, | 358 * _Internal_ function - more efficient version of getSymbol, |
| 358 * returning a const reference to one of the symbol strings. | 359 * returning a const reference to one of the symbol strings. |
| 359 * The returned reference becomes invalid when the symbol is changed | 360 * The returned reference becomes invalid when the symbol is changed |
| 360 * or when the DecimalFormatSymbols are destroyed. | 361 * or when the DecimalFormatSymbols are destroyed. |
| 361 * ### TODO markus 2002oct11: Consider proposing getConstSymbol() to be real
ly public. | 362 * ### TODO markus 2002oct11: Consider proposing getConstSymbol() to be real
ly public. |
| 363 * Note: moved #ifndef U_HIDE_INTERNAL_API after this, since this is needed
for inline in DecimalFormat |
| 362 * | 364 * |
| 363 * @param symbol Constant to indicate a number format symbol. | 365 * @param symbol Constant to indicate a number format symbol. |
| 364 * @return the format symbol by the param 'symbol' | 366 * @return the format symbol by the param 'symbol' |
| 365 * @internal | 367 * @internal |
| 366 */ | 368 */ |
| 367 inline const UnicodeString &getConstSymbol(ENumberFormatSymbol symbol) const
; | 369 inline const UnicodeString &getConstSymbol(ENumberFormatSymbol symbol) const
; |
| 368 | 370 |
| 371 #ifndef U_HIDE_INTERNAL_API |
| 369 /** | 372 /** |
| 370 * Returns that pattern stored in currecy info. Internal API for use by Numb
erFormat API. | 373 * Returns that pattern stored in currecy info. Internal API for use by Numb
erFormat API. |
| 371 * @internal | 374 * @internal |
| 372 */ | 375 */ |
| 373 inline const UChar* getCurrencyPattern(void) const; | 376 inline const UChar* getCurrencyPattern(void) const; |
| 374 #endif /* U_HIDE_INTERNAL_API */ | 377 #endif /* U_HIDE_INTERNAL_API */ |
| 375 | 378 |
| 376 private: | 379 private: |
| 377 /** | 380 /** |
| 378 * Private symbol strings. | 381 * Private symbol strings. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 DecimalFormatSymbols::getSymbol(ENumberFormatSymbol symbol) const { | 416 DecimalFormatSymbols::getSymbol(ENumberFormatSymbol symbol) const { |
| 414 const UnicodeString *strPtr; | 417 const UnicodeString *strPtr; |
| 415 if(symbol < kFormatSymbolCount) { | 418 if(symbol < kFormatSymbolCount) { |
| 416 strPtr = &fSymbols[symbol]; | 419 strPtr = &fSymbols[symbol]; |
| 417 } else { | 420 } else { |
| 418 strPtr = &fNoSymbol; | 421 strPtr = &fNoSymbol; |
| 419 } | 422 } |
| 420 return *strPtr; | 423 return *strPtr; |
| 421 } | 424 } |
| 422 | 425 |
| 423 #ifndef U_HIDE_INTERNAL_API | 426 //#ifndef U_HIDE_INTERNAL_API |
| 424 | 427 // See comments above for this function. Not hidden. |
| 425 inline const UnicodeString & | 428 inline const UnicodeString & |
| 426 DecimalFormatSymbols::getConstSymbol(ENumberFormatSymbol symbol) const { | 429 DecimalFormatSymbols::getConstSymbol(ENumberFormatSymbol symbol) const { |
| 427 const UnicodeString *strPtr; | 430 const UnicodeString *strPtr; |
| 428 if(symbol < kFormatSymbolCount) { | 431 if(symbol < kFormatSymbolCount) { |
| 429 strPtr = &fSymbols[symbol]; | 432 strPtr = &fSymbols[symbol]; |
| 430 } else { | 433 } else { |
| 431 strPtr = &fNoSymbol; | 434 strPtr = &fNoSymbol; |
| 432 } | 435 } |
| 433 return *strPtr; | 436 return *strPtr; |
| 434 } | 437 } |
| 435 | 438 |
| 436 #endif /* U_HIDE_INTERNAL_API */ | 439 //#endif /* U_HIDE_INTERNAL_API */ |
| 437 | 440 |
| 438 | 441 |
| 439 // ------------------------------------- | 442 // ------------------------------------- |
| 440 | 443 |
| 441 inline void | 444 inline void |
| 442 DecimalFormatSymbols::setSymbol(ENumberFormatSymbol symbol, const UnicodeString
&value, const UBool propogateDigits = TRUE) { | 445 DecimalFormatSymbols::setSymbol(ENumberFormatSymbol symbol, const UnicodeString
&value, const UBool propogateDigits = TRUE) { |
| 443 if(symbol<kFormatSymbolCount) { | 446 if(symbol<kFormatSymbolCount) { |
| 444 fSymbols[symbol]=value; | 447 fSymbols[symbol]=value; |
| 445 } | 448 } |
| 446 | 449 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 470 return currPattern; | 473 return currPattern; |
| 471 } | 474 } |
| 472 #endif /* U_HIDE_INTERNAL_API */ | 475 #endif /* U_HIDE_INTERNAL_API */ |
| 473 | 476 |
| 474 U_NAMESPACE_END | 477 U_NAMESPACE_END |
| 475 | 478 |
| 476 #endif /* #if !UCONFIG_NO_FORMATTING */ | 479 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| 477 | 480 |
| 478 #endif // _DCFMTSYM | 481 #endif // _DCFMTSYM |
| 479 //eof | 482 //eof |
| OLD | NEW |