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
00070 class U_COMMON_API ResourceBundle : public UObject {
00071 public:
00100 ResourceBundle(const UnicodeString& path,
00101 const Locale& locale,
00102 UErrorCode& err);
00103
00111 ResourceBundle(const UnicodeString& path,
00112 UErrorCode& err);
00113
00120 ResourceBundle(UErrorCode &err);
00121
00127 ResourceBundle(const wchar_t* path,
00128 const Locale& locale,
00129 UErrorCode& err);
00130
00141 ResourceBundle(const char* path,
00142 const Locale& locale,
00143 UErrorCode& err);
00144
00151 ResourceBundle(const ResourceBundle &original);
00152
00160 ResourceBundle(UResourceBundle *res,
00161 UErrorCode &status);
00162
00169 ResourceBundle&
00170 operator=(const ResourceBundle& other);
00171
00175 ~ResourceBundle();
00176
00184 int32_t
00185 getSize(void) const;
00186
00197 UnicodeString
00198 getString(UErrorCode& status) const;
00199
00213 const uint8_t*
00214 getBinary(int32_t& len, UErrorCode& status) const;
00215
00216
00229 const int32_t*
00230 getIntVector(int32_t& len, UErrorCode& status) const;
00231
00243 uint32_t
00244 getUInt(UErrorCode& status) const;
00245
00257 int32_t
00258 getInt(UErrorCode& status) const;
00259
00266 UBool
00267 hasNext(void) const;
00268
00274 void
00275 resetIterator(void);
00276
00284 const char*
00285 getKey(void);
00286
00294 const char*
00295 getName(void);
00296
00297
00304 UResType
00305 getType(void);
00306
00314 ResourceBundle
00315 getNext(UErrorCode& status);
00316
00325 UnicodeString
00326 getNextString(UErrorCode& status);
00327
00337 UnicodeString
00338 getNextString(const char ** key,
00339 UErrorCode& status);
00340
00349 ResourceBundle
00350 get(int32_t index,
00351 UErrorCode& status) const;
00352
00361 UnicodeString
00362 getStringEx(int32_t index,
00363 UErrorCode& status) const;
00364
00374 ResourceBundle
00375 get(const char* key,
00376 UErrorCode& status) const;
00377
00387 UnicodeString
00388 getStringEx(const char* key,
00389 UErrorCode& status) const;
00390
00400 const char*
00401 getVersionNumber(void) const;
00402
00410 void
00411 getVersion(UVersionInfo versionInfo) const;
00412
00419 const Locale&
00420 getLocale(void) const;
00421
00427 virtual inline UClassID
00428 getDynamicClassID() const
00429 { return getStaticClassID(); }
00430
00436 static inline UClassID
00437 getStaticClassID()
00438 { return (UClassID)&fgClassID; }
00439
00440 private:
00441 UResourceBundle *resource;
00442 void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error);
00446 void constructForLocale(const wchar_t* path, const Locale& locale, UErrorCode& error);
00447 Locale *locName;
00448
00453 static const char fgClassID;
00454 };
00455
00456 U_NAMESPACE_END
00457 #endif