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
00135 ResourceBundle(const char* path,
00136 const Locale& locale,
00137 UErrorCode& err);
00138
00145 ResourceBundle(const ResourceBundle &original);
00146
00154 ResourceBundle(UResourceBundle *res,
00155 UErrorCode &status);
00156
00163 ResourceBundle&
00164 operator=(const ResourceBundle& other);
00165
00169 ~ResourceBundle();
00170
00178 int32_t
00179 getSize(void) const;
00180
00191 UnicodeString
00192 getString(UErrorCode& status) const;
00193
00206 const uint8_t*
00207 getBinary(int32_t& len, UErrorCode& status) const;
00208
00209
00221 const int32_t*
00222 getIntVector(int32_t& len, UErrorCode& status) const;
00223
00235 uint32_t
00236 getUInt(UErrorCode& status) const;
00237
00249 int32_t
00250 getInt(UErrorCode& status) const;
00251
00258 UBool
00259 hasNext(void) const;
00260
00266 void
00267 resetIterator(void);
00268
00276 const char*
00277 getKey(void);
00278
00286 const char*
00287 getName(void);
00288
00289
00296 UResType
00297 getType(void);
00298
00306 ResourceBundle
00307 getNext(UErrorCode& status);
00308
00317 UnicodeString
00318 getNextString(UErrorCode& status);
00319
00329 UnicodeString
00330 getNextString(const char ** key,
00331 UErrorCode& status);
00332
00341 ResourceBundle
00342 get(int32_t index,
00343 UErrorCode& status) const;
00344
00353 UnicodeString
00354 getStringEx(int32_t index,
00355 UErrorCode& status) const;
00356
00366 ResourceBundle
00367 get(const char* key,
00368 UErrorCode& status) const;
00369
00379 UnicodeString
00380 getStringEx(const char* key,
00381 UErrorCode& status) const;
00382
00392 const char*
00393 getVersionNumber(void) const;
00394
00402 void
00403 getVersion(UVersionInfo versionInfo) const;
00404
00411 const Locale&
00412 getLocale(void) const;
00413
00419 virtual inline UClassID getDynamicClassID() const;
00420
00426 static inline UClassID getStaticClassID();
00427
00428 private:
00429 ResourceBundle();
00430
00431 UResourceBundle *resource;
00432 void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error);
00433 Locale *locName;
00434
00439 static const char fgClassID;
00440 };
00441
00442 inline UClassID
00443 ResourceBundle::getStaticClassID()
00444 { return (UClassID)&fgClassID; }
00445
00446 inline UClassID
00447 ResourceBundle::getDynamicClassID() const
00448 { return ResourceBundle::getStaticClassID(); }
00449
00450 U_NAMESPACE_END
00451 #endif