#include "unicode/utypes.h"
#include "unicode/uloc.h"
#include "unicode/unistr.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 | |
UResourceBundle * | ures_open (const char *path, const char *locale, UErrorCode *status) |
Opens a UResourceBundle, from which users can extract strings by using their corresponding keys. More... | |
UResourceBundle * | ures_openDirect (const char *path, const char *locale, UErrorCode *status) |
This function does not care what kind of localeID is passed in. More... | |
UResourceBundle * | ures_openU (const UChar *path, const char *locale, UErrorCode *status) |
Same as ures_open() but takes a const UChar *path. More... | |
int32_t | ures_countArrayItems (const UResourceBundle *resourceBundle, const char *resourceKey, UErrorCode *err) |
Returns the number of strings/arrays in resource bundles. More... | |
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. More... | |
const char * | ures_getVersionNumber (const UResourceBundle *resourceBundle) |
Return the version number associated with this ResourceBundle as a string. More... | |
void | ures_getVersion (const UResourceBundle *resB, UVersionInfo versionInfo) |
Return the version number associated with this ResourceBundle as an UVersionInfo array. More... | |
const char * | ures_getLocale (const UResourceBundle *resourceBundle, UErrorCode *status) |
Return the name of the Locale associated with this ResourceBundle. More... | |
const char * | ures_getLocaleByType (const UResourceBundle *resourceBundle, ULocDataLocaleType type, UErrorCode *status) |
Return the name of the Locale associated with this ResourceBundle. More... | |
void | 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. More... | |
const UChar * | ures_getString (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a string from a string resource type. More... | |
const uint8_t * | ures_getBinary (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a binary data from a binary resource. More... | |
const int32_t * | ures_getIntVector (const UResourceBundle *resourceBundle, int32_t *len, UErrorCode *status) |
Returns a 32 bit integer array from a resource. More... | |
uint32_t | ures_getUInt (const UResourceBundle *resourceBundle, UErrorCode *status) |
Returns an unsigned integer from a resource. More... | |
int32_t | ures_getInt (const UResourceBundle *resourceBundle, UErrorCode *status) |
Returns a signed integer from a resource. More... | |
int32_t | ures_getSize (UResourceBundle *resourceBundle) |
Returns the size of a resource. More... | |
UResType | ures_getType (UResourceBundle *resourceBundle) |
Returns the type of a resource. More... | |
const char * | ures_getKey (UResourceBundle *resourceBundle) |
Returns the key associated with a given resource. More... | |
void | ures_resetIterator (UResourceBundle *resourceBundle) |
Resets the internal context of a resource so that iteration starts from the first element. More... | |
UBool | ures_hasNext (UResourceBundle *resourceBundle) |
Checks whether the given resource has another element to iterate over. More... | |
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. More... | |
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. More... | |
UResourceBundle * | ures_getByIndex (const UResourceBundle *resourceBundle, int32_t indexR, UResourceBundle *fillIn, UErrorCode *status) |
Returns the resource in a given resource at the specified index. More... | |
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. More... | |
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. More... | |
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. More... | |
U_NAMESPACE_BEGIN UnicodeString | ures_getUnicodeString (const UResourceBundle *resB, UErrorCode *status) |
returns a string from a string resource type. More... | |
UnicodeString | ures_getNextUnicodeString (UResourceBundle *resB, const char **key, UErrorCode *status) |
Returns the next string in a resource or NULL if there are no more resources to iterate over. More... | |
UnicodeString | ures_getUnicodeStringByIndex (const UResourceBundle *resB, int32_t indexS, UErrorCode *status) |
Returns the string in a given resource at the specified index. More... | |
UnicodeString | ures_getUnicodeStringByKey (const UResourceBundle *resB, const char *key, UErrorCode *status) |
Returns a string in a resource that has a given key. More... |
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.
|
|
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.
Referenced by ures_getNextUnicodeString().
|
|
Returns the next string in a 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.
Referenced by ures_getUnicodeString().
|
|
Returns the string in a given resource at the specified index.
Referenced by ures_getUnicodeStringByIndex().
|
|
Returns a string in a given resource that has a given key. This procedure works only with table resources.
Referenced by ures_getUnicodeStringByKey().
|
|
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.
|
|
returns a string from a string resource type.
|
|
Returns the string in a given resource at the specified index.
|
|
Returns a string in a resource that has a given key. This procedure works only with table resources.
|
|
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)
|
|
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.
|