#include <dcfmtsym.h>
Inheritance diagram for DecimalFormatSymbols::
Public Types | |
enum | ENumberFormatSymbol { kDecimalSeparatorSymbol, kGroupingSeparatorSymbol, kPatternSeparatorSymbol, kPercentSymbol, kZeroDigitSymbol, kDigitSymbol, kMinusSignSymbol, kPlusSignSymbol, kCurrencySymbol, kIntlCurrencySymbol, kMonetarySeparatorSymbol, kExponentialSymbol, kPerMillSymbol, kPadEscapeSymbol, kInfinitySymbol, kNaNSymbol, kFormatSymbolCount } |
Constants for specifying a number format symbol. More... | |
Public Methods | |
DecimalFormatSymbols (const Locale &locale, UErrorCode &status) | |
Create a DecimalFormatSymbols object for the given locale. More... | |
DecimalFormatSymbols (UErrorCode &status) | |
Create a DecimalFormatSymbols object for the default locale. More... | |
DecimalFormatSymbols (const DecimalFormatSymbols &) | |
Copy constructor. More... | |
DecimalFormatSymbols & | operator= (const DecimalFormatSymbols &) |
Assignment operator. More... | |
~DecimalFormatSymbols () | |
Destructor. More... | |
UBool | operator== (const DecimalFormatSymbols &other) const |
Return true if another object is semantically equal to this one. More... | |
UBool | operator!= (const DecimalFormatSymbols &other) const |
Return true if another object is semantically unequal to this one. More... | |
UnicodeString | getSymbol (ENumberFormatSymbol symbol) const |
Get one of the format symbols by its enum constant. More... | |
void | setSymbol (ENumberFormatSymbol symbol, const UnicodeString &value) |
Set one of the format symbols by its enum constant. More... | |
Locale | getLocale () const |
Returns the locale for which this object was constructed. More... | |
virtual UClassID | getDynamicClassID () const |
ICU "poor man's RTTI", returns a UClassID for the actual class. More... | |
const UnicodeString & | getConstSymbol (ENumberFormatSymbol symbol) const |
_Internal_ function - more efficient version of getSymbol, returning a const reference to one of the symbol strings. More... | |
Static Public Methods | |
UClassID | getStaticClassID () |
ICU "poor man's RTTI", returns a UClassID for this class. More... | |
Private Methods | |
DecimalFormatSymbols () | |
void | initialize (const Locale &locale, UErrorCode &success, UBool useLastResortData=FALSE) |
Initializes the symbols from the LocaleElements resource bundle. More... | |
void | initialize (const UnicodeString *numberElements, int32_t numberElementsLength) |
Initialize the symbols from the given array of UnicodeStrings. More... | |
void | initialize () |
Initialize the symbols with default values. More... | |
void | setCurrencyForSymbols () |
Private Attributes | |
UnicodeString | fSymbols [kFormatSymbolCount] |
Private symbol strings. More... | |
UnicodeString | fNoSymbol |
Non-symbol variable for getConstSymbol(). More... | |
Locale | locale |
DecimalFormat creates for itself an instance of DecimalFormatSymbols from its locale data. If you need to change any of these symbols, you can get the DecimalFormatSymbols object from your DecimalFormat and modify it.
Here are the special characters used in the parts of the subpattern, with notes on their usage.
[Notes]Symbol Meaning 0 a digit # a digit, zero shows as absent . placeholder for decimal separator , placeholder for grouping separator. ; separates formats. - default negative prefix. % divide by 100 and show as percentage X any other characters can be used in the prefix or suffix ' used to quote special characters in a prefix or suffix.
If there is no explicit negative subpattern, - is prefixed to the positive form. That is, "0.00" alone is equivalent to "0.00;-0.00".
The grouping separator is commonly used for thousands, but in some countries for ten-thousands. The interval is a constant number of digits between the grouping characters, such as 100,000,000 or 1,0000,0000. If you supply a pattern with multiple grouping characters, the interval between the last one and the end of the integer is the one that is used. So "#,##,###,####" == "######,####" == "##,####,####".
This class only handles localized digits where the 10 digits are contiguous in Unicode, from 0 to 9. Other digits sets (such as superscripts) would need a different subclass.
Definition at line 76 of file dcfmtsym.h.
|
Constants for specifying a number format symbol.
Definition at line 82 of file dcfmtsym.h. |
|
Create a DecimalFormatSymbols object for the given locale.
|
|
Create a DecimalFormatSymbols object for the default locale. This constructor will not fail. If the resource file data is not available, it will use hard-coded last-resort data and set status to U_USING_FALLBACK_ERROR.
|
|
Copy constructor.
|
|
Destructor.
|
|
|
|
_Internal_ function - more efficient version of getSymbol, returning a const reference to one of the symbol strings. The returned reference becomes invalid when the symbol is changed or when the DecimalFormatSymbols are destroyed. ### TODO markus 2002oct11: Consider proposing getConstSymbol() to be really public.
|
|
ICU "poor man's RTTI", returns a UClassID for the actual class.
Reimplemented from UObject. |
|
Returns the locale for which this object was constructed.
Definition at line 328 of file dcfmtsym.h. |
|
ICU "poor man's RTTI", returns a UClassID for this class.
|
|
Get one of the format symbols by its enum constant. Each symbol is stored as a string so that graphemes (characters with modifyer letters) can be used.
Definition at line 295 of file dcfmtsym.h. |
|
Initialize the symbols with default values.
|
|
Initialize the symbols from the given array of UnicodeStrings. The array must be of the correct size.
|
|
Initializes the symbols from the LocaleElements resource bundle. Note: The organization of LocaleElements badly needs to be cleaned up.
|
|
Return true if another object is semantically unequal to this one.
Definition at line 175 of file dcfmtsym.h. |
|
Assignment operator.
|
|
Return true if another object is semantically equal to this one.
|
|
|
|
Set one of the format symbols by its enum constant. Each symbol is stored as a string so that graphemes (characters with modifyer letters) can be used.
Definition at line 319 of file dcfmtsym.h. |
|
Non-symbol variable for getConstSymbol(). Always empty.
|
|
Private symbol strings. They are either loaded from a resource bundle or otherwise owned. setSymbol() clones the symbol string. Readonly aliases can only come from a resource bundle, so that we can always use fastCopyFrom() with them. If DecimalFormatSymbols becomes subclassable and the status of fSymbols changes from private to protected, or when fSymbols can be set any other way that allows them to be readonly aliases to non-resource bundle strings, then regular UnicodeString copies must be used instead of fastCopyFrom().
|
|
Definition at line 288 of file dcfmtsym.h. |