diff options
author | Ujjwal Sharma <usharma1998@gmail.com> | 2019-04-23 15:35:49 +0530 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-04-25 21:37:14 +0200 |
commit | c9b298c5eed7abec0aff02d1f67e18e5ea938fc9 (patch) | |
tree | d523c26552e0c06e0c7e17434d2b68bed2b6e9e8 /deps/icu-small/source/common/uresimp.h | |
parent | 6bbb9ebf8d8da927fc71f648af4739f2d574014f (diff) | |
download | android-node-v8-c9b298c5eed7abec0aff02d1f67e18e5ea938fc9.tar.gz android-node-v8-c9b298c5eed7abec0aff02d1f67e18e5ea938fc9.tar.bz2 android-node-v8-c9b298c5eed7abec0aff02d1f67e18e5ea938fc9.zip |
deps: update ICU to 64.2
Update the version of the bundled ICU (deps/icu-small) to ICU version
64.2 (Unicode 12, CLDR 35)
Fixes: https://github.com/nodejs/node/issues/26388
PR-URL: https://github.com/nodejs/node/pull/27361
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/icu-small/source/common/uresimp.h')
-rw-r--r-- | deps/icu-small/source/common/uresimp.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/deps/icu-small/source/common/uresimp.h b/deps/icu-small/source/common/uresimp.h index e4f75c9f11..16144012a5 100644 --- a/deps/icu-small/source/common/uresimp.h +++ b/deps/icu-small/source/common/uresimp.h @@ -11,6 +11,7 @@ #define URESIMP_H #include "unicode/ures.h" +#include "unicode/utypes.h" #include "uresdata.h" @@ -82,6 +83,60 @@ struct UResourceBundle { U_CAPI void U_EXPORT2 ures_initStackObject(UResourceBundle* resB); +#ifdef __cplusplus + +U_NAMESPACE_BEGIN + +/** + * \class StackUResourceBundle + * "Smart pointer" like class, closes a UResourceBundle via ures_close(). + * + * This code: + * + * StackUResourceBundle bundle; + * foo(bundle.getAlias()); + * + * Is equivalent to this code: + * + * UResourceBundle bundle; + * ures_initStackObject(&bundle); + * foo(&bundle); + * ures_close(&bundle); + * + * @see LocalUResourceBundlePointer + * @internal + */ +class U_COMMON_API StackUResourceBundle { +public: + // No heap allocation. Use only on the stack. + static void* U_EXPORT2 operator new(size_t) U_NOEXCEPT = delete; + static void* U_EXPORT2 operator new[](size_t) U_NOEXCEPT = delete; +#if U_HAVE_PLACEMENT_NEW + static void* U_EXPORT2 operator new(size_t, void*) U_NOEXCEPT = delete; +#endif + + StackUResourceBundle(); + ~StackUResourceBundle(); + + UResourceBundle* getAlias() { return &bundle; } + + UResourceBundle& ref() { return bundle; } + const UResourceBundle& ref() const { return bundle; } + + StackUResourceBundle(const StackUResourceBundle&) = delete; + StackUResourceBundle& operator=(const StackUResourceBundle&) = delete; + + StackUResourceBundle(StackUResourceBundle&&) = delete; + StackUResourceBundle& operator=(StackUResourceBundle&&) = delete; + +private: + UResourceBundle bundle; +}; + +U_NAMESPACE_END + +#endif /* __cplusplus */ + /** * Opens a resource bundle for the locale; * if there is not even a base language bundle, then loads the root bundle; @@ -275,4 +330,27 @@ U_CAPI const char* U_EXPORT2 ures_getLocaleInternal(const UResourceBundle* resourceBundle, UErrorCode* status); +/** + * Same as ures_openDirect() but uses the fill-in parameter instead of allocating a new bundle. + * + * @param r The existing UResourceBundle to fill in. If NULL then status will be + * set to U_ILLEGAL_ARGUMENT_ERROR. + * @param packageName The packageName and locale together point to an ICU udata object, + * as defined by <code> udata_open( packageName, "res", locale, err) </code> + * or equivalent. Typically, packageName will refer to a (.dat) file, or to + * a package registered with udata_setAppData(). Using a full file or directory + * pathname for packageName is deprecated. If NULL, ICU data will be used. + * @param locale specifies the locale for which we want to open the resource + * if NULL, the default locale will be used. If strlen(locale) == 0 + * root locale will be used. + * @param status The error code. + * @see ures_openDirect + * @internal + */ +U_CAPI void U_EXPORT2 +ures_openDirectFillIn(UResourceBundle *r, + const char *packageName, + const char *locale, + UErrorCode *status); + #endif /*URESIMP_H*/ |