00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef CURRPINF_H
00010 #define CURRPINF_H
00011
00012 #include "unicode/utypes.h"
00013
00019 #if !UCONFIG_NO_FORMATTING
00020
00021 #include "unicode/unistr.h"
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 friend class DecimalFormatImpl;
00197
00198 void initialize(const Locale& loc, UErrorCode& status);
00199
00200 void setupCurrencyPluralPattern(const Locale& loc, UErrorCode& status);
00201
00202
00203
00204
00205
00206
00207 void deleteHash(Hashtable* hTable);
00208
00209
00210
00211
00212
00213
00214
00215
00216 Hashtable* initHash(UErrorCode& status);
00217
00218
00219
00227 void copyHash(const Hashtable* source, Hashtable* target, UErrorCode& status);
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238 Hashtable* fPluralCountToCurrencyUnitPattern;
00239
00240
00241
00242
00243
00244
00245
00246 PluralRules* fPluralRules;
00247
00248
00249 Locale* fLocale;
00250
00251 private:
00256 UErrorCode fInternalStatus;
00257 };
00258
00259
00260 inline UBool
00261 CurrencyPluralInfo::operator!=(const CurrencyPluralInfo& info) const {
00262 return !operator==(info);
00263 }
00264
00265 U_NAMESPACE_END
00266
00267 #endif
00268
00269 #endif // _CURRPINFO
00270