#include "unicode/utypes.h"
#include "unicode/uloc.h"
Go to the source code of this file.
Typedefs | |
typedef UResourceBundle | UResourceBundle |
Enumerations | |
enum | UResType { URES_NONE = -1, URES_STRING = 0, URES_BINARY = 1, URES_TABLE = 2, URES_ALIAS = 3, URES_TABLE32 = 4, URES_INT = 7, URES_ARRAY = 8, URES_INT_VECTOR = 14, RES_NONE = URES_NONE, RES_STRING = URES_STRING, RES_BINARY = URES_BINARY, RES_TABLE = URES_TABLE, RES_ALIAS = URES_ALIAS, RES_INT = URES_INT, RES_ARRAY = URES_ARRAY, RES_INT_VECTOR = URES_INT_VECTOR, RES_RESERVED = 15 } |
Numeric constants for types of resource items. More... | |
Functions | |
U_STABLE UResourceBundle * | ures_open (const char *packageName, const char *locale, UErrorCode *status) |
Opens a UResourceBundle, from which users can extract strings by using their corresponding keys. | |
U_STABLE UResourceBundle * | ures_openDirect (const char *packageName, const char *locale, UErrorCode *status) |
This function does not care what kind of localeID is passed in. | |
U_STABLE UResourceBundle * | ures_openU (const UChar *packageName, const char *locale, UErrorCode *status) |
Same as ures_open() but takes a const UChar *path. | |
U_DEPRECATED int32_t | ures_countArrayItems (const UResourceBundle *resourceBundle, const char *resourceKey, UErrorCode *err) |
Returns the number of strings/arrays in resource bundles. | |
U_STABLE void | ures_close (UResourceBundle *resourceBundle) |
Close a resource bundle, all pointers returned from the various ures_getXXX calls on this particular bundle should be considered invalid henceforth. | |
U_DEPRECATED const char * | ures_getVersionNumber (const UResourceBundle *resourceBundle) |
Return the version number associated with this ResourceBundle as a string. | |
U_STABLE void | ures_getVersion (const UResourceBundle *resB, UVersionInfo versionInfo) |
Return the version number associated with this ResourceBundle as an UVersionInfo array. | |
U_DEPRECATED const char * | ures_getLocale (const UResourceBundle *resourceBundle, UErrorCode *status) |
Return the name of the Locale associated with this ResourceBundle. | |
U_DRAFT const char * | ures_getLocaleByType (const UResourceBundle *resourceBundle, ULocDataLocaleType type, UErrorCode *status) |
Return the name of the Locale associated with this ResourceBundle. | |
U_INTERNAL void | ures_openFillIn (UResourceBundle *r, const char *packageName, const char *localeID, UErrorCode *status) |
Same as ures_open() but uses the fill-in parameter instead of allocating a bundle, if r!=NULL. | |
U_STABLE const UChar * | ures_getString (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a string from a string resource type. | |
U_STABLE const uint8_t * | ures_getBinary (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a binary data from a binary resource. | |
U_STABLE const int32_t * | ures_getIntVector (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a 32 bit integer array from a resource. | |
U_STABLE uint32_t | ures_getUInt (const UResourceBundle *resourceBundle, UErrorCode *status) |
Returns an unsigned integer from a resource. | |
U_STABLE int32_t | ures_getInt (const UResourceBundle *resourceBundle, UErrorCode *status) |
Returns a signed integer from a resource. | |
U_STABLE int32_t | ures_getSize (const UResourceBundle *resourceBundle) |
Returns the size of a resource. | |
U_STABLE UResType | ures_getType (const UResourceBundle *resourceBundle) |
Returns the type of a resource. | |
U_STABLE const char * | ures_getKey (const UResourceBundle *resourceBundle) |
Returns the key associated with a given resource. | |
U_STABLE void | ures_resetIterator (UResourceBundle *resourceBundle) |
Resets the internal context of a resource so that iteration starts from the first element. | |
U_STABLE UBool | ures_hasNext (const UResourceBundle *resourceBundle) |
Checks whether the given resource has another element to iterate over. | |
U_STABLE UResourceBundle * | ures_getNextResource (UResourceBundle *resourceBundle, UResourceBundle *fillIn, UErrorCode *status) |
Returns the next resource in a given resource or NULL if there are no more resources to iterate over. | |
U_STABLE const UChar * | ures_getNextString (UResourceBundle *resourceBundle, int32_t *len, const char **key, UErrorCode *status) |
Returns the next string in a given resource or NULL if there are no more resources to iterate over. | |
U_STABLE UResourceBundle * | ures_getByIndex (const UResourceBundle *resourceBundle, int32_t indexR, UResourceBundle *fillIn, UErrorCode *status) |
Returns the resource in a given resource at the specified index. | |
U_STABLE const UChar * | ures_getStringByIndex (const UResourceBundle *resourceBundle, int32_t indexS, int32_t *len, UErrorCode *status) |
Returns the string in a given resource at the specified index. | |
U_STABLE UResourceBundle * | ures_getByKey (const UResourceBundle *resourceBundle, const char *key, UResourceBundle *fillIn, UErrorCode *status) |
Returns a resource in a given resource that has a given key. | |
U_STABLE const UChar * | ures_getStringByKey (const UResourceBundle *resB, const char *key, int32_t *len, UErrorCode *status) |
Returns a string in a given resource that has a given key. | |
U_INTERNAL UResourceBundle * | ures_getByKeyWithFallback (const UResourceBundle *resB, const char *inKey, UResourceBundle *fillIn, UErrorCode *status) |
Get a resource with multi-level fallback. | |
U_DRAFT UEnumeration * | ures_openAvailableLocales (const char *packageName, UErrorCode *status) |
Create a string enumerator, owned by the caller, of all locales located within the specified resource tree. |
C API representing a collection of resource information pertaining to a given locale. A resource bundle provides a way of accessing locale- specific information in a data file. You create a resource bundle that manages the resources for a given locale and then ask it for individual resources.
Resource bundles in ICU4C are currently defined using text files which conform to the following BNF definition. More on resource bundle concepts and syntax can be found in the Users Guide.
Definition in file ures.h.
|
|
|
Numeric constants for types of resource items.
|
|
Close a resource bundle, all pointers returned from the various ures_getXXX calls on this particular bundle should be considered invalid henceforth.
|
|
Returns the number of strings/arrays in resource bundles. Better to use ures_getSize, as this function will be deprecated.
|
|
Returns a binary data from a binary resource.
|
|
Returns the resource in a given resource at the specified index. Features a fill-in parameter.
|
|
Returns a resource in a given resource that has a given key. This procedure works only with table resources. Features a fill-in parameter.
|
|
Get a resource with multi-level fallback. Normally only the top level resources will fallback to its parent. This performs fallback on subresources. For example, when a table is defined in a resource bundle and a parent resource bundle, normally no fallback occurs on the sub-resources because the table is defined in the current resource bundle, but this function can perform fallback on the sub-resources of the table.
|
|
Returns a signed integer from a resource. This integer is originally 28 bit and the sign gets propagated.
|
|
Returns a 32 bit integer array from a resource.
|
|
Returns the key associated with a given resource. Not all the resources have a key - only those that are members of a table.
|
|
Return the name of the Locale associated with this ResourceBundle. This API allows you to query for the real locale of the resource. For example, if you requested "en_US_CALIFORNIA" and only "en_US" bundle exists, "en_US" will be returned. For subresources, the locale where this resource comes from will be returned. If fallback has occured, getLocale will reflect this.
|
|
Return the name of the Locale associated with this ResourceBundle. You can choose between requested, valid and real locale.
|
|
Returns the next resource in a given resource or NULL if there are no more resources to iterate over. Features a fill-in parameter.
|
|
Returns the next string in a given resource or NULL if there are no more resources to iterate over.
|
|
Returns the size of a resource. Size for scalar types is always 1, and for vector/table types is the number of child resources.
|
|
Returns a string from a string resource type.
|
|
Returns the string in a given resource at the specified index.
|
|
Returns a string in a given resource that has a given key. This procedure works only with table resources.
|
|
Returns the type of a resource. Available types are defined in enum UResType
|
|
Returns an unsigned integer from a resource. This integer is originally 28 bits.
|
|
Return the version number associated with this ResourceBundle as an UVersionInfo array.
|
|
Return the version number associated with this ResourceBundle as a string. Please use ures_getVersion as this function is going to be deprecated.
|
|
Checks whether the given resource has another element to iterate over.
|
|
Opens a UResourceBundle, from which users can extract strings by using their corresponding keys.
Note that the caller is responsible of calling
|
|
Create a string enumerator, owned by the caller, of all locales located within the specified resource tree.
|
|
This function does not care what kind of localeID is passed in. It simply opens a bundle with that name. Fallback mechanism is disabled for the new bundle. If the requested bundle contains an %ALIAS directive, the results are undefined.
|
|
Same as ures_open() but uses the fill-in parameter instead of allocating a bundle, if r!=NULL. TODO need to revisit usefulness of this function and usage model for fillIn parameters without knowing sizeof(UResourceBundle)
|
|
Same as ures_open() but takes a const UChar *path. This path will be converted to char * using the default converter, then ures_open() is called.
|
|
Resets the internal context of a resource so that iteration starts from the first element.
|