#include "unicode/utypes.h"
#include "unicode/uloc.h"
Go to the source code of this file.
Typedefs | |
typedef UResourceBundle | UResourceBundle |
ICU 2.0 | |
Enumerations | |
enum | UResType { URES_NONE = -1, URES_STRING = 0, URES_BINARY = 1, URES_TABLE = 2, URES_ALIAS = 3, 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_CAPI UResourceBundle *U_EXPORT2 | ures_open (const char *path, const char *locale, UErrorCode *status) |
Opens a UResourceBundle, from which users can extract strings by using their corresponding keys. | |
U_CAPI UResourceBundle *U_EXPORT2 | ures_openDirect (const char *path, const char *locale, UErrorCode *status) |
This function does not care what kind of localeID is passed in. | |
U_CAPI UResourceBundle *U_EXPORT2 | ures_openU (const UChar *path, const char *locale, UErrorCode *status) |
Same as ures_open() but takes a const UChar *path. | |
U_CAPI int32_t U_EXPORT2 | ures_countArrayItems (const UResourceBundle *resourceBundle, const char *resourceKey, UErrorCode *err) |
Returns the number of strings/arrays in resource bundles. | |
U_CAPI void U_EXPORT2 | 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_CAPI const char *U_EXPORT2 | ures_getVersionNumber (const UResourceBundle *resourceBundle) |
Return the version number associated with this ResourceBundle as a string. | |
U_CAPI void U_EXPORT2 | ures_getVersion (const UResourceBundle *resB, UVersionInfo versionInfo) |
Return the version number associated with this ResourceBundle as an UVersionInfo array. | |
U_CAPI const char *U_EXPORT2 | ures_getLocale (const UResourceBundle *resourceBundle, UErrorCode *status) |
Return the name of the Locale associated with this ResourceBundle. | |
U_CAPI void U_EXPORT2 | ures_openFillIn (UResourceBundle *r, const char *path, const char *localeID, UErrorCode *status) |
Same as ures_open() but uses the fill-in parameter instead of allocating a bundle, if r!=NULL. | |
U_CAPI const UChar *U_EXPORT2 | ures_getString (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a string from a string resource type. | |
U_CAPI const uint8_t *U_EXPORT2 | ures_getBinary (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a binary data from a binary resource. | |
U_CAPI const int32_t *U_EXPORT2 | ures_getIntVector (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a 32 bit integer array from a resource. | |
U_CAPI uint32_t U_EXPORT2 | ures_getUInt (const UResourceBundle *resourceBundle, UErrorCode *status) |
Returns an unsigned integer from a resource. | |
U_CAPI int32_t U_EXPORT2 | ures_getInt (const UResourceBundle *resourceBundle, UErrorCode *status) |
Returns a signed integer from a resource. | |
U_CAPI int32_t U_EXPORT2 | ures_getSize (UResourceBundle *resourceBundle) |
Returns the size of a resource. | |
U_CAPI UResType U_EXPORT2 | ures_getType (UResourceBundle *resourceBundle) |
Returns the type of a resource. | |
U_CAPI const char *U_EXPORT2 | ures_getKey (UResourceBundle *resourceBundle) |
Returns the key associated with a given resource. | |
U_CAPI void U_EXPORT2 | ures_resetIterator (UResourceBundle *resourceBundle) |
Resets the internal context of a resource so that iteration starts from the first element. | |
U_CAPI UBool U_EXPORT2 | ures_hasNext (UResourceBundle *resourceBundle) |
Checks whether the given resource has another element to iterate over. | |
U_CAPI UResourceBundle *U_EXPORT2 | 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_CAPI const UChar *U_EXPORT2 | 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_CAPI UResourceBundle *U_EXPORT2 | ures_getByIndex (const UResourceBundle *resourceBundle, int32_t indexR, UResourceBundle *fillIn, UErrorCode *status) |
Returns the resource in a given resource at the specified index. | |
U_CAPI const UChar *U_EXPORT2 | 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_CAPI UResourceBundle *U_EXPORT2 | 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_CAPI const UChar *U_EXPORT2 | 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. |
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.
|
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.
|
|
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.
|
|
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
|
|
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)
For internal use only.
|
|
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.
|