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
00047
00048 #ifndef RESBUND_H
00049 #define RESBUND_H
00050
00051 #include "unicode/utypes.h"
00052
00053 #if U_SHOW_CPLUSPLUS_API
00054
00055 #include "unicode/uobject.h"
00056 #include "unicode/ures.h"
00057 #include "unicode/unistr.h"
00058 #include "unicode/locid.h"
00059
00065 U_NAMESPACE_BEGIN
00066
00083 class U_COMMON_API ResourceBundle : public UObject {
00084 public:
00111 ResourceBundle(const UnicodeString& packageName,
00112 const Locale& locale,
00113 UErrorCode& err);
00114
00126 ResourceBundle(const UnicodeString& packageName,
00127 UErrorCode& err);
00128
00135 ResourceBundle(UErrorCode &err);
00136
00151 ResourceBundle(const char* packageName,
00152 const Locale& locale,
00153 UErrorCode& err);
00154
00161 ResourceBundle(const ResourceBundle &original);
00162
00172 ResourceBundle(UResourceBundle *res,
00173 UErrorCode &status);
00174
00181 ResourceBundle&
00182 operator=(const ResourceBundle& other);
00183
00187 virtual ~ResourceBundle();
00188
00200 ResourceBundle *clone() const;
00201
00212 int32_t
00213 getSize(void) const;
00214
00225 UnicodeString
00226 getString(UErrorCode& status) const;
00227
00240 const uint8_t*
00241 getBinary(int32_t& len, UErrorCode& status) const;
00242
00243
00255 const int32_t*
00256 getIntVector(int32_t& len, UErrorCode& status) const;
00257
00269 uint32_t
00270 getUInt(UErrorCode& status) const;
00271
00283 int32_t
00284 getInt(UErrorCode& status) const;
00285
00292 UBool
00293 hasNext(void) const;
00294
00300 void
00301 resetIterator(void);
00302
00310 const char*
00311 getKey(void) const;
00312
00320 const char*
00321 getName(void) const;
00322
00323
00330 UResType
00331 getType(void) const;
00332
00340 ResourceBundle
00341 getNext(UErrorCode& status);
00342
00351 UnicodeString
00352 getNextString(UErrorCode& status);
00353
00363 UnicodeString
00364 getNextString(const char ** key,
00365 UErrorCode& status);
00366
00375 ResourceBundle
00376 get(int32_t index,
00377 UErrorCode& status) const;
00378
00387 UnicodeString
00388 getStringEx(int32_t index,
00389 UErrorCode& status) const;
00390
00400 ResourceBundle
00401 get(const char* key,
00402 UErrorCode& status) const;
00403
00413 UnicodeString
00414 getStringEx(const char* key,
00415 UErrorCode& status) const;
00416
00417 #ifndef U_HIDE_DEPRECATED_API
00418
00427 const char*
00428 getVersionNumber(void) const;
00429 #endif
00430
00438 void
00439 getVersion(UVersionInfo versionInfo) const;
00440
00441 #ifndef U_HIDE_DEPRECATED_API
00442
00448 const Locale&
00449 getLocale(void) const;
00450 #endif
00451
00462 const Locale
00463 getLocale(ULocDataLocaleType type, UErrorCode &status) const;
00464 #ifndef U_HIDE_INTERNAL_API
00465
00469 ResourceBundle
00470 getWithFallback(const char* key, UErrorCode& status);
00471 #endif
00472
00477 virtual UClassID getDynamicClassID() const;
00478
00484 static UClassID U_EXPORT2 getStaticClassID();
00485
00486 private:
00487 ResourceBundle();
00488
00489 UResourceBundle *fResource;
00490 void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error);
00491 Locale *fLocale;
00492 };
00493
00494 U_NAMESPACE_END
00495
00496 #endif
00497
00498 #endif