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
00091
URES_TABLE32=4,
00092
00100
URES_INT=7,
00101
00103
URES_ARRAY=8,
00104
00110
URES_INT_VECTOR=14,
00111
00112
#ifndef U_HIDE_DEPRECATED_API
00113
00114
RES_NONE=
URES_NONE,
00116
RES_STRING=
URES_STRING,
00118
RES_BINARY=
URES_BINARY,
00120
RES_TABLE=
URES_TABLE,
00122
RES_ALIAS=
URES_ALIAS,
00124
RES_INT=
URES_INT,
00126
RES_ARRAY=
URES_ARRAY,
00128
RES_INT_VECTOR=
URES_INT_VECTOR,
00129
#endif
00130
00132
RES_RESERVED=15
00133 }
UResType;
00134
00135
00136
00137
00138
00166
U_STABLE UResourceBundle*
U_EXPORT2
00167
ures_open(
const char* path,
00168
const char* locale,
00169 UErrorCode* status);
00170
00171
00188
U_STABLE UResourceBundle*
U_EXPORT2
00189
ures_openDirect(
const char* path,
00190
const char* locale,
00191 UErrorCode* status);
00192
00208
U_STABLE UResourceBundle*
U_EXPORT2
00209
ures_openU(
const UChar* path,
00210
const char* locale,
00211 UErrorCode* status);
00212
00229
U_DEPRECATED int32_t U_EXPORT2
00230
ures_countArrayItems(
const UResourceBundle* resourceBundle,
00231
const char* resourceKey,
00232 UErrorCode* err);
00241
U_STABLE void U_EXPORT2
00242
ures_close(UResourceBundle* resourceBundle);
00243
00254
U_DEPRECATED const char*
U_EXPORT2
00255
ures_getVersionNumber(
const UResourceBundle* resourceBundle);
00256
00266
U_STABLE void U_EXPORT2
00267
ures_getVersion(
const UResourceBundle* resB,
00268 UVersionInfo versionInfo);
00269
00282
U_DEPRECATED const char*
U_EXPORT2
00283
ures_getLocale(
const UResourceBundle* resourceBundle,
00284 UErrorCode* status);
00285
00286
00299
U_DRAFT const char*
U_EXPORT2
00300
ures_getLocaleByType(
const UResourceBundle* resourceBundle,
00301 ULocDataLocaleType type,
00302 UErrorCode* status);
00303
00304
00318
U_INTERNAL void U_EXPORT2
00319
ures_openFillIn(UResourceBundle *r,
00320
const char* path,
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
00363
U_STABLE const uint8_t*
U_EXPORT2
00364
ures_getBinary(
const UResourceBundle* resourceBundle,
00365 int32_t* len,
00366 UErrorCode* status);
00367
00385
U_STABLE const int32_t*
U_EXPORT2
00386
ures_getIntVector(
const UResourceBundle* resourceBundle,
00387 int32_t* len,
00388 UErrorCode* status);
00389
00406
U_STABLE uint32_t U_EXPORT2
00407
ures_getUInt(
const UResourceBundle* resourceBundle,
00408 UErrorCode *status);
00409
00426
U_STABLE int32_t U_EXPORT2
00427
ures_getInt(
const UResourceBundle* resourceBundle,
00428 UErrorCode *status);
00429
00440
U_STABLE int32_t U_EXPORT2
00441
ures_getSize(
const UResourceBundle *resourceBundle);
00442
00451
U_STABLE UResType U_EXPORT2
00452
ures_getType(
const UResourceBundle *resourceBundle);
00453
00462
U_STABLE const char *
U_EXPORT2
00463
ures_getKey(
const UResourceBundle *resourceBundle);
00464
00465
00466
00467
00468
00475
U_STABLE void U_EXPORT2
00476
ures_resetIterator(UResourceBundle *resourceBundle);
00477
00485
U_STABLE UBool U_EXPORT2
00486
ures_hasNext(
const UResourceBundle *resourceBundle);
00487
00500
U_STABLE UResourceBundle*
U_EXPORT2
00501
ures_getNextResource(UResourceBundle *resourceBundle,
00502 UResourceBundle *fillIn,
00503 UErrorCode *status);
00504
00517
U_STABLE const UChar*
U_EXPORT2
00518
ures_getNextString(UResourceBundle *resourceBundle,
00519 int32_t* len,
00520
const char ** key,
00521 UErrorCode *status);
00522
00535
U_STABLE UResourceBundle*
U_EXPORT2
00536
ures_getByIndex(
const UResourceBundle *resourceBundle,
00537 int32_t indexR,
00538 UResourceBundle *fillIn,
00539 UErrorCode *status);
00540
00552
U_STABLE const UChar*
U_EXPORT2
00553
ures_getStringByIndex(
const UResourceBundle *resourceBundle,
00554 int32_t indexS,
00555 int32_t* len,
00556 UErrorCode *status);
00557
00570
U_STABLE UResourceBundle*
U_EXPORT2
00571
ures_getByKey(
const UResourceBundle *resourceBundle,
00572
const char* key,
00573 UResourceBundle *fillIn,
00574 UErrorCode *status);
00575
00588
U_STABLE const UChar*
U_EXPORT2
00589
ures_getStringByKey(
const UResourceBundle *resB,
00590
const char* key,
00591 int32_t* len,
00592 UErrorCode *status);
00593
00594
#ifdef XP_CPLUSPLUS
00595
#include "unicode/unistr.h"
00596
00597
U_NAMESPACE_BEGIN
00609
inline UnicodeString
00610 ures_getUnicodeString(
const UResourceBundle *resB,
00611 UErrorCode* status)
00612 {
00613
int32_t len = 0;
00614
const UChar *r =
ures_getString(resB, &len, status);
00615
return UnicodeString(TRUE, r, len);
00616 }
00617
00628
inline UnicodeString
00629 ures_getNextUnicodeString(UResourceBundle *resB,
00630
const char ** key,
00631 UErrorCode* status)
00632 {
00633
int32_t len = 0;
00634
const UChar* r =
ures_getNextString(resB, &len, key, status);
00635
return UnicodeString(TRUE, r, len);
00636 }
00637
00647
inline UnicodeString
00648 ures_getUnicodeStringByIndex(
const UResourceBundle *resB,
00649 int32_t indexS,
00650 UErrorCode* status)
00651 {
00652
int32_t len = 0;
00653
const UChar* r =
ures_getStringByIndex(resB, indexS, &len, status);
00654
return UnicodeString(TRUE, r, len);
00655 }
00656
00667
inline UnicodeString
00668 ures_getUnicodeStringByKey(
const UResourceBundle *resB,
00669
const char* key,
00670 UErrorCode* status)
00671 {
00672
int32_t len = 0;
00673
const UChar* r =
ures_getStringByKey(resB, key, &len, status);
00674
return UnicodeString(TRUE, r, len);
00675 }
00676
00677
U_NAMESPACE_END
00678
00679
#endif
00680
00681
00690
U_INTERNAL UEnumeration*
U_EXPORT2
00691
ures_openAvailableLocales(
const char *path, UErrorCode *status);
00692
00710
U_INTERNAL int32_t U_EXPORT2
00711
ures_getFunctionalEquivalent(
char *result, int32_t resultCapacity,
00712
const char *path,
const char *resName,
const char *keyword,
const char *locid,
00713 UBool *isAvailable, UBool omitDefault, UErrorCode *status);
00714
00723
U_INTERNAL UEnumeration*
U_EXPORT2
00724
ures_getKeywordValues(
const char *path,
const char *keyword, UErrorCode *status);
00725
00726
#endif
00727