00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef RESBUND_H
00047 #define RESBUND_H
00048
00049 #include "unicode/utypes.h"
00050 #include "unicode/uobject.h"
00051 #include "unicode/ures.h"
00052 #include "unicode/unistr.h"
00053 #include "unicode/locid.h"
00054
00055 U_NAMESPACE_BEGIN
00056
00073 class U_COMMON_API ResourceBundle : public UObject {
00074 public:
00103 ResourceBundle(const UnicodeString& path,
00104 const Locale& locale,
00105 UErrorCode& err);
00106
00114 ResourceBundle(const UnicodeString& path,
00115 UErrorCode& err);
00116
00123 ResourceBundle(UErrorCode &err);
00124
00125 #ifdef ICU_RESOURCEBUNDLE_USE_DEPRECATES
00126
00131 ResourceBundle(const wchar_t* path,
00132 const Locale& locale,
00133 UErrorCode& err);
00134 #endif
00135
00146 ResourceBundle(const char* path,
00147 const Locale& locale,
00148 UErrorCode& err);
00149
00156 ResourceBundle(const ResourceBundle &original);
00157
00165 ResourceBundle(UResourceBundle *res,
00166 UErrorCode &status);
00167
00174 ResourceBundle&
00175 operator=(const ResourceBundle& other);
00176
00180 ~ResourceBundle();
00181
00189 int32_t
00190 getSize(void) const;
00191
00202 UnicodeString
00203 getString(UErrorCode& status) const;
00204
00218 const uint8_t*
00219 getBinary(int32_t& len, UErrorCode& status) const;
00220
00221
00234 const int32_t*
00235 getIntVector(int32_t& len, UErrorCode& status) const;
00236
00248 uint32_t
00249 getUInt(UErrorCode& status) const;
00250
00262 int32_t
00263 getInt(UErrorCode& status) const;
00264
00271 UBool
00272 hasNext(void) const;
00273
00279 void
00280 resetIterator(void);
00281
00289 const char*
00290 getKey(void);
00291
00299 const char*
00300 getName(void);
00301
00302
00309 UResType
00310 getType(void);
00311
00319 ResourceBundle
00320 getNext(UErrorCode& status);
00321
00330 UnicodeString
00331 getNextString(UErrorCode& status);
00332
00342 UnicodeString
00343 getNextString(const char ** key,
00344 UErrorCode& status);
00345
00354 ResourceBundle
00355 get(int32_t index,
00356 UErrorCode& status) const;
00357
00366 UnicodeString
00367 getStringEx(int32_t index,
00368 UErrorCode& status) const;
00369
00379 ResourceBundle
00380 get(const char* key,
00381 UErrorCode& status) const;
00382
00392 UnicodeString
00393 getStringEx(const char* key,
00394 UErrorCode& status) const;
00395
00405 const char*
00406 getVersionNumber(void) const;
00407
00415 void
00416 getVersion(UVersionInfo versionInfo) const;
00417
00424 const Locale&
00425 getLocale(void) const;
00426
00432 virtual inline UClassID
00433 getDynamicClassID() const
00434 { return getStaticClassID(); }
00435
00441 static inline UClassID
00442 getStaticClassID()
00443 { return (UClassID)&fgClassID; }
00444
00445 private:
00446 UResourceBundle *resource;
00447 void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error);
00448 #ifdef ICU_RESOURCEBUNDLE_USE_DEPRECATES
00449
00452 void constructForLocale(const wchar_t* path, const Locale& locale, UErrorCode& error);
00453 #endif
00454 Locale *locName;
00455
00460 static const char fgClassID;
00461 };
00462
00463 U_NAMESPACE_END
00464 #endif