ICU-4084 Sync the C and C++ API, and move internal function to internal headers.

X-SVN-Rev: 16221
This commit is contained in:
George Rhoten 2004-08-31 17:49:04 +00:00
parent 70c60ebe4e
commit ca8716d1e9
4 changed files with 63 additions and 45 deletions

View File

@ -11,6 +11,7 @@
#if !UCONFIG_NO_SERVICE
#include "unicode/resbund.h"
#include "uresimp.h"
#include "cmemory.h"
#include "iculserv.h"
#include "ustrfmt.h"

View File

@ -680,48 +680,27 @@ U_NAMESPACE_END
/**
* Create a string enumerator, owned by the caller, of all locales located within
* the specified resource tree.
* @param path path to the tree, such as (NULL) or U_ICUDATA or U_ICUDATA_COLL. If NULL,
* this call is similar to uloc_getAvailable().
* @param status error code
* 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.
* @param resB a resource
* @param inKey a key associated with the requested resource
* @param fillIn if NULL a new UResourceBundle struct is allocated and must be deleted by the caller.
* Alternatively, you can supply a struct to be filled by this function.
* @param status: fills in the outgoing error code
* could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
* could be a non-failing error
* e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
* @return a pointer to a UResourceBundle struct. If fill in param was NULL, caller must delete it
* @internal ICU 3.0
*/
U_INTERNAL UEnumeration* U_EXPORT2
ures_openAvailableLocales(const char *path, UErrorCode *status);
/**
* Returns a functionally equivalent locale (considering keywords) for the specified keyword.
* @param result fillin for the equivalent locale
* @param resultCapacity capacity of the fillin buffer
* @param path path to the tree, or NULL for ICU data
* @param resName top level resource. Example: "collations"
* @param keyword locale keyword. Example: "collation"
* @param locid The requested locale
* @param isAvailable If non-null, pointer to fillin parameter that indicates whether the
* requested locale was available. The locale is defined as 'available' if it physically
* exists within the specified tree.
* @param omitDefault if TRUE, omit keyword and value if default. 'de_DE\@collation=standard' -> 'de_DE'
* @param status error code
* @return the actual buffer size needed for the full locale. If it's greater
* than resultCapacity, the returned full name will be truncated and an error code will be returned.
* @internal ICU 3.0
*/
U_INTERNAL int32_t U_EXPORT2
ures_getFunctionalEquivalent(char *result, int32_t resultCapacity,
const char *path, const char *resName, const char *keyword, const char *locid,
UBool *isAvailable, UBool omitDefault, UErrorCode *status);
/**
* Given a tree path and keyword, return a string enumeration of all possible values for that keyword.
* @param path path to the tree, or NULL for ICU data
* @param keyword a particular keyword to consider, must match a top level resource name
* within the tree.
* @param status error code
* @internal ICU 3.0
*/
U_INTERNAL UEnumeration* U_EXPORT2
ures_getKeywordValues(const char *path, const char *keyword, UErrorCode *status);
U_INTERNAL UResourceBundle* U_EXPORT2
ures_getByKeyWithFallback(const UResourceBundle *resB,
const char* inKey,
UResourceBundle *fillIn,
UErrorCode *status);
#endif /*_URES*/
/*eof*/

View File

@ -133,11 +133,48 @@ ures_findSubResource(const UResourceBundle *resB,
char* pathToResource,
UResourceBundle *fillIn, UErrorCode *status);
U_CAPI UResourceBundle* U_EXPORT2
ures_getByKeyWithFallback(const UResourceBundle *resB,
const char* inKey,
UResourceBundle *fillIn,
UErrorCode *status);
/**
* Create a string enumerator, owned by the caller, of all locales located within
* the specified resource tree.
* @param path path to the tree, such as (NULL) or U_ICUDATA or U_ICUDATA_COLL. If NULL,
* this call is similar to uloc_getAvailable().
* @param status error code
* @internal ICU 3.0
*/
U_INTERNAL UEnumeration* U_EXPORT2
ures_openAvailableLocales(const char *path, UErrorCode *status);
/**
* Returns a functionally equivalent locale (considering keywords) for the specified keyword.
* @param result fillin for the equivalent locale
* @param resultCapacity capacity of the fillin buffer
* @param path path to the tree, or NULL for ICU data
* @param resName top level resource. Example: "collations"
* @param keyword locale keyword. Example: "collation"
* @param locid The requested locale
* @param isAvailable If non-null, pointer to fillin parameter that indicates whether the
* requested locale was available. The locale is defined as 'available' if it physically
* exists within the specified tree.
* @param omitDefault if TRUE, omit keyword and value if default. 'de_DE\@collation=standard' -> 'de_DE'
* @param status error code
* @return the actual buffer size needed for the full locale. If it's greater
* than resultCapacity, the returned full name will be truncated and an error code will be returned.
* @internal ICU 3.0
*/
U_INTERNAL int32_t U_EXPORT2
ures_getFunctionalEquivalent(char *result, int32_t resultCapacity,
const char *path, const char *resName, const char *keyword, const char *locid,
UBool *isAvailable, UBool omitDefault, UErrorCode *status);
/**
* Given a tree path and keyword, return a string enumeration of all possible values for that keyword.
* @param path path to the tree, or NULL for ICU data
* @param keyword a particular keyword to consider, must match a top level resource name
* within the tree.
* @param status error code
* @internal ICU 3.0
*/
U_INTERNAL UEnumeration* U_EXPORT2
ures_getKeywordValues(const char *path, const char *keyword, UErrorCode *status);
#endif /*URESIMP_H*/

View File

@ -42,6 +42,7 @@
#include "ucln_in.h"
#include "cstring.h"
#include "locbased.h"
#include "uresimp.h"
U_NAMESPACE_BEGIN