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 #include "unicode/uobject.h"
00053 #include "unicode/ures.h"
00054 #include "unicode/unistr.h"
00055 #include "unicode/locid.h"
00056
00062 U_NAMESPACE_BEGIN
00063
00080 class U_COMMON_API ResourceBundle : public UObject {
00081 public:
00108 ResourceBundle(const UnicodeString& packageName,
00109 const Locale& locale,
00110 UErrorCode& err);
00111
00123 ResourceBundle(const UnicodeString& packageName,
00124 UErrorCode& err);
00125
00132 ResourceBundle(UErrorCode &err);
00133
00148 ResourceBundle(const char* packageName,
00149 const Locale& locale,
00150 UErrorCode& err);
00151
00158 ResourceBundle(const ResourceBundle &original);
00159
00169 ResourceBundle(UResourceBundle *res,
00170 UErrorCode &status);
00171
00178 ResourceBundle&
00179 operator=(const ResourceBundle& other);
00180
00184 virtual ~ResourceBundle();
00185
00197 ResourceBundle *clone() const;
00198
00209 int32_t
00210 getSize(void) const;
00211
00222 UnicodeString
00223 getString(UErrorCode& status) const;
00224
00237 const uint8_t*
00238 getBinary(int32_t& len, UErrorCode& status) const;
00239
00240
00252 const int32_t*
00253 getIntVector(int32_t& len, UErrorCode& status) const;
00254
00266 uint32_t
00267 getUInt(UErrorCode& status) const;
00268
00280 int32_t
00281 getInt(UErrorCode& status) const;
00282
00289 UBool
00290 hasNext(void) const;
00291
00297 void
00298 resetIterator(void);
00299
00307 const char*
00308 getKey(void) const;
00309
00317 const char*
00318 getName(void) const;
00319
00320
00327 UResType
00328 getType(void) const;
00329
00337 ResourceBundle
00338 getNext(UErrorCode& status);
00339
00348 UnicodeString
00349 getNextString(UErrorCode& status);
00350
00360 UnicodeString
00361 getNextString(const char ** key,
00362 UErrorCode& status);
00363
00372 ResourceBundle
00373 get(int32_t index,
00374 UErrorCode& status) const;
00375
00384 UnicodeString
00385 getStringEx(int32_t index,
00386 UErrorCode& status) const;
00387
00397 ResourceBundle
00398 get(const char* key,
00399 UErrorCode& status) const;
00400
00410 UnicodeString
00411 getStringEx(const char* key,
00412 UErrorCode& status) const;
00413
00414 #ifndef U_HIDE_DEPRECATED_API
00415
00424 const char*
00425 getVersionNumber(void) const;
00426 #endif
00427
00435 void
00436 getVersion(UVersionInfo versionInfo) const;
00437
00438 #ifndef U_HIDE_DEPRECATED_API
00439
00445 const Locale&
00446 getLocale(void) const;
00447 #endif
00448
00459 const Locale
00460 getLocale(ULocDataLocaleType type, UErrorCode &status) const;
00461 #ifndef U_HIDE_INTERNAL_API
00462
00466 ResourceBundle
00467 getWithFallback(const char* key, UErrorCode& status);
00468 #endif
00469
00474 virtual UClassID getDynamicClassID() const;
00475
00481 static UClassID U_EXPORT2 getStaticClassID();
00482
00483 private:
00484 ResourceBundle();
00485
00486 UResourceBundle *fResource;
00487 void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error);
00488 Locale *fLocale;
00489 };
00490
00491 U_NAMESPACE_END
00492 #endif