1999-12-28 23:57:50 +00:00
|
|
|
/*
|
|
|
|
********************************************************************************
|
|
|
|
* Copyright (C) 1997-1999, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
********************************************************************************
|
|
|
|
*
|
|
|
|
* File DCFMTSYM.H
|
|
|
|
*
|
|
|
|
* Modification History:
|
2000-03-22 19:19:33 +00:00
|
|
|
*
|
1999-12-28 23:57:50 +00:00
|
|
|
* Date Name Description
|
|
|
|
* 02/19/97 aliu Converted from java.
|
|
|
|
* 03/18/97 clhuang Updated per C++ implementation.
|
|
|
|
* 03/27/97 helena Updated to pass the simple test after code review.
|
|
|
|
* 08/26/97 aliu Added currency/intl currency symbol support.
|
2000-09-22 22:56:03 +00:00
|
|
|
* 07/22/98 stephen Changed to match C++ style
|
1999-12-28 23:57:50 +00:00
|
|
|
* currencySymbol -> fCurrencySymbol
|
|
|
|
* Constants changed from CAPS to kCaps
|
|
|
|
* 06/24/99 helena Integrated Alan's NF enhancements and Java2 bug fixes
|
2000-09-22 22:56:03 +00:00
|
|
|
* 09/22/00 grhoten Marked deprecation tags with a pointer to replacement
|
|
|
|
* functions.
|
1999-12-28 23:57:50 +00:00
|
|
|
********************************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DCFMTSYM_H
|
|
|
|
#define DCFMTSYM_H
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
#include "unicode/locid.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class represents the set of symbols needed by DecimalFormat
|
|
|
|
* to format numbers. 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.
|
|
|
|
* <P>
|
|
|
|
* Here are the special characters used in the parts of the
|
|
|
|
* subpattern, with notes on their usage.
|
|
|
|
* <pre>
|
2000-12-08 18:46:55 +00:00
|
|
|
* \code
|
|
|
|
* 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.
|
|
|
|
* \endcode
|
1999-12-28 23:57:50 +00:00
|
|
|
* </pre>
|
2000-08-07 23:02:51 +00:00
|
|
|
* [Notes]
|
1999-12-28 23:57:50 +00:00
|
|
|
* <P>
|
|
|
|
* 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".
|
|
|
|
* <P>
|
|
|
|
* 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 "#,##,###,####" == "######,####" == "##,####,####".
|
|
|
|
* <P>
|
|
|
|
* 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.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
class U_I18N_API DecimalFormatSymbols {
|
|
|
|
public:
|
2000-05-25 01:10:55 +00:00
|
|
|
/**
|
|
|
|
* Constants for specifying a number format symbol.
|
|
|
|
* @draft
|
|
|
|
*/
|
|
|
|
enum ENumberFormatSymbol {
|
2000-05-25 23:15:29 +00:00
|
|
|
/** The decimal separator */
|
|
|
|
kDecimalSeparatorSymbol,
|
|
|
|
/** The grouping separator */
|
|
|
|
kGroupingSeparatorSymbol,
|
|
|
|
/** The pattern separator */
|
|
|
|
kPatternSeparatorSymbol,
|
|
|
|
/** The percent sign */
|
|
|
|
kPercentSymbol,
|
|
|
|
/** Zero*/
|
|
|
|
kZeroDigitSymbol,
|
|
|
|
/** Character representing a digit in the pattern */
|
|
|
|
kDigitSymbol,
|
|
|
|
/** The minus sign */
|
|
|
|
kMinusSignSymbol,
|
|
|
|
/** The plus sign */
|
|
|
|
kPlusSignSymbol,
|
|
|
|
/** The currency symbol */
|
|
|
|
kCurrencySymbol,
|
|
|
|
/** The international currency symbol */
|
|
|
|
kIntlCurrencySymbol,
|
|
|
|
/** The monetary separator */
|
|
|
|
kMonetarySeparatorSymbol,
|
|
|
|
/** The exponential symbol */
|
|
|
|
kExponentialSymbol,
|
|
|
|
/** Per mill symbol */
|
|
|
|
kPermillSymbol,
|
|
|
|
/** Escape padding character */
|
|
|
|
kPadEscapeSymbol,
|
|
|
|
/** Infinity symbol */
|
|
|
|
kInfinitySymbol,
|
|
|
|
/** Nan symbol */
|
|
|
|
kNaNSymbol,
|
|
|
|
/** count symbol constants */
|
|
|
|
kFormatSymbolCount
|
2000-05-25 01:10:55 +00:00
|
|
|
};
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
/**
|
|
|
|
* Create a DecimalFormatSymbols object for the given locale.
|
|
|
|
*
|
|
|
|
* @param locale The locale to get symbols for.
|
|
|
|
* @param status Input/output parameter, set to success or
|
|
|
|
* failure code upon return.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @stable
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
DecimalFormatSymbols(const Locale& locale, UErrorCode& status);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @param status Input/output parameter, set to success or
|
|
|
|
* failure code upon return.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @stable
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
DecimalFormatSymbols( UErrorCode& status);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Copy constructor.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @stable
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
DecimalFormatSymbols(const DecimalFormatSymbols&);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Assignment operator.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @stable
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
DecimalFormatSymbols& operator=(const DecimalFormatSymbols&);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @stable
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
~DecimalFormatSymbols();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if another object is semantically equal to this one.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @stable
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
2000-05-18 22:08:39 +00:00
|
|
|
UBool operator==(const DecimalFormatSymbols& other) const;
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if another object is semantically unequal to this one.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @stable
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
2000-05-18 22:08:39 +00:00
|
|
|
UBool operator!=(const DecimalFormatSymbols& other) const { return !operator==(other); }
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
2000-05-25 01:10:55 +00:00
|
|
|
* 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.
|
|
|
|
* @draft
|
|
|
|
*/
|
|
|
|
UnicodeString getSymbol(ENumberFormatSymbol symbol) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
2000-03-22 19:19:33 +00:00
|
|
|
* @draft
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
2000-05-25 01:10:55 +00:00
|
|
|
void setSymbol(ENumberFormatSymbol symbol, UnicodeString value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used for zero. Different for Arabic, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-05-25 01:10:55 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
UChar getZeroDigit(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used for zero. Different for Arabic, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setZeroDigit(UChar zeroDigit);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used for thousands separator. Different for French, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getGroupingSeparator(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used for thousands separator. Different for French, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setGroupingSeparator(UChar groupingSeparator);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used for decimal sign. Different for French, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getDecimalSeparator(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used for decimal sign. Different for French, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setDecimalSeparator(UChar decimalSeparator);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used for per mill sign. Different for Arabic, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getPerMill(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used for per mill sign. Different for Arabic, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
2000-05-25 01:10:55 +00:00
|
|
|
void setPerMill(UChar permill);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* character used for percent sign. Different for Arabic, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getPercent(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used for percent sign. Different for Arabic, etc.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setPercent(UChar percent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used for a digit in a pattern.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getDigit(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used for a digit in a pattern.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setDigit(UChar digit);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used to separate positive and negative subpatterns
|
|
|
|
* in a pattern.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getPatternSeparator(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used to separate positive and negative subpatterns
|
|
|
|
* in a pattern.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setPatternSeparator(UChar patternSeparator);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used to represent infinity. Almost always left
|
|
|
|
* unchanged.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UnicodeString& getInfinity(UnicodeString& result) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used to represent infinity. Almost always left
|
|
|
|
* unchanged.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setInfinity(const UnicodeString& infinity);
|
2000-08-07 23:02:51 +00:00
|
|
|
/**
|
|
|
|
* Checks to see if text at offset represents the inifinity string.
|
|
|
|
* @return the number of characters used to represent infinity when
|
|
|
|
* text starts with the inifinity string, otherwise it returns 0.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-08-07 23:02:51 +00:00
|
|
|
*/
|
|
|
|
int32_t compareInfinity(const UnicodeString& text, UTextOffset offset) const;
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
2000-08-07 23:02:51 +00:00
|
|
|
* character used to represent NaN (Not A Number). Almost always left
|
1999-12-28 23:57:50 +00:00
|
|
|
* unchanged.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UnicodeString& getNaN(UnicodeString& result) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used to represent NaN. Almost always left
|
|
|
|
* unchanged.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setNaN(const UnicodeString& NaN);
|
2000-08-07 23:02:51 +00:00
|
|
|
/**
|
|
|
|
* Checks to see if text at offset represents the NaN string.
|
|
|
|
* @return the number of characters used to represent NaN when
|
|
|
|
* text starts with the NaN string, otherwise it returns 0.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-08-07 23:02:51 +00:00
|
|
|
*/
|
|
|
|
int32_t compareNaN(const UnicodeString& text, UTextOffset offset) const;
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* character used to represent plus sign
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getPlusSign(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used to represent plus sign
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setPlusSign(UChar minusSign);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used to represent minus sign. If no explicit
|
|
|
|
* negative format is specified, one is formed by prefixing
|
|
|
|
* minusSign to the positive format.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getMinusSign(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used to represent minus sign. If no explicit
|
|
|
|
* negative format is specified, one is formed by prefixing
|
|
|
|
* minusSign to the positive format.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setMinusSign(UChar minusSign);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* character used to represent exponential. Almost always left
|
|
|
|
* unchanged.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getExponentialSymbol(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* character used to represent exponential. Almost always left
|
|
|
|
* unchanged.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setExponentialSymbol(UChar exponential);
|
|
|
|
|
|
|
|
/**
|
2000-03-22 19:19:33 +00:00
|
|
|
* The string denoting the local currency.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UnicodeString& getCurrencySymbol(UnicodeString& result) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* The string denoting the local currency.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setCurrencySymbol(const UnicodeString& currency);
|
2000-08-07 23:02:51 +00:00
|
|
|
/**
|
|
|
|
* Checks to see if text at offset represents the Currency Symbol string.
|
|
|
|
* @return the number of characters used to represent Currency Symbol when
|
|
|
|
* text starts with the Currency Symbol string, otherwise it returns
|
|
|
|
* 0.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-08-07 23:02:51 +00:00
|
|
|
*/
|
|
|
|
int32_t compareCurrencySymbol(const UnicodeString& text, UTextOffset offset) const;
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
2000-03-22 19:19:33 +00:00
|
|
|
* The international string denoting the local currency.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UnicodeString& getInternationalCurrencySymbol(UnicodeString& result) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* The international string denoting the local currency.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setInternationalCurrencySymbol(const UnicodeString& currency);
|
2000-08-07 23:02:51 +00:00
|
|
|
/**
|
|
|
|
* Checks to see if text at offset represents the International Currency
|
|
|
|
* Symbol string.
|
|
|
|
* @return the number of characters used to represent International
|
|
|
|
* Currency Symbol when text starts with the International Currency
|
|
|
|
* Symbol string, otherwise it returns 0.
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-08-07 23:02:51 +00:00
|
|
|
*/
|
|
|
|
int32_t compareInternationalCurrencySymbol(const UnicodeString& text, UTextOffset offset) const;
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
2000-03-22 19:19:33 +00:00
|
|
|
* The monetary decimal separator.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getMonetaryDecimalSeparator(void) const;
|
2000-03-22 19:19:33 +00:00
|
|
|
/**
|
|
|
|
* The monetary decimal separator.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
2000-03-22 19:19:33 +00:00
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
void setMonetaryDecimalSeparator(UChar sep);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the character used to pad numbers out to a specified width. This
|
|
|
|
* is not the pad character itself; rather, it is the special pattern
|
|
|
|
* character <em>preceding</em> the pad character. In the pattern
|
|
|
|
* "*_#,##0", '*' is the pad escape, and '_' is the pad character.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function returns only the first code unit of the symbol string,
|
|
|
|
* unlike getSymbol().
|
1999-12-28 23:57:50 +00:00
|
|
|
* @return the character
|
|
|
|
* @see #setPadEscape
|
|
|
|
* @see DecimalFormat#getFormatWidth
|
|
|
|
* @see DecimalFormat#getPadPosition
|
|
|
|
* @see DecimalFormat#getPadCharacter
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
UChar getPadEscape(void) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the character used to pad numbers out to a specified width. This is
|
|
|
|
* not the pad character itself; rather, it is the special pattern character
|
|
|
|
* <em>preceding</em> the pad character. In the pattern "*_#,##0", '*' is
|
|
|
|
* the pad escape, and '_' is the pad character.
|
2000-07-20 20:03:04 +00:00
|
|
|
* This function can set only a one-code unit symbol,
|
|
|
|
* unlike setSymbol().
|
1999-12-28 23:57:50 +00:00
|
|
|
* @see #getPadEscape
|
|
|
|
* @see DecimalFormat#setFormatWidth
|
|
|
|
* @see DecimalFormat#setPadPosition
|
|
|
|
* @see DecimalFormat#setPadCharacter
|
2000-09-22 22:56:03 +00:00
|
|
|
* @deprecated remove after 2000-dec-31. See UNumberFormatSymbol and unum_getSymbol() for a replacement.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
|
|
|
void setPadEscape(UChar c);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Initializes the symbols from the LocaleElements resource bundle.
|
|
|
|
* Note: The organization of LocaleElements badly needs to be
|
|
|
|
* cleaned up.
|
|
|
|
*/
|
2000-05-18 22:08:39 +00:00
|
|
|
void initialize(const Locale& locale, UErrorCode& success, UBool useLastResortData = FALSE);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the symbols from the given array of UnicodeStrings.
|
|
|
|
* The array must be of the correct size.
|
|
|
|
*/
|
|
|
|
void initialize(const UnicodeString* numberElements, const UnicodeString* currencyElements);
|
2000-05-25 23:15:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the symbols with default values.
|
|
|
|
*/
|
|
|
|
void initialize();
|
|
|
|
|
|
|
|
UnicodeString fSymbols[kFormatSymbolCount];
|
1999-12-28 23:57:50 +00:00
|
|
|
};
|
2000-08-07 23:02:51 +00:00
|
|
|
|
2000-05-25 01:10:55 +00:00
|
|
|
|
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
2000-05-25 01:10:55 +00:00
|
|
|
inline UnicodeString
|
|
|
|
DecimalFormatSymbols::getSymbol(ENumberFormatSymbol symbol) const {
|
2000-05-25 23:15:29 +00:00
|
|
|
if(symbol<kFormatSymbolCount) {
|
2000-05-25 01:10:55 +00:00
|
|
|
return fSymbols[symbol];
|
|
|
|
} else {
|
|
|
|
return UnicodeString();
|
|
|
|
}
|
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
2000-05-25 01:10:55 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
2000-05-25 01:10:55 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setSymbol(ENumberFormatSymbol symbol, UnicodeString value) {
|
2000-05-25 23:15:29 +00:00
|
|
|
if(symbol<kFormatSymbolCount) {
|
2000-05-25 01:10:55 +00:00
|
|
|
fSymbols[symbol]=value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getZeroDigit() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kZeroDigitSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
|
|
|
|
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setZeroDigit(UChar zeroDigit)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kZeroDigitSymbol] = zeroDigit;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getGroupingSeparator() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kGroupingSeparatorSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setGroupingSeparator(UChar groupingSeparator)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kGroupingSeparatorSymbol] = groupingSeparator;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getDecimalSeparator() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kDecimalSeparatorSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setDecimalSeparator(UChar decimalSeparator)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kDecimalSeparatorSymbol] = decimalSeparator;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getPerMill() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kPermillSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
2000-05-25 01:10:55 +00:00
|
|
|
DecimalFormatSymbols::setPerMill(UChar permill)
|
1999-12-28 23:57:50 +00:00
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kPermillSymbol] = permill;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getPercent() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kPercentSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setPercent(UChar percent)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kPercentSymbol] = percent;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getDigit() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kDigitSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setDigit(UChar digit)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kDigitSymbol] = digit;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getPatternSeparator() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kPatternSeparatorSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setPatternSeparator(UChar patternSeparator)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kPatternSeparatorSymbol] = patternSeparator;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UnicodeString&
|
|
|
|
DecimalFormatSymbols::getInfinity(UnicodeString& result) const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return result = fSymbols[kInfinitySymbol];
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setInfinity(const UnicodeString& infinity)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kInfinitySymbol] = infinity;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
|
|
|
inline int32_t
|
|
|
|
DecimalFormatSymbols::compareInfinity(const UnicodeString& text,
|
|
|
|
UTextOffset offset) const
|
|
|
|
{
|
2000-10-19 21:31:53 +00:00
|
|
|
int32_t symbolLength = fSymbols[kInfinitySymbol].length();
|
2000-08-07 23:02:51 +00:00
|
|
|
return text.compare(offset,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength,
|
2000-08-07 23:02:51 +00:00
|
|
|
fSymbols[kInfinitySymbol],
|
|
|
|
0,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength)
|
|
|
|
? 0 : symbolLength;
|
2000-08-07 23:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UnicodeString&
|
|
|
|
DecimalFormatSymbols::getNaN(UnicodeString& result) const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return result = fSymbols[kNaNSymbol];
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setNaN(const UnicodeString& NaN)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kNaNSymbol] = NaN;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
|
|
|
inline int32_t
|
|
|
|
DecimalFormatSymbols::compareNaN(const UnicodeString& text, UTextOffset offset) const
|
|
|
|
{
|
2000-10-19 21:31:53 +00:00
|
|
|
int32_t symbolLength = fSymbols[kNaNSymbol].length();
|
2000-08-07 23:02:51 +00:00
|
|
|
return text.compare(offset,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength,
|
2000-08-07 23:02:51 +00:00
|
|
|
fSymbols[kNaNSymbol],
|
|
|
|
0,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength)
|
|
|
|
? 0 : symbolLength;
|
2000-08-07 23:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getPlusSign() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kPlusSignSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setPlusSign(UChar plusSign)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kPlusSignSymbol] = plusSign;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getMinusSign() const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kMinusSignSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setMinusSign(UChar minusSign)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kMinusSignSymbol] = minusSign;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getExponentialSymbol(void) const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kExponentialSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setExponentialSymbol(UChar exponential)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kExponentialSymbol] = exponential;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UnicodeString&
|
|
|
|
DecimalFormatSymbols::getCurrencySymbol(UnicodeString& result) const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return result = fSymbols[kCurrencySymbol];
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setCurrencySymbol(const UnicodeString& str)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kCurrencySymbol] = str;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
|
|
|
inline int32_t
|
|
|
|
DecimalFormatSymbols::compareCurrencySymbol(const UnicodeString& text,
|
|
|
|
UTextOffset offset) const
|
|
|
|
{
|
2000-10-19 21:31:53 +00:00
|
|
|
int32_t symbolLength = fSymbols[kCurrencySymbol].length();
|
2000-08-07 23:02:51 +00:00
|
|
|
return text.compare(offset,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength,
|
2000-08-07 23:02:51 +00:00
|
|
|
fSymbols[kCurrencySymbol],
|
|
|
|
0,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength)
|
|
|
|
? 0 : symbolLength;
|
2000-08-07 23:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UnicodeString&
|
|
|
|
DecimalFormatSymbols::getInternationalCurrencySymbol(UnicodeString& result) const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return result = fSymbols[kIntlCurrencySymbol];
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setInternationalCurrencySymbol(const UnicodeString& str)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kIntlCurrencySymbol] = str;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
|
|
|
inline int32_t
|
|
|
|
DecimalFormatSymbols::compareInternationalCurrencySymbol(const UnicodeString& text,
|
|
|
|
UTextOffset offset) const
|
|
|
|
{
|
2000-10-19 21:31:53 +00:00
|
|
|
int32_t symbolLength = fSymbols[kIntlCurrencySymbol].length();
|
2000-08-07 23:02:51 +00:00
|
|
|
return text.compare(offset,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength,
|
2000-08-07 23:02:51 +00:00
|
|
|
fSymbols[kIntlCurrencySymbol],
|
|
|
|
0,
|
2000-10-19 21:31:53 +00:00
|
|
|
symbolLength)
|
|
|
|
? 0 : symbolLength;
|
2000-08-07 23:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar
|
|
|
|
DecimalFormatSymbols::getMonetaryDecimalSeparator(void) const
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kMonetarySeparatorSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
// -------------------------------------
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline void
|
|
|
|
DecimalFormatSymbols::setMonetaryDecimalSeparator(UChar sep)
|
|
|
|
{
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kMonetarySeparatorSymbol] = sep;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
2000-08-07 23:02:51 +00:00
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
inline UChar DecimalFormatSymbols::getPadEscape(void) const {
|
2000-05-25 23:15:29 +00:00
|
|
|
return fSymbols[kPadEscapeSymbol].charAt(0);
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void DecimalFormatSymbols::setPadEscape(UChar c) {
|
2000-05-25 23:15:29 +00:00
|
|
|
fSymbols[kPadEscapeSymbol] = c;
|
1999-12-28 23:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _DCFMTSYM
|
|
|
|
//eof
|