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 U_CDECL_BEGIN
00026
00030 static UBool U_CALLCONV ValueComparator(UHashTok val1, UHashTok val2) ;
00031
00032 U_CDECL_END
00033
00034
00035 class Locale;
00036 class PluralRules;
00037 class Hashtable;
00038
00056 class U_I18N_API CurrencyPluralInfo : public UObject {
00057 public:
00058
00064 CurrencyPluralInfo(UErrorCode& status);
00065
00072 CurrencyPluralInfo(const Locale& locale, UErrorCode& status);
00073
00079 CurrencyPluralInfo(const CurrencyPluralInfo& info);
00080
00081
00087 CurrencyPluralInfo& operator=(const CurrencyPluralInfo& info);
00088
00089
00095 virtual ~CurrencyPluralInfo();
00096
00097
00103 UBool operator==(const CurrencyPluralInfo& info) const;
00104
00105
00111 UBool operator!=(const CurrencyPluralInfo& info) const;
00112
00113
00119 CurrencyPluralInfo* clone() const;
00120
00121
00128 const PluralRules* getPluralRules() const;
00129
00139 UnicodeString& getCurrencyPluralPattern(const UnicodeString& pluralCount,
00140 UnicodeString& result) const;
00141
00148 const Locale& getLocale() const;
00149
00161 void setPluralRules(const UnicodeString& ruleDescription,
00162 UErrorCode& status);
00163
00177 void setCurrencyPluralPattern(const UnicodeString& pluralCount,
00178 const UnicodeString& pattern,
00179 UErrorCode& status);
00180
00188 void setLocale(const Locale& loc, UErrorCode& status);
00189
00195 virtual UClassID getDynamicClassID() const;
00196
00202 static UClassID U_EXPORT2 getStaticClassID();
00203
00204 private:
00205 friend class DecimalFormat;
00206
00207 void initialize(const Locale& loc, UErrorCode& status);
00208
00209 void setupCurrencyPluralPattern(const Locale& loc, UErrorCode& status);
00210
00211
00212
00213
00214
00215
00216 void deleteHash(Hashtable* hTable);
00217
00218
00219
00220
00221
00222
00223
00224
00225 Hashtable* initHash(UErrorCode& status);
00226
00227
00228
00235 void copyHash(const Hashtable* source, Hashtable* target, UErrorCode& status);
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246 Hashtable* fPluralCountToCurrencyUnitPattern;
00247
00248
00249
00250
00251
00252
00253
00254 PluralRules* fPluralRules;
00255
00256
00257 Locale* fLocale;
00258 };
00259
00260
00261 inline UBool
00262 CurrencyPluralInfo::operator!=(const CurrencyPluralInfo& info) const { return !operator==(info); }
00263
00264 U_NAMESPACE_END
00265
00266 #endif
00267
00268 #endif // _CURRPINFO
00269