00001 /* 00002 ********************************************************************** 00003 * Copyright (C) 1997-1999, International Business Machines 00004 * Corporation and others. All Rights Reserved. 00005 ********************************************************************** 00006 * 00007 * File URES.H (formerly CRESBUND.H) 00008 * 00009 * Modification History: 00010 * 00011 * Date Name Description 00012 * 04/01/97 aliu Creation. 00013 * 02/22/99 damiba overhaul. 00014 * 04/04/99 helena Fixed internal header inclusion. 00015 * 04/15/99 Madhu Updated Javadoc 00016 * 06/14/99 stephen Removed functions taking a filename suffix. 00017 * 07/20/99 stephen Language-independent ypedef to void* 00018 * 11/09/99 weiv Added ures_getLocale() 00019 ******************************************************************************* 00020 */ 00021 00022 #ifndef URES_H 00023 #define URES_H 00024 00025 #include "unicode/utypes.h" 00026 #include "unicode/uloc.h" 00027 00148 struct UResourceBundle; 00149 00150 typedef struct UResourceBundle UResourceBundle; 00151 00152 typedef enum { 00153 RES_STRING=0, 00154 RES_BINARY=1, 00155 RES_TABLE=2, 00156 00157 RES_INT=7, 00158 RES_ARRAY=8, 00159 00160 RES_INT_VECTOR=14, 00161 RES_RESERVED=15 00162 } UResType; 00163 00194 U_CAPI UResourceBundle* U_EXPORT2 ures_open(const char* path, /* NULL if none */ 00195 const char* locale, /* NULL if none */ 00196 UErrorCode* status); 00197 00198 00218 U_CAPI UResourceBundle* U_EXPORT2 ures_openW(const wchar_t* path, 00219 const char* locale, 00220 UErrorCode* status); 00221 00238 U_CAPI const UChar* U_EXPORT2 ures_get(const UResourceBundle* resourceBundle, 00239 const char* resourceTag, 00240 UErrorCode* status); 00241 00242 00261 U_CAPI const UChar* U_EXPORT2 ures_getArrayItem(const UResourceBundle* resourceBundle, 00262 const char* resourceTag, 00263 int32_t resourceIndex, 00264 UErrorCode* status); 00265 00266 00287 U_CAPI const UChar* U_EXPORT2 ures_get2dArrayItem(const UResourceBundle* resourceBundle, 00288 const char* resourceTag, 00289 int32_t rowIndex, 00290 int32_t columnIndex, 00291 UErrorCode* status); 00292 00312 U_CAPI const UChar* U_EXPORT2 ures_getTaggedArrayItem(const UResourceBundle* resourceBundle, 00313 const char* resourceTag, 00314 const char* itemTag, 00315 UErrorCode* status); 00316 00317 00338 U_CAPI int32_t U_EXPORT2 ures_countArrayItems(const UResourceBundle* resourceBundle, 00339 const char* resourceKey, 00340 UErrorCode* err); 00354 U_CAPI void U_EXPORT2 ures_close(UResourceBundle* resourceBundle); 00355 00375 U_CAPI const char* U_EXPORT2 ures_getVersionNumber(const UResourceBundle* resourceBundle); 00376 00384 U_CAPI const char* ures_getLocale(const UResourceBundle* resourceBundle, UErrorCode* status); 00385 00386 00388 U_CAPI void ures_openFillIn(UResourceBundle *r, const char* path, 00389 const char* localeID, UErrorCode* status); 00390 00403 U_CAPI const UChar* U_EXPORT2 ures_getString(const UResourceBundle* resourceBundle, int32_t* len, 00404 UErrorCode* status); 00405 00419 U_CAPI const uint8_t* U_EXPORT2 ures_getBinary(const UResourceBundle* resourceBundle, int32_t* len, 00420 UErrorCode* status); 00421 00433 U_CAPI uint32_t U_EXPORT2 ures_getInt(const UResourceBundle* resourceBundle, UErrorCode *status); 00434 00443 U_CAPI int32_t U_EXPORT2 ures_getSize(UResourceBundle *resourceBundle); 00444 00452 U_CAPI UResType U_EXPORT2 ures_getType(UResourceBundle *resourceBundle); 00453 00462 U_CAPI const char * U_EXPORT2 ures_getKey(UResourceBundle *resB); 00463 00464 /* ITERATION API 00465 This API provides means for iterating through a resource 00466 */ 00467 00474 U_CAPI void U_EXPORT2 ures_resetIterator(UResourceBundle *resourceBundle); 00475 00483 U_CAPI UBool U_EXPORT2 ures_hasNext(UResourceBundle *resourceBundle); 00484 00496 U_CAPI UResourceBundle* U_EXPORT2 ures_getNextResource(UResourceBundle *resourceBundle, UResourceBundle *fillIn, UErrorCode *status); 00497 00509 U_CAPI const UChar* U_EXPORT2 ures_getNextString(UResourceBundle *resourceBundle, int32_t* len, const char ** key, UErrorCode *status); 00510 00522 U_CAPI UResourceBundle* U_EXPORT2 ures_getByIndex(const UResourceBundle *resourceBundle, int32_t indexR, UResourceBundle *fillIn, UErrorCode *status); 00523 00534 U_CAPI const UChar* U_EXPORT2 ures_getStringByIndex(const UResourceBundle *resB, int32_t indexS, int32_t* len, UErrorCode *status); 00535 00548 U_CAPI UResourceBundle* U_EXPORT2 ures_getByKey(const UResourceBundle *resourceBundle, const char* key, UResourceBundle *fillIn, UErrorCode *status); 00549 00561 U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, const char* key, int32_t* len, UErrorCode *status); 00562 00563 00564 00565 #endif /*_URES*/ 00566 /*eof*/