00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef URES_H
00024 #define URES_H
00025
00026 #include "unicode/utypes.h"
00027 #include "unicode/uloc.h"
00028
00051 struct UResourceBundle;
00052
00056 typedef struct UResourceBundle UResourceBundle;
00057
00063 typedef enum {
00065 URES_NONE=-1,
00066
00068 URES_STRING=0,
00069
00071 URES_BINARY=1,
00072
00074 URES_TABLE=2,
00075
00083 URES_ALIAS=3,
00084
00092 URES_INT=7,
00093
00095 URES_ARRAY=8,
00096
00102 URES_INT_VECTOR = 14,
00103 #ifndef U_HIDE_DEPRECATED_API
00104
00105 RES_NONE=URES_NONE,
00107 RES_STRING=URES_STRING,
00109 RES_BINARY=URES_BINARY,
00111 RES_TABLE=URES_TABLE,
00113 RES_ALIAS=URES_ALIAS,
00115 RES_INT=URES_INT,
00117 RES_ARRAY=URES_ARRAY,
00119 RES_INT_VECTOR=URES_INT_VECTOR,
00121 RES_RESERVED=15,
00122 #endif
00123
00124 URES_LIMIT = 16
00125 } UResType;
00126
00127
00128
00129
00130
00159 U_STABLE UResourceBundle* U_EXPORT2
00160 ures_open(const char* packageName,
00161 const char* locale,
00162 UErrorCode* status);
00163
00164
00182 U_STABLE UResourceBundle* U_EXPORT2
00183 ures_openDirect(const char* packageName,
00184 const char* locale,
00185 UErrorCode* status);
00186
00205 U_STABLE UResourceBundle* U_EXPORT2
00206 ures_openU(const UChar* packageName,
00207 const char* locale,
00208 UErrorCode* status);
00209
00226 U_DEPRECATED int32_t U_EXPORT2
00227 ures_countArrayItems(const UResourceBundle* resourceBundle,
00228 const char* resourceKey,
00229 UErrorCode* err);
00238 U_STABLE void U_EXPORT2
00239 ures_close(UResourceBundle* resourceBundle);
00240
00251 U_DEPRECATED const char* U_EXPORT2
00252 ures_getVersionNumber(const UResourceBundle* resourceBundle);
00253
00263 U_STABLE void U_EXPORT2
00264 ures_getVersion(const UResourceBundle* resB,
00265 UVersionInfo versionInfo);
00266
00279 U_DEPRECATED const char* U_EXPORT2
00280 ures_getLocale(const UResourceBundle* resourceBundle,
00281 UErrorCode* status);
00282
00283
00296 U_STABLE const char* U_EXPORT2
00297 ures_getLocaleByType(const UResourceBundle* resourceBundle,
00298 ULocDataLocaleType type,
00299 UErrorCode* status);
00300
00301
00318 U_INTERNAL void U_EXPORT2
00319 ures_openFillIn(UResourceBundle *r,
00320 const char* packageName,
00321 const char* localeID,
00322 UErrorCode* status);
00323
00341 U_STABLE const UChar* U_EXPORT2
00342 ures_getString(const UResourceBundle* resourceBundle,
00343 int32_t* len,
00344 UErrorCode* status);
00345
00393 U_STABLE const char * U_EXPORT2
00394 ures_getUTF8String(const UResourceBundle *resB,
00395 char *dest, int32_t *length,
00396 UBool forceCopy,
00397 UErrorCode *status);
00398
00416 U_STABLE const uint8_t* U_EXPORT2
00417 ures_getBinary(const UResourceBundle* resourceBundle,
00418 int32_t* len,
00419 UErrorCode* status);
00420
00438 U_STABLE const int32_t* U_EXPORT2
00439 ures_getIntVector(const UResourceBundle* resourceBundle,
00440 int32_t* len,
00441 UErrorCode* status);
00442
00459 U_STABLE uint32_t U_EXPORT2
00460 ures_getUInt(const UResourceBundle* resourceBundle,
00461 UErrorCode *status);
00462
00479 U_STABLE int32_t U_EXPORT2
00480 ures_getInt(const UResourceBundle* resourceBundle,
00481 UErrorCode *status);
00482
00493 U_STABLE int32_t U_EXPORT2
00494 ures_getSize(const UResourceBundle *resourceBundle);
00495
00504 U_STABLE UResType U_EXPORT2
00505 ures_getType(const UResourceBundle *resourceBundle);
00506
00515 U_STABLE const char * U_EXPORT2
00516 ures_getKey(const UResourceBundle *resourceBundle);
00517
00518
00519
00520
00521
00528 U_STABLE void U_EXPORT2
00529 ures_resetIterator(UResourceBundle *resourceBundle);
00530
00538 U_STABLE UBool U_EXPORT2
00539 ures_hasNext(const UResourceBundle *resourceBundle);
00540
00553 U_STABLE UResourceBundle* U_EXPORT2
00554 ures_getNextResource(UResourceBundle *resourceBundle,
00555 UResourceBundle *fillIn,
00556 UErrorCode *status);
00557
00570 U_STABLE const UChar* U_EXPORT2
00571 ures_getNextString(UResourceBundle *resourceBundle,
00572 int32_t* len,
00573 const char ** key,
00574 UErrorCode *status);
00575
00588 U_STABLE UResourceBundle* U_EXPORT2
00589 ures_getByIndex(const UResourceBundle *resourceBundle,
00590 int32_t indexR,
00591 UResourceBundle *fillIn,
00592 UErrorCode *status);
00593
00605 U_STABLE const UChar* U_EXPORT2
00606 ures_getStringByIndex(const UResourceBundle *resourceBundle,
00607 int32_t indexS,
00608 int32_t* len,
00609 UErrorCode *status);
00610
00659 U_STABLE const char * U_EXPORT2
00660 ures_getUTF8StringByIndex(const UResourceBundle *resB,
00661 int32_t stringIndex,
00662 char *dest, int32_t *pLength,
00663 UBool forceCopy,
00664 UErrorCode *status);
00665
00678 U_STABLE UResourceBundle* U_EXPORT2
00679 ures_getByKey(const UResourceBundle *resourceBundle,
00680 const char* key,
00681 UResourceBundle *fillIn,
00682 UErrorCode *status);
00683
00696 U_STABLE const UChar* U_EXPORT2
00697 ures_getStringByKey(const UResourceBundle *resB,
00698 const char* key,
00699 int32_t* len,
00700 UErrorCode *status);
00701
00752 U_STABLE const char * U_EXPORT2
00753 ures_getUTF8StringByKey(const UResourceBundle *resB,
00754 const char *key,
00755 char *dest, int32_t *pLength,
00756 UBool forceCopy,
00757 UErrorCode *status);
00758
00759 #ifdef XP_CPLUSPLUS
00760 #include "unicode/unistr.h"
00761
00762 U_NAMESPACE_BEGIN
00774 inline UnicodeString
00775 ures_getUnicodeString(const UResourceBundle *resB,
00776 UErrorCode* status)
00777 {
00778 int32_t len = 0;
00779 const UChar *r = ures_getString(resB, &len, status);
00780 return UnicodeString(TRUE, r, len);
00781 }
00782
00793 inline UnicodeString
00794 ures_getNextUnicodeString(UResourceBundle *resB,
00795 const char ** key,
00796 UErrorCode* status)
00797 {
00798 int32_t len = 0;
00799 const UChar* r = ures_getNextString(resB, &len, key, status);
00800 return UnicodeString(TRUE, r, len);
00801 }
00802
00812 inline UnicodeString
00813 ures_getUnicodeStringByIndex(const UResourceBundle *resB,
00814 int32_t indexS,
00815 UErrorCode* status)
00816 {
00817 int32_t len = 0;
00818 const UChar* r = ures_getStringByIndex(resB, indexS, &len, status);
00819 return UnicodeString(TRUE, r, len);
00820 }
00821
00832 inline UnicodeString
00833 ures_getUnicodeStringByKey(const UResourceBundle *resB,
00834 const char* key,
00835 UErrorCode* status)
00836 {
00837 int32_t len = 0;
00838 const UChar* r = ures_getStringByKey(resB, key, &len, status);
00839 return UnicodeString(TRUE, r, len);
00840 }
00841
00842 U_NAMESPACE_END
00843
00844 #endif
00845
00854 U_STABLE UEnumeration* U_EXPORT2
00855 ures_openAvailableLocales(const char *packageName, UErrorCode *status);
00856
00857
00858 #endif
00859