00001
00002
00003
00004
00005
00006
00007 #ifndef CURRPINF_H
00008 #define CURRPINF_H
00009
00010 #include "unicode/utypes.h"
00011
00017 #if !UCONFIG_NO_FORMATTING
00018
00019 #include "unicode/unistr.h"
00020
00021 union UHashTok;
00022
00023 U_NAMESPACE_BEGIN
00024
00025 class Locale;
00026 class PluralRules;
00027 class Hashtable;
00028
00046 class U_I18N_API CurrencyPluralInfo : public UObject {
00047 public:
00048
00054 CurrencyPluralInfo(UErrorCode& status);
00055
00062 CurrencyPluralInfo(const Locale& locale, UErrorCode& status);
00063
00069 CurrencyPluralInfo(const CurrencyPluralInfo& info);
00070
00071
00077 CurrencyPluralInfo& operator=(const CurrencyPluralInfo& info);
00078
00079
00085 virtual ~CurrencyPluralInfo();
00086
00087
00093 UBool operator==(const CurrencyPluralInfo& info) const;
00094
00095
00101 UBool operator!=(const CurrencyPluralInfo& info) const;
00102
00103
00109 CurrencyPluralInfo* clone() const;
00110
00111
00118 const PluralRules* getPluralRules() const;
00119
00129 UnicodeString& getCurrencyPluralPattern(const UnicodeString& pluralCount,
00130 UnicodeString& result) const;
00131
00138 const Locale& getLocale() const;
00139
00151 void setPluralRules(const UnicodeString& ruleDescription,
00152 UErrorCode& status);
00153
00167 void setCurrencyPluralPattern(const UnicodeString& pluralCount,
00168 const UnicodeString& pattern,
00169 UErrorCode& status);
00170
00178 void setLocale(const Locale& loc, UErrorCode& status);
00179
00185 virtual UClassID getDynamicClassID() const;
00186
00192 static UClassID U_EXPORT2 getStaticClassID();
00193
00194 private:
00195 friend class DecimalFormat;
00196
00197 void initialize(const Locale& loc, UErrorCode& status);
00198
00199 void setupCurrencyPluralPattern(const Locale& loc, UErrorCode& status);
00200
00201
00202
00203
00204
00205
00206 void deleteHash(Hashtable* hTable);
00207
00208
00209
00210
00211
00212
00213
00214
00215 Hashtable* initHash(UErrorCode& status);
00216
00217
00218
00225 void copyHash(const Hashtable* source, Hashtable* target, UErrorCode& status);
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236 Hashtable* fPluralCountToCurrencyUnitPattern;
00237
00238
00239
00240
00241
00242
00243
00244 PluralRules* fPluralRules;
00245
00246
00247 Locale* fLocale;
00248 };
00249
00250
00251 inline UBool
00252 CurrencyPluralInfo::operator!=(const CurrencyPluralInfo& info) const { return !operator==(info); }
00253
00254 U_NAMESPACE_END
00255
00256 #endif
00257
00258 #endif // _CURRPINFO
00259