diff options
author | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-09 20:07:20 +0300 |
---|---|---|
committer | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-09 20:59:13 +0300 |
commit | fd82fb12fb45e71a02c628e45b12c50c0dd0d308 (patch) | |
tree | f582b79f9002ab1d083e9acda600dfb3551c47b6 /contrib/libs/icu/include/unicode/ures.h | |
parent | bf862ddf5c6178e1bb5e4fb3f7c61015deebe284 (diff) | |
download | ydb-fd82fb12fb45e71a02c628e45b12c50c0dd0d308.tar.gz |
Update ICU to 70.1
Diffstat (limited to 'contrib/libs/icu/include/unicode/ures.h')
-rw-r--r-- | contrib/libs/icu/include/unicode/ures.h | 95 |
1 files changed, 49 insertions, 46 deletions
diff --git a/contrib/libs/icu/include/unicode/ures.h b/contrib/libs/icu/include/unicode/ures.h index 839779fada..a6c43f9537 100644 --- a/contrib/libs/icu/include/unicode/ures.h +++ b/contrib/libs/icu/include/unicode/ures.h @@ -27,7 +27,10 @@ #include "unicode/utypes.h" #include "unicode/uloc.h" + +#if U_SHOW_CPLUSPLUS_API #include "unicode/localpointer.h" +#endif // U_SHOW_CPLUSPLUS_API /** * \file @@ -41,9 +44,9 @@ * locale and then ask it for individual resources. * <P> * Resource bundles in ICU4C are currently defined using text files which conform to the following - * <a href="http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt">BNF definition</a>. + * <a href="https://github.com/unicode-org/icu-docs/blob/main/design/bnf_rb.txt">BNF definition</a>. * More on resource bundle concepts and syntax can be found in the - * <a href="http://icu-project.org/userguide/ResourceManagement.html">Users Guide</a>. + * <a href="https://unicode-org.github.io/icu/userguide/locale/resources">Users Guide</a>. * <P> */ @@ -163,7 +166,7 @@ typedef enum { * @see ures_close * @stable ICU 2.0 */ -U_STABLE UResourceBundle* U_EXPORT2 +U_CAPI UResourceBundle* U_EXPORT2 ures_open(const char* packageName, const char* locale, UErrorCode* status); @@ -186,7 +189,7 @@ ures_open(const char* packageName, * @see ures_close * @stable ICU 2.0 */ -U_STABLE UResourceBundle* U_EXPORT2 +U_CAPI UResourceBundle* U_EXPORT2 ures_openDirect(const char* packageName, const char* locale, UErrorCode* status); @@ -209,7 +212,7 @@ ures_openDirect(const char* packageName, * @see ures_open * @stable ICU 2.0 */ -U_STABLE UResourceBundle* U_EXPORT2 +U_CAPI UResourceBundle* U_EXPORT2 ures_openU(const UChar* packageName, const char* locale, UErrorCode* status); @@ -245,7 +248,7 @@ ures_countArrayItems(const UResourceBundle* resourceBundle, * @see ures_open * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 ures_close(UResourceBundle* resourceBundle); #if U_SHOW_CPLUSPLUS_API @@ -291,7 +294,7 @@ ures_getVersionNumber(const UResourceBundle* resourceBundle); * as specified in the resource bundle or its parent. * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 ures_getVersion(const UResourceBundle* resB, UVersionInfo versionInfo); @@ -325,7 +328,7 @@ ures_getLocale(const UResourceBundle* resourceBundle, * @return A Locale name * @stable ICU 2.8 */ -U_STABLE const char* U_EXPORT2 +U_CAPI const char* U_EXPORT2 ures_getLocaleByType(const UResourceBundle* resourceBundle, ULocDataLocaleType type, UErrorCode* status); @@ -348,7 +351,7 @@ ures_getLocaleByType(const UResourceBundle* resourceBundle, * @param status The error code. * @internal */ -U_INTERNAL void U_EXPORT2 +U_CAPI void U_EXPORT2 ures_openFillIn(UResourceBundle *r, const char* packageName, const char* localeID, @@ -372,7 +375,7 @@ ures_openFillIn(UResourceBundle *r, * @see ures_getUInt * @stable ICU 2.0 */ -U_STABLE const UChar* U_EXPORT2 +U_CAPI const UChar* U_EXPORT2 ures_getString(const UResourceBundle* resourceBundle, int32_t* len, UErrorCode* status); @@ -383,10 +386,10 @@ ures_getString(const UResourceBundle* resourceBundle, * it may need to be copied, or transformed from UTF-16 using u_strToUTF8() * or equivalent. * - * If forceCopy==TRUE, then the string is always written to the dest buffer + * If forceCopy==true, then the string is always written to the dest buffer * and dest is returned. * - * If forceCopy==FALSE, then the string is returned as a pointer if possible, + * If forceCopy==false, then the string is returned as a pointer if possible, * without needing a dest buffer (it can be NULL). If the string needs to be * copied or transformed, then it may be placed into dest at an arbitrary offset. * @@ -404,10 +407,10 @@ ures_getString(const UResourceBundle* resourceBundle, * terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR. * Can be NULL, meaning capacity=0 and the string length is not * returned to the caller. - * @param forceCopy If TRUE, then the output string will always be written to + * @param forceCopy If true, then the output string will always be written to * dest, with U_BUFFER_OVERFLOW_ERROR and * U_STRING_NOT_TERMINATED_WARNING set if appropriate. - * If FALSE, then the dest buffer may or may not contain a + * If false, then the dest buffer may or may not contain a * copy of the string. dest may or may not be modified. * If a copy needs to be written, then the UErrorCode parameter * indicates overflow etc. as usual. @@ -424,7 +427,7 @@ ures_getString(const UResourceBundle* resourceBundle, * @see u_strToUTF8 * @stable ICU 3.6 */ -U_STABLE const char * U_EXPORT2 +U_CAPI const char * U_EXPORT2 ures_getUTF8String(const UResourceBundle *resB, char *dest, int32_t *length, UBool forceCopy, @@ -447,7 +450,7 @@ ures_getUTF8String(const UResourceBundle *resB, * @see ures_getUInt * @stable ICU 2.0 */ -U_STABLE const uint8_t* U_EXPORT2 +U_CAPI const uint8_t* U_EXPORT2 ures_getBinary(const UResourceBundle* resourceBundle, int32_t* len, UErrorCode* status); @@ -469,7 +472,7 @@ ures_getBinary(const UResourceBundle* resourceBundle, * @see ures_getUInt * @stable ICU 2.0 */ -U_STABLE const int32_t* U_EXPORT2 +U_CAPI const int32_t* U_EXPORT2 ures_getIntVector(const UResourceBundle* resourceBundle, int32_t* len, UErrorCode* status); @@ -490,7 +493,7 @@ ures_getIntVector(const UResourceBundle* resourceBundle, * @see ures_getString * @stable ICU 2.0 */ -U_STABLE uint32_t U_EXPORT2 +U_CAPI uint32_t U_EXPORT2 ures_getUInt(const UResourceBundle* resourceBundle, UErrorCode *status); @@ -510,7 +513,7 @@ ures_getUInt(const UResourceBundle* resourceBundle, * @see ures_getString * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ures_getInt(const UResourceBundle* resourceBundle, UErrorCode *status); @@ -524,7 +527,7 @@ ures_getInt(const UResourceBundle* resourceBundle, * @return number of resources in a given resource. * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ures_getSize(const UResourceBundle *resourceBundle); /** @@ -535,7 +538,7 @@ ures_getSize(const UResourceBundle *resourceBundle); * @see UResType * @stable ICU 2.0 */ -U_STABLE UResType U_EXPORT2 +U_CAPI UResType U_EXPORT2 ures_getType(const UResourceBundle *resourceBundle); /** @@ -546,7 +549,7 @@ ures_getType(const UResourceBundle *resourceBundle); * @return a key associated to this resource, or NULL if it doesn't have a key * @stable ICU 2.0 */ -U_STABLE const char * U_EXPORT2 +U_CAPI const char * U_EXPORT2 ures_getKey(const UResourceBundle *resourceBundle); /* ITERATION API @@ -559,17 +562,17 @@ ures_getKey(const UResourceBundle *resourceBundle); * @param resourceBundle a resource * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 ures_resetIterator(UResourceBundle *resourceBundle); /** * Checks whether the given resource has another element to iterate over. * * @param resourceBundle a resource - * @return TRUE if there are more elements, FALSE if there is no more elements + * @return true if there are more elements, false if there is no more elements * @stable ICU 2.0 */ -U_STABLE UBool U_EXPORT2 +U_CAPI UBool U_EXPORT2 ures_hasNext(const UResourceBundle *resourceBundle); /** @@ -584,7 +587,7 @@ ures_hasNext(const UResourceBundle *resourceBundle); * @return a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it * @stable ICU 2.0 */ -U_STABLE UResourceBundle* U_EXPORT2 +U_CAPI UResourceBundle* U_EXPORT2 ures_getNextResource(UResourceBundle *resourceBundle, UResourceBundle *fillIn, UErrorCode *status); @@ -601,7 +604,7 @@ ures_getNextResource(UResourceBundle *resourceBundle, * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file. * @stable ICU 2.0 */ -U_STABLE const UChar* U_EXPORT2 +U_CAPI const UChar* U_EXPORT2 ures_getNextString(UResourceBundle *resourceBundle, int32_t* len, const char ** key, @@ -619,7 +622,7 @@ ures_getNextString(UResourceBundle *resourceBundle, * @return a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it * @stable ICU 2.0 */ -U_STABLE UResourceBundle* U_EXPORT2 +U_CAPI UResourceBundle* U_EXPORT2 ures_getByIndex(const UResourceBundle *resourceBundle, int32_t indexR, UResourceBundle *fillIn, @@ -636,7 +639,7 @@ ures_getByIndex(const UResourceBundle *resourceBundle, * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file. * @stable ICU 2.0 */ -U_STABLE const UChar* U_EXPORT2 +U_CAPI const UChar* U_EXPORT2 ures_getStringByIndex(const UResourceBundle *resourceBundle, int32_t indexS, int32_t* len, @@ -648,10 +651,10 @@ ures_getStringByIndex(const UResourceBundle *resourceBundle, * it may need to be copied, or transformed from UTF-16 using u_strToUTF8() * or equivalent. * - * If forceCopy==TRUE, then the string is always written to the dest buffer + * If forceCopy==true, then the string is always written to the dest buffer * and dest is returned. * - * If forceCopy==FALSE, then the string is returned as a pointer if possible, + * If forceCopy==false, then the string is returned as a pointer if possible, * without needing a dest buffer (it can be NULL). If the string needs to be * copied or transformed, then it may be placed into dest at an arbitrary offset. * @@ -670,10 +673,10 @@ ures_getStringByIndex(const UResourceBundle *resourceBundle, * terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR. * Can be NULL, meaning capacity=0 and the string length is not * returned to the caller. - * @param forceCopy If TRUE, then the output string will always be written to + * @param forceCopy If true, then the output string will always be written to * dest, with U_BUFFER_OVERFLOW_ERROR and * U_STRING_NOT_TERMINATED_WARNING set if appropriate. - * If FALSE, then the dest buffer may or may not contain a + * If false, then the dest buffer may or may not contain a * copy of the string. dest may or may not be modified. * If a copy needs to be written, then the UErrorCode parameter * indicates overflow etc. as usual. @@ -690,7 +693,7 @@ ures_getStringByIndex(const UResourceBundle *resourceBundle, * @see u_strToUTF8 * @stable ICU 3.6 */ -U_STABLE const char * U_EXPORT2 +U_CAPI const char * U_EXPORT2 ures_getUTF8StringByIndex(const UResourceBundle *resB, int32_t stringIndex, char *dest, int32_t *pLength, @@ -709,7 +712,7 @@ ures_getUTF8StringByIndex(const UResourceBundle *resB, * @return a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it * @stable ICU 2.0 */ -U_STABLE UResourceBundle* U_EXPORT2 +U_CAPI UResourceBundle* U_EXPORT2 ures_getByKey(const UResourceBundle *resourceBundle, const char* key, UResourceBundle *fillIn, @@ -727,7 +730,7 @@ ures_getByKey(const UResourceBundle *resourceBundle, * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file. * @stable ICU 2.0 */ -U_STABLE const UChar* U_EXPORT2 +U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, const char* key, int32_t* len, @@ -741,10 +744,10 @@ ures_getStringByKey(const UResourceBundle *resB, * it may need to be copied, or transformed from UTF-16 using u_strToUTF8() * or equivalent. * - * If forceCopy==TRUE, then the string is always written to the dest buffer + * If forceCopy==true, then the string is always written to the dest buffer * and dest is returned. * - * If forceCopy==FALSE, then the string is returned as a pointer if possible, + * If forceCopy==false, then the string is returned as a pointer if possible, * without needing a dest buffer (it can be NULL). If the string needs to be * copied or transformed, then it may be placed into dest at an arbitrary offset. * @@ -763,10 +766,10 @@ ures_getStringByKey(const UResourceBundle *resB, * terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR. * Can be NULL, meaning capacity=0 and the string length is not * returned to the caller. - * @param forceCopy If TRUE, then the output string will always be written to + * @param forceCopy If true, then the output string will always be written to * dest, with U_BUFFER_OVERFLOW_ERROR and * U_STRING_NOT_TERMINATED_WARNING set if appropriate. - * If FALSE, then the dest buffer may or may not contain a + * If false, then the dest buffer may or may not contain a * copy of the string. dest may or may not be modified. * If a copy needs to be written, then the UErrorCode parameter * indicates overflow etc. as usual. @@ -783,7 +786,7 @@ ures_getStringByKey(const UResourceBundle *resB, * @see u_strToUTF8 * @stable ICU 3.6 */ -U_STABLE const char * U_EXPORT2 +U_CAPI const char * U_EXPORT2 ures_getUTF8StringByKey(const UResourceBundle *resB, const char *key, char *dest, int32_t *pLength, @@ -811,7 +814,7 @@ ures_getUnicodeString(const UResourceBundle *resB, UErrorCode* status) { int32_t len = 0; const UChar *r = ures_getString(resB, &len, status); if(U_SUCCESS(*status)) { - result.setTo(TRUE, r, len); + result.setTo(true, r, len); } else { result.setToBogus(); } @@ -836,7 +839,7 @@ ures_getNextUnicodeString(UResourceBundle *resB, const char ** key, UErrorCode* int32_t len = 0; const UChar* r = ures_getNextString(resB, &len, key, status); if(U_SUCCESS(*status)) { - result.setTo(TRUE, r, len); + result.setTo(true, r, len); } else { result.setToBogus(); } @@ -858,7 +861,7 @@ ures_getUnicodeStringByIndex(const UResourceBundle *resB, int32_t indexS, UError int32_t len = 0; const UChar* r = ures_getStringByIndex(resB, indexS, &len, status); if(U_SUCCESS(*status)) { - result.setTo(TRUE, r, len); + result.setTo(true, r, len); } else { result.setToBogus(); } @@ -881,7 +884,7 @@ ures_getUnicodeStringByKey(const UResourceBundle *resB, const char* key, UErrorC int32_t len = 0; const UChar* r = ures_getStringByKey(resB, key, &len, status); if(U_SUCCESS(*status)) { - result.setTo(TRUE, r, len); + result.setTo(true, r, len); } else { result.setToBogus(); } @@ -900,7 +903,7 @@ U_NAMESPACE_END * @param status error code * @stable ICU 3.2 */ -U_STABLE UEnumeration* U_EXPORT2 +U_CAPI UEnumeration* U_EXPORT2 ures_openAvailableLocales(const char *packageName, UErrorCode *status); |