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
00125 struct UResourceBundle;
00126
00130 typedef struct UResourceBundle UResourceBundle;
00131
00136 typedef enum {
00137 RES_NONE=-1,
00138 RES_STRING=0,
00139 RES_BINARY=1,
00140 RES_TABLE=2,
00141
00142
00143
00144 RES_ALIAS=3,
00145
00146 RES_INT=7,
00147 RES_ARRAY=8,
00148
00149 RES_INT_VECTOR=14,
00150 RES_RESERVED=15
00151 } UResType;
00152
00153
00154
00155
00156
00183 U_CAPI UResourceBundle* U_EXPORT2
00184 ures_open(const char* path,
00185 const char* locale,
00186 UErrorCode* status);
00187
00188
00205 U_CAPI UResourceBundle* U_EXPORT2
00206 ures_openDirect(const char* path,
00207 const char* locale,
00208 UErrorCode* status);
00209
00210 #ifdef ICU_URES_USE_DEPRECATES
00211
00230 U_CAPI UResourceBundle* U_EXPORT2
00231 ures_openW(const wchar_t* path,
00232 const char* locale,
00233 UErrorCode* status);
00234 #endif
00235
00250 U_CAPI UResourceBundle* U_EXPORT2
00251 ures_openU(const UChar* path,
00252 const char* locale,
00253 UErrorCode* status);
00254
00271 U_CAPI int32_t U_EXPORT2
00272 ures_countArrayItems(const UResourceBundle* resourceBundle,
00273 const char* resourceKey,
00274 UErrorCode* err);
00283 U_CAPI void U_EXPORT2
00284 ures_close(UResourceBundle* resourceBundle);
00285
00296 U_CAPI const char* U_EXPORT2
00297 ures_getVersionNumber(const UResourceBundle* resourceBundle);
00298
00308 U_CAPI void U_EXPORT2
00309 ures_getVersion(const UResourceBundle* resB,
00310 UVersionInfo versionInfo);
00311
00323 U_CAPI const char* U_EXPORT2
00324 ures_getLocale(const UResourceBundle* resourceBundle,
00325 UErrorCode* status);
00326
00340 U_CAPI void U_EXPORT2
00341 ures_openFillIn(UResourceBundle *r,
00342 const char* path,
00343 const char* localeID,
00344 UErrorCode* status);
00345
00363 U_CAPI const UChar* U_EXPORT2
00364 ures_getString(const UResourceBundle* resourceBundle,
00365 int32_t* len,
00366 UErrorCode* status);
00367
00385 U_CAPI const uint8_t* U_EXPORT2
00386 ures_getBinary(const UResourceBundle* resourceBundle,
00387 int32_t* len,
00388 UErrorCode* status);
00389
00407 U_CAPI const int32_t* U_EXPORT2
00408 ures_getIntVector(const UResourceBundle* resourceBundle,
00409 int32_t* len,
00410 UErrorCode* status);
00411
00428 U_CAPI uint32_t U_EXPORT2
00429 ures_getUInt(const UResourceBundle* resourceBundle,
00430 UErrorCode *status);
00431
00448 U_CAPI int32_t U_EXPORT2
00449 ures_getInt(const UResourceBundle* resourceBundle,
00450 UErrorCode *status);
00451
00463 U_CAPI int32_t U_EXPORT2
00464 ures_getSize(UResourceBundle *resourceBundle);
00465
00474 U_CAPI UResType U_EXPORT2
00475 ures_getType(UResourceBundle *resourceBundle);
00476
00485 U_CAPI const char * U_EXPORT2
00486 ures_getKey(UResourceBundle *resB);
00487
00488
00489
00490
00491
00498 U_CAPI void U_EXPORT2
00499 ures_resetIterator(UResourceBundle *resourceBundle);
00500
00508 U_CAPI UBool U_EXPORT2
00509 ures_hasNext(UResourceBundle *resourceBundle);
00510
00523 U_CAPI UResourceBundle* U_EXPORT2
00524 ures_getNextResource(UResourceBundle *resourceBundle,
00525 UResourceBundle *fillIn,
00526 UErrorCode *status);
00527
00540 U_CAPI const UChar* U_EXPORT2
00541 ures_getNextString(UResourceBundle *resourceBundle,
00542 int32_t* len,
00543 const char ** key,
00544 UErrorCode *status);
00545
00558 U_CAPI UResourceBundle* U_EXPORT2
00559 ures_getByIndex(const UResourceBundle *resourceBundle,
00560 int32_t indexR,
00561 UResourceBundle *fillIn,
00562 UErrorCode *status);
00563
00575 U_CAPI const UChar* U_EXPORT2
00576 ures_getStringByIndex(const UResourceBundle *resB,
00577 int32_t indexS,
00578 int32_t* len,
00579 UErrorCode *status);
00580
00593 U_CAPI UResourceBundle* U_EXPORT2
00594 ures_getByKey(const UResourceBundle *resourceBundle,
00595 const char* key,
00596 UResourceBundle *fillIn,
00597 UErrorCode *status);
00598
00611 U_CAPI const UChar* U_EXPORT2
00612 ures_getStringByKey(const UResourceBundle *resB,
00613 const char* key,
00614 int32_t* len,
00615 UErrorCode *status);
00616
00617 #ifdef XP_CPLUSPLUS
00618 #include "unicode/unistr.h"
00619
00620 U_NAMESPACE_BEGIN
00632 inline UnicodeString
00633 ures_getUnicodeString(const UResourceBundle *resB,
00634 UErrorCode* status)
00635 {
00636 int32_t len = 0;
00637 const UChar *r = ures_getString(resB, &len, status);
00638 return UnicodeString(TRUE, r, len);
00639 }
00640
00651 inline UnicodeString
00652 ures_getNextUnicodeString(UResourceBundle *resB,
00653 const char ** key,
00654 UErrorCode* status)
00655 {
00656 int32_t len = 0;
00657 const UChar* r = ures_getNextString(resB, &len, key, status);
00658 return UnicodeString(TRUE, r, len);
00659 }
00660
00670 inline UnicodeString
00671 ures_getUnicodeStringByIndex(const UResourceBundle *resB,
00672 int32_t indexS,
00673 UErrorCode* status)
00674 {
00675 int32_t len = 0;
00676 const UChar* r = ures_getStringByIndex(resB, indexS, &len, status);
00677 return UnicodeString(TRUE, r, len);
00678 }
00679
00690 inline UnicodeString
00691 ures_getUnicodeStringByKey(const UResourceBundle *resB,
00692 const char* key,
00693 UErrorCode* status)
00694 {
00695 int32_t len = 0;
00696 const UChar* r = ures_getStringByKey(resB, key, &len, status);
00697 return UnicodeString(TRUE, r, len);
00698 }
00699
00700 U_NAMESPACE_END
00701
00702 #endif
00703
00704 #endif
00705