diff --git a/packages/php-wasm/compile/Makefile b/packages/php-wasm/compile/Makefile index bad1ddd21a..97b114afe9 100644 --- a/packages/php-wasm/compile/Makefile +++ b/packages/php-wasm/compile/Makefile @@ -235,9 +235,26 @@ libcurl/jspi/dist/root/lib/lib/libcurl.a: base-image libz libopenssl docker cp $$(docker create playground-php-wasm:libcurl):/root/curl-7.69.1/lib/.libs ./libcurl/jspi/dist/root/lib/lib docker cp $$(docker create playground-php-wasm:libcurl):/root/curl-7.69.1/include/ ./libcurl/jspi/dist/root/lib +libintl_asyncify: libintl/asyncify/dist/root/lib/lib/libintl.a +libintl/asyncify/dist/root/lib/lib/libintl.a: base-image + mkdir -p ./libintl/asyncify/dist/root/lib + docker build -f ./libintl/Dockerfile -t playground-php-wasm:libintl . --progress=plain + docker cp $$(docker create playground-php-wasm:libintl):/root/lib/lib ./libintl/asyncify/dist/root/lib + docker cp $$(docker create playground-php-wasm:libintl):/root/lib/include ./libintl/asyncify/dist/root/lib + docker cp $$(docker create playground-php-wasm:libintl):/root/lib/data/. ./libintl/ + + +libintl_jspi: libintl/jspi/dist/root/lib/lib/libintl.a +libintl/jspi/dist/root/lib/lib/libintl.a: base-image + mkdir -p ./libintl/jspi/dist/root/lib + docker build -f ./libintl/Dockerfile -t playground-php-wasm:libintl . --progress=plain --build-arg JSPI=1 + docker cp $$(docker create playground-php-wasm:libintl):/root/lib/lib ./libintl/jspi/dist/root/lib + docker cp $$(docker create playground-php-wasm:libintl):/root/lib/include ./libintl/jspi/dist/root/lib + docker cp $$(docker create playground-php-wasm:libintl):/root/lib/data/. ./libintl/ + all: all_jspi all_asyncify -all_jspi: libz_jspi libzip_jspi libpng16_jspi libjpeg_jspi libwebp_jspi libxml2_jspi libopenssl_jspi libsqlite3_jspi libiconv_jspi bison2.7 oniguruma_jspi libcurl_jspi -all_asyncify: libz_asyncify libzip_asyncify libpng16_asyncify libjpeg_asyncify libwebp_asyncify libxml2_asyncify libopenssl_asyncify libsqlite3_asyncify libiconv_asyncify bison2.7 oniguruma_asyncify libcurl_asyncify +all_jspi: libz_jspi libzip_jspi libpng16_jspi libjpeg_jspi libwebp_jspi libxml2_jspi libopenssl_jspi libsqlite3_jspi libiconv_jspi bison2.7 oniguruma_jspi libcurl_jspi libintl_jspi +all_asyncify: libz_asyncify libzip_asyncify libpng16_asyncify libjpeg_asyncify libwebp_asyncify libxml2_asyncify libopenssl_asyncify libsqlite3_asyncify libiconv_asyncify bison2.7 oniguruma_asyncify libcurl_asyncify libintl_asyncify clean: rm -rf ./libz/jspi/dist @@ -261,3 +278,5 @@ clean: rm -rf ./bison2.7/dist rm -rf ./oniguruma/jspi/dist rm -rf ./oniguruma/asyncify/dist + rm -rf ./libintl/jspi/dist + rm -rf ./libintl/asyncify/dist diff --git a/packages/php-wasm/compile/build.js b/packages/php-wasm/compile/build.js index 6ec2509145..93fe9d89c6 100644 --- a/packages/php-wasm/compile/build.js +++ b/packages/php-wasm/compile/build.js @@ -61,6 +61,11 @@ const argParser = yargs(process.argv.slice(2)) choices: ['yes', 'no'], description: 'Build with mbregex support', }, + WITH_INTL: { + type: 'string', + choices: ['yes', 'no'], + description: 'Build with intl support', + }, WITH_CLI_SAPI: { type: 'string', choices: ['yes', 'no'], @@ -139,6 +144,7 @@ const platformDefaults = { WITH_GD: 'yes', WITH_MBSTRING: 'yes', WITH_MBREGEX: 'yes', + WITH_INTL: 'yes', WITH_OPENSSL: 'yes', WITH_WS_NETWORKING_PROXY: 'yes', }, @@ -205,6 +211,8 @@ await asyncSpawn( '--build-arg', getArg('WITH_MBREGEX'), '--build-arg', + getArg('WITH_INTL'), + '--build-arg', getArg('WITH_CLI_SAPI'), '--build-arg', getArg('WITH_OPENSSL'), @@ -256,6 +264,20 @@ await asyncSpawn( { cwd: sourceDir, stdio: 'inherit' } ); +// Copy data files +const libDir = path.resolve(process.cwd(), 'packages/php-wasm/compile'); +const publicDir = + platform === 'node' + ? `${path.dirname(outputDir)}` + : `${path.dirname(path.dirname(outputDir))}`; +if (getArg('WITH_INTL').endsWith('yes')) { + await asyncSpawn( + 'cp', + [`${libDir}/libintl/icudt74l.dat`, `${publicDir}/shared/icudt74l.dat`], + { cwd: sourceDir, stdio: 'inherit' } + ); +} + const _args = args; function asyncSpawn(...args) { diff --git a/packages/php-wasm/compile/libintl/Dockerfile b/packages/php-wasm/compile/libintl/Dockerfile new file mode 100644 index 0000000000..75cadc3e37 --- /dev/null +++ b/packages/php-wasm/compile/libintl/Dockerfile @@ -0,0 +1,50 @@ +FROM playground-php-wasm:base + + +ARG JSPI + + +RUN set -euxo pipefail && \ + wget https://github.com/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-src.tgz && \ + tar -xvf icu4c-74_2-src.tgz && \ + rm -rf /root/icu/source/data/ && \ + rm icu4c-74_2-src.tgz + + +RUN set -euxo pipefail && \ + wget https://github.com/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-data.zip && \ + unzip icu4c-74_2-data.zip -d /root/icu/source && \ + rm icu4c-74_2-data.zip + + +RUN set -euxo pipefail && \ + mkdir -p /root/native && \ + cd /root/native && \ + /root/icu/source/runConfigureICU Linux \ + --disable-shared \ + --enable-static && \ + make -j"$(nproc)" && \ + make install + + +RUN set -euxo pipefail && \ + cd /root/icu/source && \ + mkdir -p /root/lib && \ + source /root/emsdk/emsdk_env.sh && \ + emconfigure ./configure \ + --build=i386-pc-linux-gnu \ + --target=wasm32-unknown-emscripten \ + --prefix=/root/lib \ + --with-cross-build=/root/native \ + --with-data-packaging=archive \ + --disable-extras \ + --disable-shared \ + --enable-static && \ + export JSPI_FLAGS=$(if [ "$JSPI" = "1" ]; then echo "-sSUPPORT_LONGJMP=wasm -fwasm-exceptions"; else echo ""; fi) && \ + EMCC_FLAGS=" -sSIDE_MODULE -Wl,--wrap=select $JSPI_FLAGS " emmake make -j"$(nproc)" && \ + EMCC_FLAGS=" -sSIDE_MODULE -Wl,--wrap=select $JSPI_FLAGS " emmake make install -i; + + +RUN set -euxo pipefail && \ + mkdir -p /root/lib/data && \ + mv /root/lib/share/icu/74.2/icudt74l.dat /root/lib/data diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/alphaindex.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/alphaindex.h new file mode 100644 index 0000000000..cbce212717 --- /dev/null +++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/alphaindex.h @@ -0,0 +1,766 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************* +* +* Copyright (C) 2011-2014 International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +*/ + +#ifndef INDEXCHARS_H +#define INDEXCHARS_H + +#include "unicode/utypes.h" + +#if U_SHOW_CPLUSPLUS_API + +#include "unicode/uobject.h" +#include "unicode/locid.h" +#include "unicode/unistr.h" + +#if !UCONFIG_NO_COLLATION + +/** + * \file + * \brief C++ API: Index Characters + */ + +U_CDECL_BEGIN + +/** + * Constants for Alphabetic Index Label Types. + * The form of these enum constants anticipates having a plain C API + * for Alphabetic Indexes that will also use them. + * @stable ICU 4.8 + */ +typedef enum UAlphabeticIndexLabelType { + /** + * Normal Label, typically the starting letter of the names + * in the bucket with this label. + * @stable ICU 4.8 + */ + U_ALPHAINDEX_NORMAL = 0, + + /** + * Underflow Label. The bucket with this label contains names + * in scripts that sort before any of the bucket labels in this index. + * @stable ICU 4.8 + */ + U_ALPHAINDEX_UNDERFLOW = 1, + + /** + * Inflow Label. The bucket with this label contains names + * in scripts that sort between two of the bucket labels in this index. + * Inflow labels are created when an index contains normal labels for + * multiple scripts, and skips other scripts that sort between some of the + * included scripts. + * @stable ICU 4.8 + */ + U_ALPHAINDEX_INFLOW = 2, + + /** + * Overflow Label. The bucket with this label contains names in scripts + * that sort after all of the bucket labels in this index. + * @stable ICU 4.8 + */ + U_ALPHAINDEX_OVERFLOW = 3 +} UAlphabeticIndexLabelType; + + +struct UHashtable; +U_CDECL_END + +U_NAMESPACE_BEGIN + +// Forward Declarations + +class BucketList; +class Collator; +class RuleBasedCollator; +class StringEnumeration; +class UnicodeSet; +class UVector; + +/** + * AlphabeticIndex supports the creation of a UI index appropriate for a given language. + * It can support either direct use, or use with a client that doesn't support localized collation. + * The following is an example of what an index might look like in a UI: + * + *
+ * ... A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ... + * + * A + * Addison + * Albertson + * Azensky + * B + * Baker + * ... + *+ * + * The class can generate a list of labels for use as a UI "index", that is, a list of + * clickable characters (or character sequences) that allow the user to see a segment + * (bucket) of a larger "target" list. That is, each label corresponds to a bucket in + * the target list, where everything in the bucket is greater than or equal to the character + * (according to the locale's collation). Strings can be added to the index; + * they will be in sorted order in the right bucket. + *
+ * The class also supports having buckets for strings before the first (underflow), + * after the last (overflow), and between scripts (inflow). For example, if the index + * is constructed with labels for Russian and English, Greek characters would fall + * into an inflow bucket between the other two scripts. + *
+ * The AlphabeticIndex class is not intended for public subclassing. + * + *
Note: If you expect to have a lot of ASCII or Latin characters + * as well as characters from the user's language, + * then it is a good idea to call addLabels(Locale::getEnglish(), status).
+ * + *The following shows an example of building an index directly. + * The "show..." methods below are just to illustrate usage. + * + *
+ * // Create a simple index. "Item" is assumed to be an application + * // defined type that the application's UI and other processing knows about, + * // and that has a name. + * + * UErrorCode status = U_ZERO_ERROR; + * AlphabeticIndex index = new AlphabeticIndex(desiredLocale, status); + * index->addLabels(additionalLocale, status); + * for (Item *item in some source of Items ) { + * index->addRecord(item->name(), item, status); + * } + * ... + * // Show index at top. We could skip or gray out empty buckets + * + * while (index->nextBucket(status)) { + * if (showAll || index->getBucketRecordCount() != 0) { + * showLabelAtTop(UI, index->getBucketLabel()); + * } + * } + * ... + * // Show the buckets with their contents, skipping empty buckets + * + * index->resetBucketIterator(status); + * while (index->nextBucket(status)) { + * if (index->getBucketRecordCount() != 0) { + * showLabelInList(UI, index->getBucketLabel()); + * while (index->nextRecord(status)) { + * showIndexedItem(UI, static_cast+ * + * The caller can build different UIs using this class. + * For example, an index character could be omitted or grayed-out + * if its bucket is empty. Small buckets could also be combined based on size, such as: + * + *- (index->getRecordData())) + *
+ * ... A-F G-N O-Z ... + *+ * + *
Callers can also use the AlphabeticIndex::ImmutableIndex, or the AlphabeticIndex itself, + * to support sorting on a client that doesn't support AlphabeticIndex functionality. + * + *
The ImmutableIndex is both immutable and thread-safe. + * The corresponding AlphabeticIndex methods are not thread-safe because + * they "lazily" build the index buckets. + *
+ * int32_t bucketIndex = index.getBucketIndex(name, status); + * const UnicodeString &label = immutableIndex.getBucket(bucketIndex)->getLabel(); // optional + * int32_t skLength = collator.getSortKey(name, sk, skCapacity); + *+ * + *
BasicTimeZone
is an abstract class extending TimeZone
.
+ * This class provides some additional methods to access time zone transitions and rules.
+ * All ICU TimeZone
concrete subclasses extend this class.
+ * @stable ICU 3.8
+ */
+class U_I18N_API BasicTimeZone: public TimeZone {
+public:
+ /**
+ * Destructor.
+ * @stable ICU 3.8
+ */
+ virtual ~BasicTimeZone();
+
+ /**
+ * Clones this object polymorphically.
+ * The caller owns the result and should delete it when done.
+ * @return clone, or nullptr if an error occurred
+ * @stable ICU 3.8
+ */
+ virtual BasicTimeZone* clone() const override = 0;
+
+ /**
+ * Gets the first time zone transition after the base time.
+ * @param base The base time.
+ * @param inclusive Whether the base time is inclusive or not.
+ * @param result Receives the first transition after the base time.
+ * @return true if the transition is found.
+ * @stable ICU 3.8
+ */
+ virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const = 0;
+
+ /**
+ * Gets the most recent time zone transition before the base time.
+ * @param base The base time.
+ * @param inclusive Whether the base time is inclusive or not.
+ * @param result Receives the most recent transition before the base time.
+ * @return true if the transition is found.
+ * @stable ICU 3.8
+ */
+ virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const = 0;
+
+ /**
+ * Checks if the time zone has equivalent transitions in the time range.
+ * This method returns true when all of transition times, from/to standard
+ * offsets and DST savings used by this time zone match the other in the
+ * time range.
+ * @param tz The BasicTimeZone
object to be compared with.
+ * @param start The start time of the evaluated time range (inclusive)
+ * @param end The end time of the evaluated time range (inclusive)
+ * @param ignoreDstAmount
+ * When true, any transitions with only daylight saving amount
+ * changes will be ignored, except either of them is zero.
+ * For example, a transition from rawoffset 3:00/dstsavings 1:00
+ * to rawoffset 2:00/dstsavings 2:00 is excluded from the comparison,
+ * but a transition from rawoffset 2:00/dstsavings 1:00 to
+ * rawoffset 3:00/dstsavings 0:00 is included.
+ * @param ec Output param to filled in with a success or an error.
+ * @return true if the other time zone has the equivalent transitions in the
+ * time range.
+ * @stable ICU 3.8
+ */
+ virtual UBool hasEquivalentTransitions(const BasicTimeZone& tz, UDate start, UDate end,
+ UBool ignoreDstAmount, UErrorCode& ec) const;
+
+ /**
+ * Returns the number of TimeZoneRule
s which represents time transitions,
+ * for this time zone, that is, all TimeZoneRule
s for this time zone except
+ * InitialTimeZoneRule
. The return value range is 0 or any positive value.
+ * @param status Receives error status code.
+ * @return The number of TimeZoneRule
s representing time transitions.
+ * @stable ICU 3.8
+ */
+ virtual int32_t countTransitionRules(UErrorCode& status) const = 0;
+
+ /**
+ * Gets the InitialTimeZoneRule
and the set of TimeZoneRule
+ * which represent time transitions for this time zone. On successful return,
+ * the argument initial points to non-nullptr InitialTimeZoneRule
and
+ * the array trsrules is filled with 0 or multiple TimeZoneRule
+ * instances up to the size specified by trscount. The results are referencing the
+ * rule instance held by this time zone instance. Therefore, after this time zone
+ * is destructed, they are no longer available.
+ * @param initial Receives the initial timezone rule
+ * @param trsrules Receives the timezone transition rules
+ * @param trscount On input, specify the size of the array 'transitions' receiving
+ * the timezone transition rules. On output, actual number of
+ * rules filled in the array will be set.
+ * @param status Receives error status code.
+ * @stable ICU 3.8
+ */
+ virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
+ const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const = 0;
+
+ /**
+ * Gets the set of time zone rules valid at the specified time. Some known external time zone
+ * implementations are not capable to handle historic time zone rule changes. Also some
+ * implementations can only handle certain type of rule definitions.
+ * If this time zone does not use any daylight saving time within about 1 year from the specified
+ * time, only the InitialTimeZone
is returned. Otherwise, the rule for standard
+ * time and daylight saving time transitions are returned in addition to the
+ * InitialTimeZoneRule
. The standard and daylight saving time transition rules are
+ * represented by AnnualTimeZoneRule
with DateTimeRule::DOW
for its date
+ * rule and DateTimeRule::WALL_TIME
for its time rule. Because daylight saving time
+ * rule is changing time to time in many time zones and also mapping a transition time rule to
+ * different type is lossy transformation, the set of rules returned by this method may be valid
+ * for short period of time.
+ * The time zone rule objects returned by this method is owned by the caller, so the caller is
+ * responsible for deleting them after use.
+ * @param date The date used for extracting time zone rules.
+ * @param initial Receives the InitialTimeZone
, always not nullptr.
+ * @param std Receives the AnnualTimeZoneRule
for standard time transitions.
+ * When this time time zone does not observe daylight saving times around the
+ * specified date, nullptr is set.
+ * @param dst Receives the AnnualTimeZoneRule
for daylight saving time
+ * transitions. When this time zone does not observer daylight saving times
+ * around the specified date, nullptr is set.
+ * @param status Receives error status code.
+ * @stable ICU 3.8
+ */
+ virtual void getSimpleRulesNear(UDate date, InitialTimeZoneRule*& initial,
+ AnnualTimeZoneRule*& std, AnnualTimeZoneRule*& dst, UErrorCode& status) const;
+
+ /**
+ * Get time zone offsets from local wall time.
+ * @stable ICU 69
+ */
+ virtual void getOffsetFromLocal(
+ UDate date, UTimeZoneLocalOption nonExistingTimeOpt,
+ UTimeZoneLocalOption duplicatedTimeOpt, int32_t& rawOffset,
+ int32_t& dstOffset, UErrorCode& status) const;
+
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * The time type option bit flags used by getOffsetFromLocal
+ * @internal
+ */
+ enum {
+ kStandard = 0x01,
+ kDaylight = 0x03,
+ kFormer = 0x04, /* UCAL_TZ_LOCAL_FORMER */
+ kLatter = 0x0C /* UCAL_TZ_LOCAL_LATTER */
+ };
+
+ /**
+ * Get time zone offsets from local wall time.
+ * @internal
+ */
+ void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt,
+ int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const;
+#endif /* U_HIDE_INTERNAL_API */
+
+protected:
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * A time type option bit mask used by getOffsetFromLocal.
+ * @internal
+ */
+ static constexpr int32_t kStdDstMask = kDaylight;
+ /**
+ * A time type option bit mask used by getOffsetFromLocal.
+ * @internal
+ */
+ static constexpr int32_t kFormerLatterMask = kLatter;
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Default constructor.
+ * @stable ICU 3.8
+ */
+ BasicTimeZone();
+
+ /**
+ * Construct a timezone with a given ID.
+ * @param id a system time zone ID
+ * @stable ICU 3.8
+ */
+ BasicTimeZone(const UnicodeString &id);
+
+ /**
+ * Copy constructor.
+ * @param source the object to be copied.
+ * @stable ICU 3.8
+ */
+ BasicTimeZone(const BasicTimeZone& source);
+
+ /**
+ * Copy assignment.
+ * @stable ICU 3.8
+ */
+ BasicTimeZone& operator=(const BasicTimeZone&) = default;
+
+ /**
+ * Gets the set of TimeZoneRule instances applicable to the specified time and after.
+ * @param start The start date used for extracting time zone rules
+ * @param initial Output parameter, receives the InitialTimeZone.
+ * Always not nullptr (except in case of error)
+ * @param transitionRules Output parameter, a UVector of transition rules.
+ * May be nullptr, if there are no transition rules.
+ * The caller owns the returned vector; the UVector owns the rules.
+ * @param status Receives error status code
+ */
+ void getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial, UVector*& transitionRules,
+ UErrorCode& status) const;
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // BASICTZ_H
+
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/brkiter.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/brkiter.h
new file mode 100644
index 0000000000..d953925bd7
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/brkiter.h
@@ -0,0 +1,672 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+********************************************************************************
+* Copyright (C) 1997-2016, International Business Machines
+* Corporation and others. All Rights Reserved.
+********************************************************************************
+*
+* File brkiter.h
+*
+* Modification History:
+*
+* Date Name Description
+* 02/18/97 aliu Added typedef for TextCount. Made DONE const.
+* 05/07/97 aliu Fixed DLL declaration.
+* 07/09/97 jfitz Renamed BreakIterator and interface synced with JDK
+* 08/11/98 helena Sync-up JDK1.2.
+* 01/13/2000 helena Added UErrorCode parameter to createXXXInstance methods.
+********************************************************************************
+*/
+
+#ifndef BRKITER_H
+#define BRKITER_H
+
+#include "unicode/utypes.h"
+
+/**
+ * \file
+ * \brief C++ API: Break Iterator.
+ */
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if UCONFIG_NO_BREAK_ITERATION
+
+U_NAMESPACE_BEGIN
+
+/*
+ * Allow the declaration of APIs with pointers to BreakIterator
+ * even when break iteration is removed from the build.
+ */
+class BreakIterator;
+
+U_NAMESPACE_END
+
+#else
+
+#include "unicode/uobject.h"
+#include "unicode/unistr.h"
+#include "unicode/chariter.h"
+#include "unicode/locid.h"
+#include "unicode/ubrk.h"
+#include "unicode/strenum.h"
+#include "unicode/utext.h"
+#include "unicode/umisc.h"
+
+U_NAMESPACE_BEGIN
+
+class CharString;
+
+/**
+ * The BreakIterator class implements methods for finding the location
+ * of boundaries in text. BreakIterator is an abstract base class.
+ * Instances of BreakIterator maintain a current position and scan over
+ * text returning the index of characters where boundaries occur.
+ * + * Line boundary analysis determines where a text string can be broken + * when line-wrapping. The mechanism correctly handles punctuation and + * hyphenated words. + *
+ * Sentence boundary analysis allows selection with correct + * interpretation of periods within numbers and abbreviations, and + * trailing punctuation marks such as quotation marks and parentheses. + *
+ * Word boundary analysis is used by search and replace functions, as + * well as within text editing applications that allow the user to + * select words with a double click. Word selection provides correct + * interpretation of punctuation marks within and following + * words. Characters that are not part of a word, such as symbols or + * punctuation marks, have word-breaks on both sides. + *
+ * Character boundary analysis allows users to interact with + * characters as they expect to, for example, when moving the cursor + * through a text string. Character boundary analysis provides correct + * navigation of through character strings, regardless of how the + * character is stored. For example, an accented character might be + * stored as a base character and a diacritical mark. What users + * consider to be a character can differ between languages. + *
+ * The text boundary positions are found according to the rules + * described in Unicode Standard Annex #29, Text Boundaries, and + * Unicode Standard Annex #14, Line Breaking Properties. These + * are available at http://www.unicode.org/reports/tr14/ and + * http://www.unicode.org/reports/tr29/. + *
+ * In addition to the C++ API defined in this header file, a + * plain C API with equivalent functionality is defined in the + * file ubrk.h + *
+ * Code snippets illustrating the use of the Break Iterator APIs + * are available in the ICU User Guide, + * https://unicode-org.github.io/icu/userguide/boundaryanalysis/ + * and in the sample program icu/source/samples/break/break.cpp + * + */ +class U_COMMON_API BreakIterator : public UObject { +public: + /** + * destructor + * @stable ICU 2.0 + */ + virtual ~BreakIterator(); + + /** + * Return true if another object is semantically equal to this + * one. The other object should be an instance of the same subclass of + * BreakIterator. Objects of different subclasses are considered + * unequal. + *
+ * Return true if this BreakIterator is at the same position in the
+ * same text, and is the same class and type (word, line, etc.) of
+ * BreakIterator, as the argument. Text is considered the same if
+ * it contains the same characters, it need not be the same
+ * object, and styles are not considered.
+ * @stable ICU 2.0
+ */
+ virtual bool operator==(const BreakIterator&) const = 0;
+
+ /**
+ * Returns the complement of the result of operator==
+ * @param rhs The BreakIterator to be compared for inequality
+ * @return the complement of the result of operator==
+ * @stable ICU 2.0
+ */
+ bool operator!=(const BreakIterator& rhs) const { return !operator==(rhs); }
+
+ /**
+ * Return a polymorphic copy of this object. This is an abstract
+ * method which subclasses implement.
+ * @stable ICU 2.0
+ */
+ virtual BreakIterator* clone() const = 0;
+
+ /**
+ * Return a polymorphic class ID for this object. Different subclasses
+ * will return distinct unequal values.
+ * @stable ICU 2.0
+ */
+ virtual UClassID getDynamicClassID() const override = 0;
+
+ /**
+ * Return a CharacterIterator over the text being analyzed.
+ * @stable ICU 2.0
+ */
+ virtual CharacterIterator& getText() const = 0;
+
+ /**
+ * Get a UText for the text being analyzed.
+ * The returned UText is a shallow clone of the UText used internally
+ * by the break iterator implementation. It can safely be used to
+ * access the text without impacting any break iterator operations,
+ * but the underlying text itself must not be altered.
+ *
+ * @param fillIn A UText to be filled in. If nullptr, a new UText will be
+ * allocated to hold the result.
+ * @param status receives any error codes.
+ * @return The current UText for this break iterator. If an input
+ * UText was provided, it will always be returned.
+ * @stable ICU 3.4
+ */
+ virtual UText *getUText(UText *fillIn, UErrorCode &status) const = 0;
+
+ /**
+ * Change the text over which this operates. The text boundary is
+ * reset to the start.
+ *
+ * The BreakIterator will retain a reference to the supplied string.
+ * The caller must not modify or delete the text while the BreakIterator
+ * retains the reference.
+ *
+ * @param text The UnicodeString used to change the text.
+ * @stable ICU 2.0
+ */
+ virtual void setText(const UnicodeString &text) = 0;
+
+ /**
+ * Reset the break iterator to operate over the text represented by
+ * the UText. The iterator position is reset to the start.
+ *
+ * This function makes a shallow clone of the supplied UText. This means
+ * that the caller is free to immediately close or otherwise reuse the
+ * Utext that was passed as a parameter, but that the underlying text itself
+ * must not be altered while being referenced by the break iterator.
+ *
+ * All index positions returned by break iterator functions are
+ * native indices from the UText. For example, when breaking UTF-8
+ * encoded text, the break positions returned by next(), previous(), etc.
+ * will be UTF-8 string indices, not UTF-16 positions.
+ *
+ * @param text The UText used to change the text.
+ * @param status receives any error codes.
+ * @stable ICU 3.4
+ */
+ virtual void setText(UText *text, UErrorCode &status) = 0;
+
+ /**
+ * Change the text over which this operates. The text boundary is
+ * reset to the start.
+ * Note that setText(UText *) provides similar functionality to this function,
+ * and is more efficient.
+ * @param it The CharacterIterator used to change the text.
+ * @stable ICU 2.0
+ */
+ virtual void adoptText(CharacterIterator* it) = 0;
+
+ enum {
+ /**
+ * DONE is returned by previous() and next() after all valid
+ * boundaries have been returned.
+ * @stable ICU 2.0
+ */
+ DONE = static_cast
+ * For break iterator types that do not support a rule status,
+ * a default value of 0 is returned.
+ *
+ * @return the status from the break rule that determined the boundary at
+ * the current iteration position.
+ * @see RuleBaseBreakIterator::getRuleStatus()
+ * @see UWordBreak
+ * @stable ICU 52
+ */
+ virtual int32_t getRuleStatus() const;
+
+ /**
+ * For RuleBasedBreakIterators, get the status (tag) values from the break rule(s)
+ * that determined the boundary at the current iteration position.
+ *
+ * For break iterator types that do not support rule status,
+ * no values are returned.
+ *
+ * The returned status value(s) are stored into an array provided by the caller.
+ * The values are stored in sorted (ascending) order.
+ * If the capacity of the output array is insufficient to hold the data,
+ * the output will be truncated to the available length, and a
+ * U_BUFFER_OVERFLOW_ERROR will be signaled.
+ *
+ * @see RuleBaseBreakIterator::getRuleStatusVec
+ *
+ * @param fillInVec an array to be filled in with the status values.
+ * @param capacity the length of the supplied vector. A length of zero causes
+ * the function to return the number of status values, in the
+ * normal way, without attempting to store any values.
+ * @param status receives error codes.
+ * @return The number of rule status values from rules that determined
+ * the boundary at the current iteration position.
+ * In the event of a U_BUFFER_OVERFLOW_ERROR, the return value
+ * is the total number of status values that were available,
+ * not the reduced number that were actually returned.
+ * @see getRuleStatus
+ * @stable ICU 52
+ */
+ virtual int32_t getRuleStatusVec(int32_t *fillInVec, int32_t capacity, UErrorCode &status);
+
+ /**
+ * Create BreakIterator for word-breaks using the given locale.
+ * Returns an instance of a BreakIterator implementing word breaks.
+ * WordBreak is useful for word selection (ex. double click)
+ * @param where the locale.
+ * @param status the error code
+ * @return A BreakIterator for word-breaks. The UErrorCode& status
+ * parameter is used to return status information to the user.
+ * To check whether the construction succeeded or not, you should check
+ * the value of U_SUCCESS(err). If you wish more detailed information, you
+ * can check for informational error results which still indicate success.
+ * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
+ * example, 'de_CH' was requested, but nothing was found there, so 'de' was
+ * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
+ * used; neither the requested locale nor any of its fall back locales
+ * could be found.
+ * The caller owns the returned object and is responsible for deleting it.
+ * @stable ICU 2.0
+ */
+ static BreakIterator* U_EXPORT2
+ createWordInstance(const Locale& where, UErrorCode& status);
+
+ /**
+ * Create BreakIterator for line-breaks using specified locale.
+ * Returns an instance of a BreakIterator implementing line breaks. Line
+ * breaks are logically possible line breaks, actual line breaks are
+ * usually determined based on display width.
+ * LineBreak is useful for word wrapping text.
+ * @param where the locale.
+ * @param status The error code.
+ * @return A BreakIterator for line-breaks. The UErrorCode& status
+ * parameter is used to return status information to the user.
+ * To check whether the construction succeeded or not, you should check
+ * the value of U_SUCCESS(err). If you wish more detailed information, you
+ * can check for informational error results which still indicate success.
+ * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
+ * example, 'de_CH' was requested, but nothing was found there, so 'de' was
+ * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
+ * used; neither the requested locale nor any of its fall back locales
+ * could be found.
+ * The caller owns the returned object and is responsible for deleting it.
+ * @stable ICU 2.0
+ */
+ static BreakIterator* U_EXPORT2
+ createLineInstance(const Locale& where, UErrorCode& status);
+
+ /**
+ * Create BreakIterator for character-breaks using specified locale
+ * Returns an instance of a BreakIterator implementing character breaks.
+ * Character breaks are boundaries of combining character sequences.
+ * @param where the locale.
+ * @param status The error code.
+ * @return A BreakIterator for character-breaks. The UErrorCode& status
+ * parameter is used to return status information to the user.
+ * To check whether the construction succeeded or not, you should check
+ * the value of U_SUCCESS(err). If you wish more detailed information, you
+ * can check for informational error results which still indicate success.
+ * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
+ * example, 'de_CH' was requested, but nothing was found there, so 'de' was
+ * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
+ * used; neither the requested locale nor any of its fall back locales
+ * could be found.
+ * The caller owns the returned object and is responsible for deleting it.
+ * @stable ICU 2.0
+ */
+ static BreakIterator* U_EXPORT2
+ createCharacterInstance(const Locale& where, UErrorCode& status);
+
+ /**
+ * Create BreakIterator for sentence-breaks using specified locale
+ * Returns an instance of a BreakIterator implementing sentence breaks.
+ * @param where the locale.
+ * @param status The error code.
+ * @return A BreakIterator for sentence-breaks. The UErrorCode& status
+ * parameter is used to return status information to the user.
+ * To check whether the construction succeeded or not, you should check
+ * the value of U_SUCCESS(err). If you wish more detailed information, you
+ * can check for informational error results which still indicate success.
+ * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
+ * example, 'de_CH' was requested, but nothing was found there, so 'de' was
+ * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
+ * used; neither the requested locale nor any of its fall back locales
+ * could be found.
+ * The caller owns the returned object and is responsible for deleting it.
+ * @stable ICU 2.0
+ */
+ static BreakIterator* U_EXPORT2
+ createSentenceInstance(const Locale& where, UErrorCode& status);
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Create BreakIterator for title-casing breaks using the specified locale
+ * Returns an instance of a BreakIterator implementing title breaks.
+ * The iterator returned locates title boundaries as described for
+ * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
+ * please use a word boundary iterator. See {@link #createWordInstance }.
+ *
+ * @param where the locale.
+ * @param status The error code.
+ * @return A BreakIterator for title-breaks. The UErrorCode& status
+ * parameter is used to return status information to the user.
+ * To check whether the construction succeeded or not, you should check
+ * the value of U_SUCCESS(err). If you wish more detailed information, you
+ * can check for informational error results which still indicate success.
+ * U_USING_FALLBACK_WARNING indicates that a fall back locale was used. For
+ * example, 'de_CH' was requested, but nothing was found there, so 'de' was
+ * used. U_USING_DEFAULT_WARNING indicates that the default locale data was
+ * used; neither the requested locale nor any of its fall back locales
+ * could be found.
+ * The caller owns the returned object and is responsible for deleting it.
+ * @deprecated ICU 64 Use createWordInstance instead.
+ */
+ static BreakIterator* U_EXPORT2
+ createTitleInstance(const Locale& where, UErrorCode& status);
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Get the set of Locales for which TextBoundaries are installed.
+ * Note: this will not return locales added through the register
+ * call. To see the registered locales too, use the getAvailableLocales
+ * function that returns a StringEnumeration object
+ * The Japanese calendar uses a combination of era name and year number.
+ * When an emperor of Japan abdicates and a new emperor ascends the throne,
+ * a new era is declared and year number is reset to 1. Even if the date of
+ * abdication is scheduled ahead of time, the new era name might not be
+ * announced until just before the date. In such case, ICU4C may include
+ * a start date of future era without actual era name, but not enabled
+ * by default. ICU4C users who want to test the behavior of the future era
+ * can enable the tentative era by:
+ *
+ * NOTE: Do not use this method -- use roll(EDateFields, int, UErrorCode&) instead.
+ *
+ * @param field The time field.
+ * @param up Indicates if the value of the specified time field is to be rolled
+ * up or rolled down. Use true if rolling up, false otherwise.
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, UBool up, UErrorCode& status) instead.
+ */
+ inline void roll(EDateFields field, UBool up, UErrorCode& status);
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Time Field Rolling function. Rolls (up/down) a single unit of time on the given
+ * time field. For example, to roll the current date up by one day, call
+ * roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it
+ * will roll the year value in the range between getMinimum(Calendar::YEAR) and the
+ * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
+ * Calendar::MONTH field, other fields like date might conflict and, need to be
+ * changed. For instance, rolling the month up on the date 01/31/96 will result in
+ * 02/29/96. Rolling up always means rolling forward in time (unless the limit of the
+ * field is reached, in which case it may pin or wrap), so for Gregorian calendar,
+ * starting with 100 BC and rolling the year up results in 99 BC.
+ * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+ * most eras in the Japanese calendar) then rolling the year past either limit of the
+ * era will cause the year to wrap around. When eras only have a limit at one end,
+ * then attempting to roll the year past that limit will result in pinning the year
+ * at that limit. Note that for most calendars in which era 0 years move forward in
+ * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+ * result in negative years for era 0 (that is the only way to represent years before
+ * the calendar epoch).
+ * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+ * hour value in the range between 0 and 23, which is zero-based.
+ *
+ * NOTE: Do not use this method -- use roll(UCalendarDateFields, int, UErrorCode&) instead.
+ *
+ * @param field The time field.
+ * @param up Indicates if the value of the specified time field is to be rolled
+ * up or rolled down. Use true if rolling up, false otherwise.
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @stable ICU 2.6.
+ */
+ inline void roll(UCalendarDateFields field, UBool up, UErrorCode& status);
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Time Field Rolling function. Rolls by the given amount on the given
+ * time field. For example, to roll the current date up by one day, call
+ * roll(Calendar::DATE, +1, status). When rolling on the month or
+ * Calendar::MONTH field, other fields like date might conflict and, need to be
+ * changed. For instance, rolling the month up on the date 01/31/96 will result in
+ * 02/29/96. Rolling by a positive value always means rolling forward in time (unless
+ * the limit of the field is reached, in which case it may pin or wrap), so for
+ * Gregorian calendar, starting with 100 BC and rolling the year by + 1 results in 99 BC.
+ * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+ * most eras in the Japanese calendar) then rolling the year past either limit of the
+ * era will cause the year to wrap around. When eras only have a limit at one end,
+ * then attempting to roll the year past that limit will result in pinning the year
+ * at that limit. Note that for most calendars in which era 0 years move forward in
+ * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+ * result in negative years for era 0 (that is the only way to represent years before
+ * the calendar epoch).
+ * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+ * hour value in the range between 0 and 23, which is zero-based.
+ *
+ * The only difference between roll() and add() is that roll() does not change
+ * the value of more significant fields when it reaches the minimum or maximum
+ * of its range, whereas add() does.
+ *
+ * @param field The time field.
+ * @param amount Indicates amount to roll.
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid, this will be set to
+ * an error status.
+ * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead.
+ */
+ virtual void roll(EDateFields field, int32_t amount, UErrorCode& status);
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Time Field Rolling function. Rolls by the given amount on the given
+ * time field. For example, to roll the current date up by one day, call
+ * roll(Calendar::DATE, +1, status). When rolling on the month or
+ * Calendar::MONTH field, other fields like date might conflict and, need to be
+ * changed. For instance, rolling the month up on the date 01/31/96 will result in
+ * 02/29/96. Rolling by a positive value always means rolling forward in time (unless
+ * the limit of the field is reached, in which case it may pin or wrap), so for
+ * Gregorian calendar, starting with 100 BC and rolling the year by + 1 results in 99 BC.
+ * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+ * most eras in the Japanese calendar) then rolling the year past either limit of the
+ * era will cause the year to wrap around. When eras only have a limit at one end,
+ * then attempting to roll the year past that limit will result in pinning the year
+ * at that limit. Note that for most calendars in which era 0 years move forward in
+ * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+ * result in negative years for era 0 (that is the only way to represent years before
+ * the calendar epoch).
+ * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+ * hour value in the range between 0 and 23, which is zero-based.
+ *
+ * The only difference between roll() and add() is that roll() does not change
+ * the value of more significant fields when it reaches the minimum or maximum
+ * of its range, whereas add() does.
+ *
+ * @param field The time field.
+ * @param amount Indicates amount to roll.
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid, this will be set to
+ * an error status.
+ * @stable ICU 2.6.
+ */
+ virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status);
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Return the difference between the given time and the time this
+ * calendar object is set to. If this calendar is set
+ * before the given time, the returned value will be
+ * positive. If this calendar is set after the given
+ * time, the returned value will be negative. The
+ * As a side effect of this call, this calendar is advanced
+ * toward Usage: To use this method, call it first with the largest
+ * field of interest, then with progressively smaller fields. For
+ * example:
+ *
+ * Note: As a side effect of this call, this calendar is advanced
+ * toward Usage: To use this method, call it first with the largest
+ * field of interest, then with progressively smaller fields. For
+ * example:
+ *
+ * Note:
+ * Note:When
+ * Note:This option is effective only when this calendar is lenient.
+ * When the calendar is strict, such non-existing wall time will cause an error.
+ *
+ * @param option the behavior for handling skipped wall time at positive time zone
+ * offset transitions, one of
+ * Concrete subclasses of Calendar must implement getDynamicClassID() and also a
+ * static method and data member:
+ *
+ * static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
+ * static char fgClassID;
+ *
+ * @return The class ID for this object. All objects of a given class have the
+ * same class ID. Objects of other classes have different class IDs.
+ * @stable ICU 2.0
+ */
+ virtual UClassID getDynamicClassID() const override = 0;
+
+ /**
+ * Returns the calendar type name string for this Calendar object.
+ * The returned string is the legacy ICU calendar attribute value,
+ * for example, "gregorian" or "japanese".
+ *
+ * See type="old type name" for the calendar attribute of locale IDs
+ * at http://www.unicode.org/reports/tr35/#Key_Type_Definitions
+ *
+ * Sample code for getting the LDML/BCP 47 calendar key value:
+ * \code
+ * const char *calType = cal->getType();
+ * if (0 == strcmp(calType, "unknown")) {
+ * // deal with unknown calendar type
+ * } else {
+ * string localeID("root@calendar=");
+ * localeID.append(calType);
+ * char langTag[100];
+ * UErrorCode errorCode = U_ZERO_ERROR;
+ * int32_t length = uloc_toLanguageTag(localeID.c_str(), langTag, (int32_t)sizeof(langTag), true, &errorCode);
+ * if (U_FAILURE(errorCode)) {
+ * // deal with errors & overflow
+ * }
+ * string lang(langTag, length);
+ * size_t caPos = lang.find("-ca-");
+ * lang.erase(0, caPos + 4);
+ * // lang now contains the LDML calendar type
+ * }
+ * \endcode
+ *
+ * @return legacy calendar type name string
+ * @stable ICU 49
+ */
+ virtual const char * getType() const = 0;
+
+ /**
+ * Returns whether the given day of the week is a weekday, a weekend day,
+ * or a day that transitions from one to the other, for the locale and
+ * calendar system associated with this Calendar (the locale's region is
+ * often the most determinant factor). If a transition occurs at midnight,
+ * then the days before and after the transition will have the
+ * type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a time
+ * other than midnight, then the day of the transition will have
+ * the type UCAL_WEEKEND_ONSET or UCAL_WEEKEND_CEASE. In this case, the
+ * method getWeekendTransition() will return the point of
+ * transition.
+ * @param dayOfWeek The day of the week whose type is desired (UCAL_SUNDAY..UCAL_SATURDAY).
+ * @param status The error code for the operation.
+ * @return The UCalendarWeekdayType for the day of the week.
+ * @stable ICU 4.4
+ */
+ virtual UCalendarWeekdayType getDayOfWeekType(UCalendarDaysOfWeek dayOfWeek, UErrorCode &status) const;
+
+ /**
+ * Returns the time during the day at which the weekend begins or ends in
+ * this calendar system. If getDayOfWeekType() returns UCAL_WEEKEND_ONSET
+ * for the specified dayOfWeek, return the time at which the weekend begins.
+ * If getDayOfWeekType() returns UCAL_WEEKEND_CEASE for the specified dayOfWeek,
+ * return the time at which the weekend ends. If getDayOfWeekType() returns
+ * some other UCalendarWeekdayType for the specified dayOfWeek, is it an error condition
+ * (U_ILLEGAL_ARGUMENT_ERROR).
+ * @param dayOfWeek The day of the week for which the weekend transition time is
+ * desired (UCAL_SUNDAY..UCAL_SATURDAY).
+ * @param status The error code for the operation.
+ * @return The milliseconds after midnight at which the weekend begins or ends.
+ * @stable ICU 4.4
+ */
+ virtual int32_t getWeekendTransition(UCalendarDaysOfWeek dayOfWeek, UErrorCode &status) const;
+
+ /**
+ * Returns true if the given UDate is in the weekend in
+ * this calendar system.
+ * @param date The UDate in question.
+ * @param status The error code for the operation.
+ * @return true if the given UDate is in the weekend in
+ * this calendar system, false otherwise.
+ * @stable ICU 4.4
+ */
+ virtual UBool isWeekend(UDate date, UErrorCode &status) const;
+
+ /**
+ * Returns true if this Calendar's current date-time is in the weekend in
+ * this calendar system.
+ * @return true if this Calendar's current date-time is in the weekend in
+ * this calendar system, false otherwise.
+ * @stable ICU 4.4
+ */
+ virtual UBool isWeekend() const;
+
+ /**
+ * Returns true if the date is in a leap year. Recalculate the current time
+ * field values if the time value has been changed by a call to * setTime().
+ * This method is semantically const, but may alter the object in memory.
+ * A "leap year" is a year that contains more days than other years (for
+ * solar or lunar calendars) or more months than other years (for lunisolar
+ * calendars like Hebrew or Chinese), as defined in the ECMAScript Temporal
+ * proposal.
+ *
+ * @param status ICU Error Code
+ * @return True if the date in the fields is in a Temporal proposal
+ * defined leap year. False otherwise.
+ * @stable ICU 73
+ */
+ virtual bool inTemporalLeapYear(UErrorCode& status) const;
+
+ /**
+ * Gets The Temporal monthCode value corresponding to the month for the date.
+ * The value is a string identifier that starts with the literal grapheme
+ * "M" followed by two graphemes representing the zero-padded month number
+ * of the current month in a normal (non-leap) year and suffixed by an
+ * optional literal grapheme "L" if this is a leap month in a lunisolar
+ * calendar. The 25 possible values are "M01" .. "M13" and "M01L" .. "M12L".
+ * For the Hebrew calendar, the values are "M01" .. "M12" for non-leap year, and
+ * "M01" .. "M05", "M05L", "M06" .. "M12" for leap year.
+ * For the Chinese calendar, the values are "M01" .. "M12" for non-leap year and
+ * in leap year with another monthCode in "M01L" .. "M12L".
+ * For Coptic and Ethiopian calendar, the Temporal monthCode values for any
+ * years are "M01" to "M13".
+ *
+ * @param status ICU Error Code
+ * @return One of 25 possible strings in {"M01".."M13", "M01L".."M12L"}.
+ * @stable ICU 73
+ */
+ virtual const char* getTemporalMonthCode(UErrorCode& status) const;
+
+ /**
+ * Sets The Temporal monthCode which is a string identifier that starts
+ * with the literal grapheme "M" followed by two graphemes representing
+ * the zero-padded month number of the current month in a normal
+ * (non-leap) year and suffixed by an optional literal grapheme "L" if this
+ * is a leap month in a lunisolar calendar. The 25 possible values are
+ * "M01" .. "M13" and "M01L" .. "M12L". For Hebrew calendar, the values are
+ * "M01" .. "M12" for non-leap years, and "M01" .. "M05", "M05L", "M06"
+ * .. "M12" for leap year.
+ * For the Chinese calendar, the values are "M01" .. "M12" for non-leap year and
+ * in leap year with another monthCode in "M01L" .. "M12L".
+ * For Coptic and Ethiopian calendar, the Temporal monthCode values for any
+ * years are "M01" to "M13".
+ *
+ * @param temporalMonth The value to be set for temporal monthCode.
+ * @param status ICU Error Code
+ *
+ * @stable ICU 73
+ */
+ virtual void setTemporalMonthCode(const char* temporalMonth, UErrorCode& status);
+
+protected:
+
+ /**
+ * Constructs a Calendar with the default time zone as returned by
+ * TimeZone::createInstance(), and the default locale.
+ *
+ * @param success Indicates the status of Calendar object construction. Returns
+ * U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ Calendar(UErrorCode& success);
+
+ /**
+ * Copy constructor
+ *
+ * @param source Calendar object to be copied from
+ * @stable ICU 2.0
+ */
+ Calendar(const Calendar& source);
+
+ /**
+ * Default assignment operator
+ *
+ * @param right Calendar object to be copied
+ * @stable ICU 2.0
+ */
+ Calendar& operator=(const Calendar& right);
+
+ /**
+ * Constructs a Calendar with the given time zone and locale. Clients are no longer
+ * responsible for deleting the given time zone object after it's adopted.
+ *
+ * @param zone The given time zone.
+ * @param aLocale The given locale.
+ * @param success Indicates the status of Calendar object construction. Returns
+ * U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ Calendar(TimeZone* zone, const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Constructs a Calendar with the given time zone and locale.
+ *
+ * @param zone The given time zone.
+ * @param aLocale The given locale.
+ * @param success Indicates the status of Calendar object construction. Returns
+ * U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ Calendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Converts Calendar's time field values to GMT as milliseconds.
+ *
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @stable ICU 2.0
+ */
+ virtual void computeTime(UErrorCode& status);
+
+ /**
+ * Converts GMT as milliseconds to time field values. This allows you to sync up the
+ * time field values with a new time that is set for the calendar. This method
+ * does NOT recompute the time first; to recompute the time, then the fields, use
+ * the method complete().
+ *
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @stable ICU 2.0
+ */
+ virtual void computeFields(UErrorCode& status);
+
+ /**
+ * Gets this Calendar's current time as a long.
+ *
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @return the current time as UTC milliseconds from the epoch.
+ * @stable ICU 2.0
+ */
+ double getTimeInMillis(UErrorCode& status) const;
+
+ /**
+ * Sets this Calendar's current time from the given long value.
+ * @param millis the new time in UTC milliseconds from the epoch.
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @stable ICU 2.0
+ */
+ void setTimeInMillis( double millis, UErrorCode& status );
+
+ /**
+ * Recomputes the current time from currently set fields, and then fills in any
+ * unset fields in the time field list.
+ *
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @stable ICU 2.0
+ */
+ void complete(UErrorCode& status);
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Gets the value for a given time field. Subclasses can use this function to get
+ * field values without forcing recomputation of time.
+ *
+ * @param field The given time field.
+ * @return The value for the given time field.
+ * @deprecated ICU 2.6. Use internalGet(UCalendarDateFields field) instead.
+ */
+ inline int32_t internalGet(EDateFields field) const {return fFields[field];}
+#endif /* U_HIDE_DEPRECATED_API */
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Gets the value for a given time field. Subclasses can use this function to get
+ * field values without forcing recomputation of time. If the field's stamp is UNSET,
+ * the defaultValue is used.
+ *
+ * @param field The given time field.
+ * @param defaultValue a default value used if the field is unset.
+ * @return The value for the given time field.
+ * @internal
+ */
+ inline int32_t internalGet(UCalendarDateFields field, int32_t defaultValue) const {return fStamp[field]>kUnset ? fFields[field] : defaultValue;}
+
+ /**
+ * Gets the value for a given time field. Subclasses can use this function to get
+ * field values without forcing recomputation of time.
+ *
+ * @param field The given time field.
+ * @return The value for the given time field.
+ * @internal
+ */
+ inline int32_t internalGet(UCalendarDateFields field) const {return fFields[field];}
+
+ /**
+ * The year in this calendar is counting from 1 backward if the era is 0.
+ * @return The year in era 0 of this calendar is counting backward from 1.
+ * @internal
+ */
+ virtual bool isEra0CountingBackward() const { return false; }
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Use this function instead of internalGet(UCAL_MONTH). The implementation
+ * check the timestamp of UCAL_MONTH and UCAL_ORDINAL_MONTH and use the
+ * one set later. The subclass should override it to conver the value of UCAL_ORDINAL_MONTH
+ * to UCAL_MONTH correctly if UCAL_ORDINAL_MONTH has higher priority.
+ *
+ * @return The value for the UCAL_MONTH.
+ * @internal
+ */
+ virtual int32_t internalGetMonth(UErrorCode& status) const;
+
+ /**
+ * Use this function instead of internalGet(UCAL_MONTH, defaultValue). The implementation
+ * check the timestamp of UCAL_MONTH and UCAL_ORDINAL_MONTH and use the
+ * one set later. The subclass should override it to conver the value of UCAL_ORDINAL_MONTH
+ * to UCAL_MONTH correctly if UCAL_ORDINAL_MONTH has higher priority.
+ *
+ * @param defaultValue a default value used if the UCAL_MONTH and
+ * UCAL_ORDINAL are both unset.
+ * @param status Output param set to failure code on function return
+ * when this function fails.
+ * @return The value for the UCAL_MONTH.
+ * @internal
+ */
+ virtual int32_t internalGetMonth(int32_t defaultValue, UErrorCode& status) const;
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Sets the value for a given time field. This is a fast internal method for
+ * subclasses. It does not affect the areFieldsInSync, isTimeSet, or areAllFieldsSet
+ * flags.
+ *
+ * @param field The given time field.
+ * @param value The value for the given time field.
+ * @deprecated ICU 2.6. Use internalSet(UCalendarDateFields field, int32_t value) instead.
+ */
+ void internalSet(EDateFields field, int32_t value);
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Sets the value for a given time field. This is a fast internal method for
+ * subclasses. It does not affect the areFieldsInSync, isTimeSet, or areAllFieldsSet
+ * flags.
+ *
+ * @param field The given time field.
+ * @param value The value for the given time field.
+ * @stable ICU 2.6.
+ */
+ inline void internalSet(UCalendarDateFields field, int32_t value);
+
+ /**
+ * Prepare this calendar for computing the actual minimum or maximum.
+ * This method modifies this calendar's fields; it is called on a
+ * temporary calendar.
+ * @internal
+ */
+ virtual void prepareGetActual(UCalendarDateFields field, UBool isMinimum, UErrorCode &status);
+
+ /**
+ * Limit enums. Not in sync with UCalendarLimitType (refers to internal fields).
+ * @internal
+ */
+ enum ELimitType {
+#ifndef U_HIDE_INTERNAL_API
+ UCAL_LIMIT_MINIMUM = 0,
+ UCAL_LIMIT_GREATEST_MINIMUM,
+ UCAL_LIMIT_LEAST_MAXIMUM,
+ UCAL_LIMIT_MAXIMUM,
+ UCAL_LIMIT_COUNT
+#endif /* U_HIDE_INTERNAL_API */
+ };
+
+ /**
+ * Subclass API for defining limits of different types.
+ * Subclasses must implement this method to return limits for the
+ * following fields:
+ *
+ * The precedence table is a 3-dimensional array of integers. It
+ * may be thought of as an array of groups. Each group is an array of
+ * lines. Each line is an array of field numbers. Within a line, if
+ * all fields are set, then the time stamp of the line is taken to be
+ * the stamp of the most recently set field. If any field of a line is
+ * unset, then the line fails to match. Within a group, the line with
+ * the newest time stamp is selected. The first field of the line is
+ * returned to indicate which line matched.
+ *
+ * In some cases, it may be desirable to map a line to field that
+ * whose stamp is NOT examined. For example, if the best field is
+ * DAY_OF_WEEK then the DAY_OF_WEEK_IN_MONTH algorithm may be used. In
+ * order to do this, insert the value If all lines of a group contain at least one unset field, then no
+ * line will match, and the group as a whole will fail to match. In
+ * that case, the next group will be processed. If all groups fail to
+ * match, then UCAL_FIELD_COUNT is returned.
+ * @internal
+ */
+ UCalendarDateFields resolveFields(const UFieldResolutionTable *precedenceTable) const;
+#endif /* U_HIDE_INTERNAL_API */
+
+
+ /**
+ * @internal
+ */
+ virtual const UFieldResolutionTable* getFieldResolutionTable() const;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Return the field that is newer, either defaultField, or
+ * alternateField. If neither is newer or neither is set, return defaultField.
+ * @internal
+ */
+ UCalendarDateFields newerField(UCalendarDateFields defaultField, UCalendarDateFields alternateField) const;
+#endif /* U_HIDE_INTERNAL_API */
+
+
+private:
+ /**
+ * Helper function for calculating limits by trial and error
+ * @param field The field being investigated
+ * @param startValue starting (least max) value of field
+ * @param endValue ending (greatest max) value of field
+ * @param status return type
+ * @internal (private)
+ */
+ int32_t getActualHelper(UCalendarDateFields field, int32_t startValue, int32_t endValue, UErrorCode &status) const;
+
+protected:
+ /**
+ * Get the current time without recomputing.
+ *
+ * @return the current time without recomputing.
+ * @stable ICU 2.0
+ */
+ UDate internalGetTime() const { return fTime; }
+
+ /**
+ * Set the current time without affecting flags or fields.
+ *
+ * @param time The time to be set
+ * @return the current time without recomputing.
+ * @stable ICU 2.0
+ */
+ void internalSetTime(UDate time) { fTime = time; }
+
+ /**
+ * The time fields containing values into which the millis is computed.
+ * @stable ICU 2.0
+ */
+ int32_t fFields[UCAL_FIELD_COUNT];
+
+protected:
+ /** Special values of stamp[]
+ * @stable ICU 2.0
+ */
+ enum {
+ kUnset = 0,
+ kInternallySet,
+ kMinimumUserStamp
+ };
+
+private:
+ /**
+ * Pseudo-time-stamps which specify when each field was set. There
+ * are two special values, UNSET and INTERNALLY_SET. Values from
+ * MINIMUM_USER_SET to STAMP_MAX are legal user set values.
+ */
+ int8_t fStamp[UCAL_FIELD_COUNT];
+
+protected:
+ /**
+ * Subclasses may override this method to compute several fields
+ * specific to each calendar system. These are:
+ *
+ * In addition, subclasses should compute any subclass-specific
+ * fields, that is, fields from BASE_FIELD_COUNT to
+ * getFieldCount() - 1.
+ *
+ * The default implementation in
+ * Subclassing:
+ *
+ * Note:
+ *
+ * @param field The calendar field whose value should be pinned.
+ * @param status Output param set to failure code on function return
+ * when this function fails.
+ *
+ * @see #getActualMinimum
+ * @see #getActualMaximum
+ * @stable ICU 2.0
+ */
+ virtual void pinField(UCalendarDateFields field, UErrorCode& status);
+
+ /**
+ * Return the week number of a day, within a period. This may be the week number in
+ * a year or the week number in a month. Usually this will be a value >= 1, but if
+ * some initial days of the period are excluded from week 1, because
+ * {@link #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek} is > 1, then
+ * the week number will be zero for those
+ * initial days. This method requires the day number and day of week for some
+ * known date in the period in order to determine the day of week
+ * on the desired day.
+ *
+ * Subclassing:
+ *
+ * This variant is handy for computing the week number of some other
+ * day of a period (often the first or last day of the period) when its day
+ * of the week is not known but the day number and day of week for some other
+ * day in the period (e.g. the current date) is known.
+ *
+ * @param desiredDay The {@link #UCalendarDateFields DAY_OF_YEAR} or
+ * {@link #UCalendarDateFields DAY_OF_MONTH} whose week number is desired.
+ * Should be 1 for the first day of the period.
+ *
+ * @param dayOfPeriod The {@link #UCalendarDateFields DAY_OF_YEAR}
+ * or {@link #UCalendarDateFields DAY_OF_MONTH} for a day in the period whose
+ * {@link #UCalendarDateFields DAY_OF_WEEK} is specified by the
+ *
+ * Subclassing:
+ *
+ * @param dayOfPeriod The {@link #UCalendarDateFields DAY_OF_YEAR} or
+ * {@link #UCalendarDateFields DAY_OF_MONTH} whose week number is desired.
+ * Should be 1 for the first day of the period.
+ *
+ * @param dayOfWeek The {@link #UCalendarDateFields DAY_OF_WEEK} for the day
+ * corresponding to the
+ * This should really be named areFieldsInSync, but the old name is retained
+ * for backward compatibility.
+ */
+ bool fAreFieldsSet:1;
+
+ /**
+ * True if all of the fields have been set. This is initially false, and set to
+ * true by computeFields().
+ */
+ bool fAreAllFieldsSet:1;
+
+ /**
+ * True if all fields have been virtually set, but have not yet been
+ * computed. This occurs only in setTimeInMillis(). A calendar set
+ * to this state will compute all fields from the time if it becomes
+ * necessary, but otherwise will delay such computation.
+ */
+ bool fAreFieldsVirtuallySet:1;
+
+ /**
+ * @see #setLenient
+ */
+ bool fLenient:1;
+
+ /**
+ * Option for repeated wall time
+ * @see #setRepeatedWallTimeOption
+ */
+ UCalendarWallTimeOption fRepeatedWallTime:3; // Somehow MSVC need 3 bits for UCalendarWallTimeOption
+
+ /**
+ * Option for skipped wall time
+ * @see #setSkippedWallTimeOption
+ */
+ UCalendarWallTimeOption fSkippedWallTime:3; // Somehow MSVC need 3 bits for UCalendarWallTimeOption
+
+ /**
+ * Both firstDayOfWeek and minimalDaysInFirstWeek are locale-dependent. They are
+ * used to figure out the week count for a specific date for a given locale. These
+ * must be set when a Calendar is constructed. For example, in US locale,
+ * firstDayOfWeek is SUNDAY; minimalDaysInFirstWeek is 1. They are used to figure
+ * out the week count for a specific date for a given locale. These must be set when
+ * a Calendar is constructed.
+ */
+ UCalendarDaysOfWeek fFirstDayOfWeek:4; // Somehow MSVC need 4 bits for
+ // UCalendarDaysOfWeek
+ UCalendarDaysOfWeek fWeekendOnset:4; // Somehow MSVC need 4 bits for
+ // UCalendarDaysOfWeek
+ UCalendarDaysOfWeek fWeekendCease:4; // Somehow MSVC need 4 bits for
+ // UCalendarDaysOfWeek
+ uint8_t fMinimalDaysInFirstWeek;
+ int32_t fWeekendOnsetMillis;
+ int32_t fWeekendCeaseMillis;
+
+ /**
+ * Sets firstDayOfWeek and minimalDaysInFirstWeek. Called at Calendar construction
+ * time.
+ *
+ * @param desiredLocale The given locale.
+ * @param type The calendar type identifier, e.g: gregorian, buddhist, etc.
+ * @param success Indicates the status of setting the week count data from
+ * the resource for the given locale. Returns U_ZERO_ERROR if
+ * constructed successfully.
+ */
+ void setWeekData(const Locale& desiredLocale, const char *type, UErrorCode& success);
+
+ /**
+ * Recompute the time and update the status fields isTimeSet
+ * and areFieldsSet. Callers should check isTimeSet and only
+ * call this method if isTimeSet is false.
+ *
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ */
+ void updateTime(UErrorCode& status);
+
+ /**
+ * The Gregorian year, as computed by computeGregorianFields() and
+ * returned by getGregorianYear().
+ * @see #computeGregorianFields
+ */
+ int32_t fGregorianYear;
+
+ /**
+ * The Gregorian month, as computed by computeGregorianFields() and
+ * returned by getGregorianMonth().
+ * @see #computeGregorianFields
+ */
+ int8_t fGregorianMonth;
+
+ /**
+ * The Gregorian day of the month, as computed by
+ * computeGregorianFields() and returned by getGregorianDayOfMonth().
+ * @see #computeGregorianFields
+ */
+ int8_t fGregorianDayOfMonth;
+
+ /**
+ * The Gregorian day of the year, as computed by
+ * computeGregorianFields() and returned by getGregorianDayOfYear().
+ * @see #computeGregorianFields
+ */
+ int16_t fGregorianDayOfYear;
+
+ /* calculations */
+
+protected:
+
+ /**
+ * Compute the Gregorian calendar year, month, and day of month from the
+ * Julian day. These values are not stored in fields, but in member
+ * variables gregorianXxx. They are used for time zone computations and by
+ * subclasses that are Gregorian derivatives. Subclasses may call this
+ * method to perform a Gregorian calendar millis->fields computation.
+ */
+ void computeGregorianFields(int32_t julianDay, UErrorCode &ec);
+
+private:
+
+ /**
+ * Compute the fields WEEK_OF_YEAR, YEAR_WOY, WEEK_OF_MONTH,
+ * DAY_OF_WEEK_IN_MONTH, and DOW_LOCAL from EXTENDED_YEAR, YEAR,
+ * DAY_OF_WEEK, and DAY_OF_YEAR. The latter fields are computed by the
+ * subclass based on the calendar system.
+ *
+ * The YEAR_WOY field is computed simplistically. It is equal to YEAR
+ * most of the time, but at the year boundary it may be adjusted to YEAR-1
+ * or YEAR+1 to reflect the overlap of a week into an adjacent year. In
+ * this case, a simple increment or decrement is performed on YEAR, even
+ * though this may yield an invalid YEAR value. For instance, if the YEAR
+ * is part of a calendar system with an N-year cycle field CYCLE, then
+ * incrementing the YEAR may involve incrementing CYCLE and setting YEAR
+ * back to 0 or 1. This is not handled by this code, and in fact cannot be
+ * simply handled without having subclasses define an entire parallel set of
+ * fields for fields larger than or equal to a year. This additional
+ * complexity is not warranted, since the intention of the YEAR_WOY field is
+ * to support ISO 8601 notation, so it will typically be used with a
+ * proleptic Gregorian calendar, which has no field larger than a year.
+ */
+ void computeWeekFields(UErrorCode &ec);
+
+
+ /**
+ * Ensure that each field is within its valid range by calling {@link
+ * #validateField(int, int&)} on each field that has been set. This method
+ * should only be called if this calendar is not lenient.
+ * @see #isLenient
+ * @see #validateField(int, int&)
+ */
+ void validateFields(UErrorCode &status);
+
+ /**
+ * Validate a single field of this calendar given its minimum and
+ * maximum allowed value. If the field is out of range,
+ * Characters can be accessed in two ways: as code units or as
+ * code points.
+ * Unicode code points are 21-bit integers and are the scalar values
+ * of Unicode characters. ICU uses the type UChar32 for them.
+ * Unicode code units are the storage units of a given
+ * Unicode/UCS Transformation Format (a character encoding scheme).
+ * With UTF-16, all code points can be represented with either one
+ * or two code units ("surrogates").
+ * String storage is typically based on code units, while properties
+ * of characters are typically determined using code point values.
+ * Some processes may be designed to work with sequences of code units,
+ * or it may be known that all characters that are important to an
+ * algorithm can be represented with single code units.
+ * Other processes will need to use the code point access functions. ForwardCharacterIterator provides nextPostInc() to access
+ * a code unit and advance an internal position into the text object,
+ * similar to a next32PostInc() assumes that the current position is that of
+ * the beginning of a code point, i.e., of its first code unit.
+ * After next32PostInc(), this will be true again.
+ * In general, access to code units and code points in the same
+ * iteration loop should not be mixed. In UTF-16, if the current position
+ * is on a second code unit (Low Surrogate), then only that code unit
+ * is returned even by next32PostInc(). For iteration with either function, there are two ways to
+ * check for the end of the iteration. When there are no more
+ * characters in the text object:
+ * Despite the fact that this function is public,
+ * DO NOT CONSIDER IT PART OF CHARACTERITERATOR'S API!
+ * @return a UClassID for this ForwardCharacterIterator
+ * @stable ICU 2.0
+ */
+ virtual UClassID getDynamicClassID() const override = 0;
+
+ /**
+ * Gets the current code unit for returning and advances to the next code unit
+ * in the iteration range
+ * (toward endIndex()). If there are
+ * no more code units to return, returns DONE.
+ * @return the current code unit.
+ * @stable ICU 2.0
+ */
+ virtual char16_t nextPostInc() = 0;
+
+ /**
+ * Gets the current code point for returning and advances to the next code point
+ * in the iteration range
+ * (toward endIndex()). If there are
+ * no more code points to return, returns DONE.
+ * @return the current code point.
+ * @stable ICU 2.0
+ */
+ virtual UChar32 next32PostInc() = 0;
+
+ /**
+ * Returns false if there are no more code units or code points
+ * at or after the current position in the iteration range.
+ * This is used with nextPostInc() or next32PostInc() in forward
+ * iteration.
+ * @returns false if there are no more code units or code points
+ * at or after the current position in the iteration range.
+ * @stable ICU 2.0
+ */
+ virtual UBool hasNext() = 0;
+
+protected:
+ /** Default constructor to be overridden in the implementing class. @stable ICU 2.0*/
+ ForwardCharacterIterator();
+
+ /** Copy constructor to be overridden in the implementing class. @stable ICU 2.0*/
+ ForwardCharacterIterator(const ForwardCharacterIterator &other);
+
+ /**
+ * Assignment operator to be overridden in the implementing class.
+ * @stable ICU 2.0
+ */
+ ForwardCharacterIterator &operator=(const ForwardCharacterIterator&) { return *this; }
+};
+
+/**
+ * Abstract class that defines an API for iteration
+ * on text objects.
+ * This is an interface for forward and backward iteration
+ * and random access into a text object.
+ *
+ * The API provides backward compatibility to the Java and older ICU
+ * CharacterIterator classes but extends them significantly:
+ *
+ *
+ *
+ * @stable ICU 2.0
+ */
+class U_I18N_API Calendar : public UObject {
+public:
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Field IDs for date and time. Used to specify date/time fields. ERA is calendar
+ * specific. Example ranges given are for illustration only; see specific Calendar
+ * subclasses for actual ranges.
+ * @deprecated ICU 2.6. Use C enum UCalendarDateFields defined in ucal.h
+ */
+ enum EDateFields {
+#ifndef U_HIDE_DEPRECATED_API
+/*
+ * ERA may be defined on other platforms. To avoid any potential problems undefined it here.
+ */
+#ifdef ERA
+#undef ERA
+#endif
+ ERA, // Example: 0..1
+ YEAR, // Example: 1..big number
+ MONTH, // Example: 0..11
+ WEEK_OF_YEAR, // Example: 1..53
+ WEEK_OF_MONTH, // Example: 1..4
+ DATE, // Example: 1..31
+ DAY_OF_YEAR, // Example: 1..365
+ DAY_OF_WEEK, // Example: 1..7
+ DAY_OF_WEEK_IN_MONTH, // Example: 1..4, may be specified as -1
+ AM_PM, // Example: 0..1
+ HOUR, // Example: 0..11
+ HOUR_OF_DAY, // Example: 0..23
+ MINUTE, // Example: 0..59
+ SECOND, // Example: 0..59
+ MILLISECOND, // Example: 0..999
+ ZONE_OFFSET, // Example: -12*U_MILLIS_PER_HOUR..12*U_MILLIS_PER_HOUR
+ DST_OFFSET, // Example: 0 or U_MILLIS_PER_HOUR
+ YEAR_WOY, // 'Y' Example: 1..big number - Year of Week of Year
+ DOW_LOCAL, // 'e' Example: 1..7 - Day of Week / Localized
+
+ EXTENDED_YEAR,
+ JULIAN_DAY,
+ MILLISECONDS_IN_DAY,
+ IS_LEAP_MONTH,
+
+ FIELD_COUNT = UCAL_FIELD_COUNT // See ucal.h for other fields.
+#endif /* U_HIDE_DEPRECATED_API */
+ };
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Useful constant for days of week. Note: Calendar day-of-week is 1-based. Clients
+ * who create locale resources for the field of first-day-of-week should be aware of
+ * this. For instance, in US locale, first-day-of-week is set to 1, i.e., SUNDAY.
+ * @deprecated ICU 2.6. Use C enum UCalendarDaysOfWeek defined in ucal.h
+ */
+ enum EDaysOfWeek {
+ SUNDAY = 1,
+ MONDAY,
+ TUESDAY,
+ WEDNESDAY,
+ THURSDAY,
+ FRIDAY,
+ SATURDAY
+ };
+
+ /**
+ * Useful constants for month. Note: Calendar month is 0-based.
+ * @deprecated ICU 2.6. Use C enum UCalendarMonths defined in ucal.h
+ */
+ enum EMonths {
+ JANUARY,
+ FEBRUARY,
+ MARCH,
+ APRIL,
+ MAY,
+ JUNE,
+ JULY,
+ AUGUST,
+ SEPTEMBER,
+ OCTOBER,
+ NOVEMBER,
+ DECEMBER,
+ UNDECIMBER
+ };
+
+ /**
+ * Useful constants for hour in 12-hour clock. Used in GregorianCalendar.
+ * @deprecated ICU 2.6. Use C enum UCalendarAMPMs defined in ucal.h
+ */
+ enum EAmpm {
+ AM,
+ PM
+ };
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * destructor
+ * @stable ICU 2.0
+ */
+ virtual ~Calendar();
+
+ /**
+ * Create and return a polymorphic copy of this calendar.
+ *
+ * @return a polymorphic copy of this calendar.
+ * @stable ICU 2.0
+ */
+ virtual Calendar* clone() const = 0;
+
+ /**
+ * Creates a Calendar using the default timezone and locale. Clients are responsible
+ * for deleting the object returned.
+ *
+ * @param success Indicates the success/failure of Calendar creation. Filled in
+ * with U_ZERO_ERROR if created successfully, set to a failure result
+ * otherwise. U_MISSING_RESOURCE_ERROR will be returned if the resource data
+ * requests a calendar type which has not been installed.
+ * @return A Calendar if created successfully. nullptr otherwise.
+ * @stable ICU 2.0
+ */
+ static Calendar* U_EXPORT2 createInstance(UErrorCode& success);
+
+ /**
+ * Creates a Calendar using the given timezone and the default locale.
+ * The Calendar takes ownership of zoneToAdopt; the
+ * client must not delete it.
+ *
+ * @param zoneToAdopt The given timezone to be adopted.
+ * @param success Indicates the success/failure of Calendar creation. Filled in
+ * with U_ZERO_ERROR if created successfully, set to a failure result
+ * otherwise.
+ * @return A Calendar if created successfully. nullptr otherwise.
+ * @stable ICU 2.0
+ */
+ static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, UErrorCode& success);
+
+ /**
+ * Creates a Calendar using the given timezone and the default locale. The TimeZone
+ * is _not_ adopted; the client is still responsible for deleting it.
+ *
+ * @param zone The timezone.
+ * @param success Indicates the success/failure of Calendar creation. Filled in
+ * with U_ZERO_ERROR if created successfully, set to a failure result
+ * otherwise.
+ * @return A Calendar if created successfully. nullptr otherwise.
+ * @stable ICU 2.0
+ */
+ static Calendar* U_EXPORT2 createInstance(const TimeZone& zone, UErrorCode& success);
+
+ /**
+ * Creates a Calendar using the default timezone and the given locale.
+ *
+ * @param aLocale The given locale.
+ * @param success Indicates the success/failure of Calendar creation. Filled in
+ * with U_ZERO_ERROR if created successfully, set to a failure result
+ * otherwise.
+ * @return A Calendar if created successfully. nullptr otherwise.
+ * @stable ICU 2.0
+ */
+ static Calendar* U_EXPORT2 createInstance(const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Creates a Calendar using the given timezone and given locale.
+ * The Calendar takes ownership of zoneToAdopt; the
+ * client must not delete it.
+ *
+ * @param zoneToAdopt The given timezone to be adopted.
+ * @param aLocale The given locale.
+ * @param success Indicates the success/failure of Calendar creation. Filled in
+ * with U_ZERO_ERROR if created successfully, set to a failure result
+ * otherwise.
+ * @return A Calendar if created successfully. nullptr otherwise.
+ * @stable ICU 2.0
+ */
+ static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Gets a Calendar using the given timezone and given locale. The TimeZone
+ * is _not_ adopted; the client is still responsible for deleting it.
+ *
+ * @param zone The given timezone.
+ * @param aLocale The given locale.
+ * @param success Indicates the success/failure of Calendar creation. Filled in
+ * with U_ZERO_ERROR if created successfully, set to a failure result
+ * otherwise.
+ * @return A Calendar if created successfully. nullptr otherwise.
+ * @stable ICU 2.0
+ */
+ static Calendar* U_EXPORT2 createInstance(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Returns a list of the locales for which Calendars are installed.
+ *
+ * @param count Number of locales returned.
+ * @return An array of Locale objects representing the set of locales for which
+ * Calendars are installed. The system retains ownership of this list;
+ * the caller must NOT delete it. Does not include user-registered Calendars.
+ * @stable ICU 2.0
+ */
+ static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
+
+
+ /**
+ * Given a key and a locale, returns an array of string values in a preferred
+ * order that would make a difference. These are all and only those values where
+ * the open (creation) of the service with the locale formed from the input locale
+ * plus input keyword and that value has different behavior than creation with the
+ * input locale alone.
+ * @param key one of the keys supported by this service. For now, only
+ * "calendar" is supported.
+ * @param locale the locale
+ * @param commonlyUsed if set to true it will return only commonly used values
+ * with the given locale in preferred order. Otherwise,
+ * it will return all the available values for the locale.
+ * @param status ICU Error Code
+ * @return a string enumeration over keyword values for the given key and the locale.
+ * @stable ICU 4.2
+ */
+ static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const char* key,
+ const Locale& locale, UBool commonlyUsed, UErrorCode& status);
+
+ /**
+ * Returns the current UTC (GMT) time measured in milliseconds since 0:00:00 on 1/1/70
+ * (derived from the system time).
+ *
+ * @return The current UTC time in milliseconds.
+ * @stable ICU 2.0
+ */
+ static UDate U_EXPORT2 getNow();
+
+ /**
+ * Gets this Calendar's time as milliseconds. May involve recalculation of time due
+ * to previous calls to set time field values. The time specified is non-local UTC
+ * (GMT) time. Although this method is const, this object may actually be changed
+ * (semantically const).
+ *
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @return The current time in UTC (GMT) time, or zero if the operation
+ * failed.
+ * @stable ICU 2.0
+ */
+ inline UDate getTime(UErrorCode& status) const { return getTimeInMillis(status); }
+
+ /**
+ * Sets this Calendar's current time with the given UDate. The time specified should
+ * be in non-local UTC (GMT) time.
+ *
+ * @param date The given UDate in UTC (GMT) time.
+ * @param status Output param set to success/failure code on exit. If any value
+ * set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @stable ICU 2.0
+ */
+ inline void setTime(UDate date, UErrorCode& status) { setTimeInMillis(date, status); }
+
+ /**
+ * Compares the equality of two Calendar objects. Objects of different subclasses
+ * are considered unequal. This comparison is very exacting; two Calendar objects
+ * must be in exactly the same state to be considered equal. To compare based on the
+ * represented time, use equals() instead.
+ *
+ * @param that The Calendar object to be compared with.
+ * @return true if the given Calendar is the same as this Calendar; false
+ * otherwise.
+ * @stable ICU 2.0
+ */
+ virtual bool operator==(const Calendar& that) const;
+
+ /**
+ * Compares the inequality of two Calendar objects.
+ *
+ * @param that The Calendar object to be compared with.
+ * @return true if the given Calendar is not the same as this Calendar; false
+ * otherwise.
+ * @stable ICU 2.0
+ */
+ bool operator!=(const Calendar& that) const {return !operator==(that);}
+
+ /**
+ * Returns true if the given Calendar object is equivalent to this
+ * one. An equivalent Calendar will behave exactly as this one
+ * does, but it may be set to a different time. By contrast, for
+ * the operator==() method to return true, the other Calendar must
+ * be set to the same time.
+ *
+ * @param other the Calendar to be compared with this Calendar
+ * @stable ICU 2.4
+ */
+ virtual UBool isEquivalentTo(const Calendar& other) const;
+
+ /**
+ * Compares the Calendar time, whereas Calendar::operator== compares the equality of
+ * Calendar objects.
+ *
+ * @param when The Calendar to be compared with this Calendar. Although this is a
+ * const parameter, the object may be modified physically
+ * (semantically const).
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @return True if the current time of this Calendar is equal to the time of
+ * Calendar when; false otherwise.
+ * @stable ICU 2.0
+ */
+ UBool equals(const Calendar& when, UErrorCode& status) const;
+
+ /**
+ * Returns true if this Calendar's current time is before "when"'s current time.
+ *
+ * @param when The Calendar to be compared with this Calendar. Although this is a
+ * const parameter, the object may be modified physically
+ * (semantically const).
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @return True if the current time of this Calendar is before the time of
+ * Calendar when; false otherwise.
+ * @stable ICU 2.0
+ */
+ UBool before(const Calendar& when, UErrorCode& status) const;
+
+ /**
+ * Returns true if this Calendar's current time is after "when"'s current time.
+ *
+ * @param when The Calendar to be compared with this Calendar. Although this is a
+ * const parameter, the object may be modified physically
+ * (semantically const).
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @return True if the current time of this Calendar is after the time of
+ * Calendar when; false otherwise.
+ * @stable ICU 2.0
+ */
+ UBool after(const Calendar& when, UErrorCode& status) const;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * UDate Arithmetic function. Adds the specified (signed) amount of time to the given
+ * time field, based on the calendar's rules. For example, to subtract 5 days from
+ * the current time of the calendar, call add(Calendar::DATE, -5). When adding on
+ * the month or Calendar::MONTH field, other fields like date might conflict and
+ * need to be changed. For instance, adding 1 month on the date 01/31/96 will result
+ * in 02/29/96.
+ * Adding a positive value always means moving forward in time, so for the Gregorian calendar,
+ * starting with 100 BC and adding +1 to year results in 99 BC (even though this actually reduces
+ * the numeric value of the field itself).
+ *
+ * @param field Specifies which date field to modify.
+ * @param amount The amount of time to be added to the field, in the natural unit
+ * for that field (e.g., days for the day fields, hours for the hour
+ * field.)
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @deprecated ICU 2.6. use add(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead.
+ */
+ virtual void add(EDateFields field, int32_t amount, UErrorCode& status);
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * UDate Arithmetic function. Adds the specified (signed) amount of time to the given
+ * time field, based on the calendar's rules. For example, to subtract 5 days from
+ * the current time of the calendar, call add(Calendar::DATE, -5). When adding on
+ * the month or Calendar::MONTH field, other fields like date might conflict and
+ * need to be changed. For instance, adding 1 month on the date 01/31/96 will result
+ * in 02/29/96.
+ * Adding a positive value always means moving forward in time, so for the Gregorian calendar,
+ * starting with 100 BC and adding +1 to year results in 99 BC (even though this actually reduces
+ * the numeric value of the field itself).
+ *
+ * @param field Specifies which date field to modify.
+ * @param amount The amount of time to be added to the field, in the natural unit
+ * for that field (e.g., days for the day fields, hours for the hour
+ * field.)
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid or restricted by
+ * leniency, this will be set to an error status.
+ * @stable ICU 2.6.
+ */
+ virtual void add(UCalendarDateFields field, int32_t amount, UErrorCode& status);
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Time Field Rolling function. Rolls (up/down) a single unit of time on the given
+ * time field. For example, to roll the current date up by one day, call
+ * roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it
+ * will roll the year value in the range between getMinimum(Calendar::YEAR) and the
+ * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
+ * Calendar::MONTH field, other fields like date might conflict and, need to be
+ * changed. For instance, rolling the month up on the date 01/31/96 will result in
+ * 02/29/96. Rolling up always means rolling forward in time (unless the limit of the
+ * field is reached, in which case it may pin or wrap), so for Gregorian calendar,
+ * starting with 100 BC and rolling the year up results in 99 BC.
+ * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+ * most eras in the Japanese calendar) then rolling the year past either limit of the
+ * era will cause the year to wrap around. When eras only have a limit at one end,
+ * then attempting to roll the year past that limit will result in pinning the year
+ * at that limit. Note that for most calendars in which era 0 years move forward in
+ * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+ * result in negative years for era 0 (that is the only way to represent years before
+ * the calendar epoch).
+ * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+ * hour value in the range between 0 and 23, which is zero-based.
+ * ICU_ENABLE_TENTATIVE_ERA=true
.field
parameter specifies the units of the return
+ * value. For example, if fieldDifference(when,
+ * Calendar::MONTH)
returns 3, then this calendar is set to
+ * 3 months before when
, and possibly some addition
+ * time less than one month.
+ *
+ * when
by the given amount. That is, calling
+ * this method has the side effect of calling add(field,
+ * n)
, where n
is the return value.
+ *
+ *
+ * int y = cal->fieldDifference(when, Calendar::YEAR, err);
+ * int m = cal->fieldDifference(when, Calendar::MONTH, err);
+ * int d = cal->fieldDifference(when, Calendar::DATE, err);
+ *
+ * computes the difference between cal
and
+ * when
in years, months, and days.
+ *
+ * fieldDifference()
is
+ * asymmetrical. That is, in the following code:
+ *
+ *
+ * cal->setTime(date1, err);
+ * int m1 = cal->fieldDifference(date2, Calendar::MONTH, err);
+ * int d1 = cal->fieldDifference(date2, Calendar::DATE, err);
+ * cal->setTime(date2, err);
+ * int m2 = cal->fieldDifference(date1, Calendar::MONTH, err);
+ * int d2 = cal->fieldDifference(date1, Calendar::DATE, err);
+ *
+ * one might expect that m1 == -m2 && d1 == -d2
.
+ * However, this is not generally the case, because of
+ * irregularities in the underlying calendar system (e.g., the
+ * Gregorian calendar has a varying number of days per month).
+ *
+ * @param when the date to compare this calendar's time to
+ * @param field the field in which to compute the result
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid, this will be set to
+ * an error status.
+ * @return the difference, either positive or negative, between
+ * this calendar's time and when
, in terms of
+ * field
.
+ * @deprecated ICU 2.6. Use fieldDifference(UDate when, UCalendarDateFields field, UErrorCode& status).
+ */
+ virtual int32_t fieldDifference(UDate when, EDateFields field, UErrorCode& status);
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Return the difference between the given time and the time this
+ * calendar object is set to. If this calendar is set
+ * before the given time, the returned value will be
+ * positive. If this calendar is set after the given
+ * time, the returned value will be negative. The
+ * field
parameter specifies the units of the return
+ * value. For example, if fieldDifference(when,
+ * Calendar::MONTH)
returns 3, then this calendar is set to
+ * 3 months before when
, and possibly some addition
+ * time less than one month.
+ *
+ * when
by the given amount. That is, calling
+ * this method has the side effect of calling add(field,
+ * n)
, where n
is the return value.
+ *
+ *
+ * int y = cal->fieldDifference(when, Calendar::YEAR, err);
+ * int m = cal->fieldDifference(when, Calendar::MONTH, err);
+ * int d = cal->fieldDifference(when, Calendar::DATE, err);
+ *
+ * computes the difference between cal
and
+ * when
in years, months, and days.
+ *
+ * fieldDifference()
is
+ * asymmetrical. That is, in the following code:
+ *
+ *
+ * cal->setTime(date1, err);
+ * int m1 = cal->fieldDifference(date2, Calendar::MONTH, err);
+ * int d1 = cal->fieldDifference(date2, Calendar::DATE, err);
+ * cal->setTime(date2, err);
+ * int m2 = cal->fieldDifference(date1, Calendar::MONTH, err);
+ * int d2 = cal->fieldDifference(date1, Calendar::DATE, err);
+ *
+ * one might expect that m1 == -m2 && d1 == -d2
.
+ * However, this is not generally the case, because of
+ * irregularities in the underlying calendar system (e.g., the
+ * Gregorian calendar has a varying number of days per month).
+ *
+ * @param when the date to compare this calendar's time to
+ * @param field the field in which to compute the result
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid, this will be set to
+ * an error status.
+ * @return the difference, either positive or negative, between
+ * this calendar's time and when
, in terms of
+ * field
.
+ * @stable ICU 2.6.
+ */
+ virtual int32_t fieldDifference(UDate when, UCalendarDateFields field, UErrorCode& status);
+
+ /**
+ * Sets the calendar's time zone to be the one passed in. The Calendar takes ownership
+ * of the TimeZone; the caller is no longer responsible for deleting it. If the
+ * given time zone is nullptr, this function has no effect.
+ *
+ * @param value The given time zone.
+ * @stable ICU 2.0
+ */
+ void adoptTimeZone(TimeZone* value);
+
+ /**
+ * Sets the calendar's time zone to be the same as the one passed in. The TimeZone
+ * passed in is _not_ adopted; the client is still responsible for deleting it.
+ *
+ * @param zone The given time zone.
+ * @stable ICU 2.0
+ */
+ void setTimeZone(const TimeZone& zone);
+
+ /**
+ * Returns a reference to the time zone owned by this calendar. The returned reference
+ * is only valid until clients make another call to adoptTimeZone or setTimeZone,
+ * or this Calendar is destroyed.
+ *
+ * @return The time zone object associated with this calendar.
+ * @stable ICU 2.0
+ */
+ const TimeZone& getTimeZone() const;
+
+ /**
+ * Returns the time zone owned by this calendar. The caller owns the returned object
+ * and must delete it when done. After this call, the new time zone associated
+ * with this Calendar is the default TimeZone as returned by TimeZone::createDefault().
+ *
+ * @return The time zone object which was associated with this calendar.
+ * @stable ICU 2.0
+ */
+ TimeZone* orphanTimeZone();
+
+ /**
+ * Queries if the current date for this Calendar is in Daylight Savings Time.
+ *
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return True if the current date for this Calendar is in Daylight Savings Time,
+ * false, otherwise.
+ * @stable ICU 2.0
+ */
+ virtual UBool inDaylightTime(UErrorCode& status) const;
+
+ /**
+ * Specifies whether or not date/time interpretation is to be lenient. With lenient
+ * interpretation, a date such as "February 942, 1996" will be treated as being
+ * equivalent to the 941st day after February 1, 1996. With strict interpretation,
+ * such dates will cause an error when computing time from the time field values
+ * representing the dates.
+ *
+ * @param lenient True specifies date/time interpretation to be lenient.
+ *
+ * @see DateFormat#setLenient
+ * @stable ICU 2.0
+ */
+ void setLenient(UBool lenient);
+
+ /**
+ * Tells whether date/time interpretation is to be lenient.
+ *
+ * @return True tells that date/time interpretation is to be lenient.
+ * @stable ICU 2.0
+ */
+ UBool isLenient() const;
+
+ /**
+ * Sets the behavior for handling wall time repeating multiple times
+ * at negative time zone offset transitions. For example, 1:30 AM on
+ * November 6, 2011 in US Eastern time (America/New_York) occurs twice;
+ * 1:30 AM EDT, then 1:30 AM EST one hour later. When UCAL_WALLTIME_FIRST
+ * is used, the wall time 1:30AM in this example will be interpreted as 1:30 AM EDT
+ * (first occurrence). When UCAL_WALLTIME_LAST
is used, it will be
+ * interpreted as 1:30 AM EST (last occurrence). The default value is
+ * UCAL_WALLTIME_LAST
.
+ * UCAL_WALLTIME_NEXT_VALID
is not a valid
+ * option for this. When the argument is neither UCAL_WALLTIME_FIRST
+ * nor UCAL_WALLTIME_LAST
, this method has no effect and will keep
+ * the current setting.
+ *
+ * @param option the behavior for handling repeating wall time, either
+ * UCAL_WALLTIME_FIRST
or UCAL_WALLTIME_LAST
.
+ * @see #getRepeatedWallTimeOption
+ * @stable ICU 49
+ */
+ void setRepeatedWallTimeOption(UCalendarWallTimeOption option);
+
+ /**
+ * Gets the behavior for handling wall time repeating multiple times
+ * at negative time zone offset transitions.
+ *
+ * @return the behavior for handling repeating wall time, either
+ * UCAL_WALLTIME_FIRST
or UCAL_WALLTIME_LAST
.
+ * @see #setRepeatedWallTimeOption
+ * @stable ICU 49
+ */
+ UCalendarWallTimeOption getRepeatedWallTimeOption() const;
+
+ /**
+ * Sets the behavior for handling skipped wall time at positive time zone offset
+ * transitions. For example, 2:30 AM on March 13, 2011 in US Eastern time (America/New_York)
+ * does not exist because the wall time jump from 1:59 AM EST to 3:00 AM EDT. When
+ * UCAL_WALLTIME_FIRST
is used, 2:30 AM is interpreted as 30 minutes before 3:00 AM
+ * EDT, therefore, it will be resolved as 1:30 AM EST. When UCAL_WALLTIME_LAST
+ * is used, 2:30 AM is interpreted as 31 minutes after 1:59 AM EST, therefore, it will be
+ * resolved as 3:30 AM EDT. When UCAL_WALLTIME_NEXT_VALID
is used, 2:30 AM will
+ * be resolved as next valid wall time, that is 3:00 AM EDT. The default value is
+ * UCAL_WALLTIME_LAST
.
+ * UCAL_WALLTIME_FIRST
, UCAL_WALLTIME_LAST
and
+ * UCAL_WALLTIME_NEXT_VALID
.
+ * @see #getSkippedWallTimeOption
+ *
+ * @stable ICU 49
+ */
+ void setSkippedWallTimeOption(UCalendarWallTimeOption option);
+
+ /**
+ * Gets the behavior for handling skipped wall time at positive time zone offset
+ * transitions.
+ *
+ * @return the behavior for handling skipped wall time, one of
+ * UCAL_WALLTIME_FIRST
, UCAL_WALLTIME_LAST
+ * and UCAL_WALLTIME_NEXT_VALID
.
+ * @see #setSkippedWallTimeOption
+ * @stable ICU 49
+ */
+ UCalendarWallTimeOption getSkippedWallTimeOption() const;
+
+ /**
+ * Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
+ *
+ * @param value The given first day of the week.
+ * @stable ICU 2.6.
+ */
+ void setFirstDayOfWeek(UCalendarDaysOfWeek value);
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
+ *
+ * @return The first day of the week.
+ * @deprecated ICU 2.6 use the overload with error code
+ */
+ EDaysOfWeek getFirstDayOfWeek() const;
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
+ *
+ * @param status error code
+ * @return The first day of the week.
+ * @stable ICU 2.6
+ */
+ UCalendarDaysOfWeek getFirstDayOfWeek(UErrorCode &status) const;
+
+ /**
+ * Sets what the minimal days required in the first week of the year are; For
+ * example, if the first week is defined as one that contains the first day of the
+ * first month of a year, call the method with value 1. If it must be a full week,
+ * use value 7.
+ *
+ * @param value The given minimal days required in the first week of the year.
+ * @stable ICU 2.0
+ */
+ void setMinimalDaysInFirstWeek(uint8_t value);
+
+ /**
+ * Gets what the minimal days required in the first week of the year are; e.g., if
+ * the first week is defined as one that contains the first day of the first month
+ * of a year, getMinimalDaysInFirstWeek returns 1. If the minimal days required must
+ * be a full week, getMinimalDaysInFirstWeek returns 7.
+ *
+ * @return The minimal days required in the first week of the year.
+ * @stable ICU 2.0
+ */
+ uint8_t getMinimalDaysInFirstWeek() const;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Gets the minimum value for the given time field. e.g., for Gregorian
+ * DAY_OF_MONTH, 1.
+ *
+ * @param field The given time field.
+ * @return The minimum value for the given time field.
+ * @deprecated ICU 2.6. Use getMinimum(UCalendarDateFields field) instead.
+ */
+ virtual int32_t getMinimum(EDateFields field) const;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Gets the minimum value for the given time field. e.g., for Gregorian
+ * DAY_OF_MONTH, 1.
+ *
+ * @param field The given time field.
+ * @return The minimum value for the given time field.
+ * @stable ICU 2.6.
+ */
+ virtual int32_t getMinimum(UCalendarDateFields field) const;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Gets the maximum value for the given time field. e.g. for Gregorian DAY_OF_MONTH,
+ * 31.
+ *
+ * @param field The given time field.
+ * @return The maximum value for the given time field.
+ * @deprecated ICU 2.6. Use getMaximum(UCalendarDateFields field) instead.
+ */
+ virtual int32_t getMaximum(EDateFields field) const;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Gets the maximum value for the given time field. e.g. for Gregorian DAY_OF_MONTH,
+ * 31.
+ *
+ * @param field The given time field.
+ * @return The maximum value for the given time field.
+ * @stable ICU 2.6.
+ */
+ virtual int32_t getMaximum(UCalendarDateFields field) const;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Gets the highest minimum value for the given field if varies. Otherwise same as
+ * getMinimum(). For Gregorian, no difference.
+ *
+ * @param field The given time field.
+ * @return The highest minimum value for the given time field.
+ * @deprecated ICU 2.6. Use getGreatestMinimum(UCalendarDateFields field) instead.
+ */
+ virtual int32_t getGreatestMinimum(EDateFields field) const;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Gets the highest minimum value for the given field if varies. Otherwise same as
+ * getMinimum(). For Gregorian, no difference.
+ *
+ * @param field The given time field.
+ * @return The highest minimum value for the given time field.
+ * @stable ICU 2.6.
+ */
+ virtual int32_t getGreatestMinimum(UCalendarDateFields field) const;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Gets the lowest maximum value for the given field if varies. Otherwise same as
+ * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28.
+ *
+ * @param field The given time field.
+ * @return The lowest maximum value for the given time field.
+ * @deprecated ICU 2.6. Use getLeastMaximum(UCalendarDateFields field) instead.
+ */
+ virtual int32_t getLeastMaximum(EDateFields field) const;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Gets the lowest maximum value for the given field if varies. Otherwise same as
+ * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28.
+ *
+ * @param field The given time field.
+ * @return The lowest maximum value for the given time field.
+ * @stable ICU 2.6.
+ */
+ virtual int32_t getLeastMaximum(UCalendarDateFields field) const;
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Return the minimum value that this field could have, given the current date.
+ * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
+ *
+ * The version of this function on Calendar uses an iterative algorithm to determine the
+ * actual minimum value for the field. There is almost always a more efficient way to
+ * accomplish this (in most cases, you can simply return getMinimum()). GregorianCalendar
+ * overrides this function with a more efficient implementation.
+ *
+ * @param field the field to determine the minimum of
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return the minimum of the given field for the current date of this Calendar
+ * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field, UErrorCode& status) instead.
+ */
+ int32_t getActualMinimum(EDateFields field, UErrorCode& status) const;
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Return the minimum value that this field could have, given the current date.
+ * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
+ *
+ * The version of this function on Calendar uses an iterative algorithm to determine the
+ * actual minimum value for the field. There is almost always a more efficient way to
+ * accomplish this (in most cases, you can simply return getMinimum()). GregorianCalendar
+ * overrides this function with a more efficient implementation.
+ *
+ * @param field the field to determine the minimum of
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return the minimum of the given field for the current date of this Calendar
+ * @stable ICU 2.6.
+ */
+ virtual int32_t getActualMinimum(UCalendarDateFields field, UErrorCode& status) const;
+
+ /**
+ * Return the maximum value that this field could have, given the current date.
+ * For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual
+ * maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar,
+ * for some years the actual maximum for MONTH is 12, and for others 13.
+ *
+ * The version of this function on Calendar uses an iterative algorithm to determine the
+ * actual maximum value for the field. There is almost always a more efficient way to
+ * accomplish this (in most cases, you can simply return getMaximum()). GregorianCalendar
+ * overrides this function with a more efficient implementation.
+ *
+ * @param field the field to determine the maximum of
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return the maximum of the given field for the current date of this Calendar
+ * @stable ICU 2.6.
+ */
+ virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const;
+
+ /**
+ * Gets the value for a given time field. Recalculate the current time field values
+ * if the time value has been changed by a call to setTime(). Return zero for unset
+ * fields if any fields have been explicitly set by a call to set(). To force a
+ * recomputation of all fields regardless of the previous state, call complete().
+ * This method is semantically const, but may alter the object in memory.
+ *
+ * @param field The given time field.
+ * @param status Fill-in parameter which receives the status of the operation.
+ * @return The value for the given time field, or zero if the field is unset,
+ * and set() has been called for any other field.
+ * @stable ICU 2.6.
+ */
+ int32_t get(UCalendarDateFields field, UErrorCode& status) const;
+
+ /**
+ * Determines if the given time field has a value set. This can affect in the
+ * resolving of time in Calendar. Unset fields have a value of zero, by definition.
+ *
+ * @param field The given time field.
+ * @return True if the given time field has a value set; false otherwise.
+ * @stable ICU 2.6.
+ */
+ UBool isSet(UCalendarDateFields field) const;
+
+ /**
+ * Sets the given time field with the given value.
+ *
+ * @param field The given time field.
+ * @param value The value to be set for the given time field.
+ * @stable ICU 2.6.
+ */
+ void set(UCalendarDateFields field, int32_t value);
+
+ /**
+ * Sets the values for the fields YEAR, MONTH, and DATE. Other field values are
+ * retained; call clear() first if this is not desired.
+ *
+ * @param year The value used to set the YEAR time field.
+ * @param month The value used to set the MONTH time field. Month value is 0-based.
+ * e.g., 0 for January.
+ * @param date The value used to set the DATE time field.
+ * @stable ICU 2.0
+ */
+ void set(int32_t year, int32_t month, int32_t date);
+
+ /**
+ * Sets the values for the fields YEAR, MONTH, DATE, HOUR_OF_DAY, and MINUTE. Other
+ * field values are retained; call clear() first if this is not desired.
+ *
+ * @param year The value used to set the YEAR time field.
+ * @param month The value used to set the MONTH time field. Month value is
+ * 0-based. E.g., 0 for January.
+ * @param date The value used to set the DATE time field.
+ * @param hour The value used to set the HOUR_OF_DAY time field.
+ * @param minute The value used to set the MINUTE time field.
+ * @stable ICU 2.0
+ */
+ void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
+
+ /**
+ * Sets the values for the fields YEAR, MONTH, DATE, HOUR_OF_DAY, MINUTE, and SECOND.
+ * Other field values are retained; call clear() first if this is not desired.
+ *
+ * @param year The value used to set the YEAR time field.
+ * @param month The value used to set the MONTH time field. Month value is
+ * 0-based. E.g., 0 for January.
+ * @param date The value used to set the DATE time field.
+ * @param hour The value used to set the HOUR_OF_DAY time field.
+ * @param minute The value used to set the MINUTE time field.
+ * @param second The value used to set the SECOND time field.
+ * @stable ICU 2.0
+ */
+ void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
+
+ /**
+ * Clears the values of all the time fields, making them both unset and assigning
+ * them a value of zero. The field values will be determined during the next
+ * resolving of time into time fields.
+ * @stable ICU 2.0
+ */
+ void clear();
+
+ /**
+ * Clears the value in the given time field, both making it unset and assigning it a
+ * value of zero. This field value will be determined during the next resolving of
+ * time into time fields. Clearing UCAL_ORDINAL_MONTH or UCAL_MONTH will
+ * clear both fields.
+ *
+ * @param field The time field to be cleared.
+ * @stable ICU 2.6.
+ */
+ void clear(UCalendarDateFields field);
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual method. This method is to
+ * implement a simple version of RTTI, since not all C++ compilers support genuine
+ * RTTI. Polymorphic operator==() and clone() methods call this method.
+ * UCAL_ERA
+ * UCAL_YEAR
+ * UCAL_MONTH
+ * UCAL_WEEK_OF_YEAR
+ * UCAL_WEEK_OF_MONTH
+ * UCAL_DATE (DAY_OF_MONTH on Java)
+ * UCAL_DAY_OF_YEAR
+ * UCAL_DAY_OF_WEEK_IN_MONTH
+ * UCAL_YEAR_WOY
+ * UCAL_EXTENDED_YEAR
+ *
+ * @param field one of the above field numbers
+ * @param limitType one of MINIMUM
, GREATEST_MINIMUM
,
+ * LEAST_MAXIMUM
, or MAXIMUM
+ * @internal
+ */
+ virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const = 0;
+
+ /**
+ * Return a limit for a field.
+ * @param field the field, from 0..UCAL_MAX_FIELD
+ * @param limitType the type specifier for the limit
+ * @see #ELimitType
+ * @internal
+ */
+ virtual int32_t getLimit(UCalendarDateFields field, ELimitType limitType) const;
+
+ /**
+ * Return the Julian day number of day before the first day of the
+ * given month in the given extended year. Subclasses should override
+ * this method to implement their calendar system.
+ * @param eyear the extended year
+ * @param month the zero-based month, or 0 if useMonth is false
+ * @param useMonth if false, compute the day before the first day of
+ * the given year, otherwise, compute the day before the first day of
+ * the given month
+ * @param status Output param set to failure code on function return
+ * when this function fails.
+ * @return the Julian day number of the day before the first
+ * day of the given month and year
+ * @internal
+ */
+ virtual int64_t handleComputeMonthStart(int32_t eyear, int32_t month,
+ UBool useMonth, UErrorCode& status) const = 0;
+
+ /**
+ * Return the number of days in the given month of the given extended
+ * year of this calendar system. Subclasses should override this
+ * method if they can provide a more correct or more efficient
+ * implementation than the default implementation in Calendar.
+ * @internal
+ */
+ virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month, UErrorCode& status) const ;
+
+ /**
+ * Return the number of days in the given extended year of this
+ * calendar system. Subclasses should override this method if they can
+ * provide a more correct or more efficient implementation than the
+ * default implementation in Calendar.
+ * @internal
+ */
+ virtual int32_t handleGetYearLength(int32_t eyear, UErrorCode& status) const;
+
+ /**
+ * Return the extended year defined by the current fields. This will
+ * use the UCAL_EXTENDED_YEAR field or the UCAL_YEAR and supra-year fields (such
+ * as UCAL_ERA) specific to the calendar system, depending on which set of
+ * fields is newer.
+ * @param status ICU Error Code
+ * @return the extended year
+ * @internal
+ */
+ virtual int32_t handleGetExtendedYear(UErrorCode& status) = 0;
+
+ /**
+ * Subclasses may override this. This method calls
+ * handleGetMonthLength() to obtain the calendar-specific month
+ * length.
+ * @param bestField which field to use to calculate the date
+ * @param status ICU Error Code
+ * @return julian day specified by calendar fields.
+ * @internal
+ */
+ virtual int32_t handleComputeJulianDay(UCalendarDateFields bestField, UErrorCode &status);
+
+ /**
+ * Subclasses must override this to convert from week fields
+ * (YEAR_WOY and WEEK_OF_YEAR) to an extended year in the case
+ * where YEAR, EXTENDED_YEAR are not set.
+ * The Calendar implementation assumes yearWoy is in extended gregorian form
+ * @return the extended year, UCAL_EXTENDED_YEAR
+ * @internal
+ */
+ virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy, UErrorCode& status);
+
+ /**
+ * Validate a single field of this calendar. Subclasses should
+ * override this method to validate any calendar-specific fields.
+ * Generic fields can be handled by `Calendar::validateField()`.
+ * @internal
+ */
+ virtual void validateField(UCalendarDateFields field, UErrorCode &status);
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Compute the Julian day from fields. Will determine whether to use
+ * the JULIAN_DAY field directly, or other fields.
+ * @param status ICU Error Code
+ * @return the julian day
+ * @internal
+ */
+ int32_t computeJulianDay(UErrorCode &status);
+
+ /**
+ * Compute the milliseconds in the day from the fields. This is a
+ * value from 0 to 23:59:59.999 inclusive, unless fields are out of
+ * range, in which case it can be an arbitrary value. This value
+ * reflects local zone wall time.
+ * @internal
+ */
+ double computeMillisInDay();
+
+ /**
+ * This method can assume EXTENDED_YEAR has been set.
+ * @param millis milliseconds of the date fields
+ * @param millisInDay milliseconds of the time fields; may be out
+ * or range.
+ * @param ec Output param set to failure code on function return
+ * when this function fails.
+ * @internal
+ */
+ int32_t computeZoneOffset(double millis, double millisInDay, UErrorCode &ec);
+
+
+ /**
+ * Determine the best stamp in a range.
+ * @param start first enum to look at
+ * @param end last enum to look at
+ * @param bestSoFar stamp prior to function call
+ * @return the stamp value of the best stamp
+ * @internal
+ */
+ int32_t newestStamp(UCalendarDateFields start, UCalendarDateFields end, int32_t bestSoFar) const;
+
+ /**
+ * Marker for end of resolve set (row or group). Value for field resolution tables.
+ *
+ * @see #resolveFields
+ * @internal
+ */
+ static constexpr int32_t kResolveSTOP = -1;
+ /**
+ * Value to be bitwised "ORed" against resolve table field values for remapping.
+ * Example: (UCAL_DATE | kResolveRemap) in 1st column will cause 'UCAL_DATE' to be returned,
+ * but will not examine the value of UCAL_DATE.
+ * Value for field resolution tables.
+ *
+ * @see #resolveFields
+ * @internal
+ */
+ static constexpr int32_t kResolveRemap = 32;
+
+ /**
+ * Precedence table for Dates
+ * @see #resolveFields
+ * @internal
+ */
+ static const UFieldResolutionTable kDatePrecedence[];
+
+ /**
+ * Precedence table for Year
+ * @see #resolveFields
+ * @internal
+ */
+ static const UFieldResolutionTable kYearPrecedence[];
+
+ /**
+ * Precedence table for Day of Week
+ * @see #resolveFields
+ * @internal
+ */
+ static const UFieldResolutionTable kDOWPrecedence[];
+
+ /**
+ * Precedence table for Months
+ * @see #resolveFields
+ * @internal
+ */
+ static const UFieldResolutionTable kMonthPrecedence[];
+
+ /**
+ * Given a precedence table, return the newest field combination in
+ * the table, or UCAL_FIELD_COUNT if none is found.
+ *
+ * kResolveRemap | F
at
+ * the start of the line, where F
is the desired return
+ * field value. This field will NOT be examined; it only determines
+ * the return value if the other fields in the line are the newest.
+ *
+ *
+ *
+ * Subclasses can refer to the DAY_OF_WEEK and DOW_LOCAL fields, which
+ * will be set when this method is called. Subclasses can also call
+ * the getGregorianXxx() methods to obtain Gregorian calendar
+ * equivalents for the given Julian day.
+ *
+ * Calendar
implements
+ * a pure proleptic Gregorian calendar.
+ * @internal
+ */
+ virtual void handleComputeFields(int32_t julianDay, UErrorCode &status);
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Return the extended year on the Gregorian calendar as computed by
+ * computeGregorianFields()
.
+ * @internal
+ */
+ int32_t getGregorianYear() const {
+ return fGregorianYear;
+ }
+
+ /**
+ * Return the month (0-based) on the Gregorian calendar as computed by
+ * computeGregorianFields()
.
+ * @internal
+ */
+ int32_t getGregorianMonth() const {
+ return fGregorianMonth;
+ }
+
+ /**
+ * Return the day of year (1-based) on the Gregorian calendar as
+ * computed by computeGregorianFields()
.
+ * @internal
+ */
+ int32_t getGregorianDayOfYear() const {
+ return fGregorianDayOfYear;
+ }
+
+ /**
+ * Return the day of month (1-based) on the Gregorian calendar as
+ * computed by computeGregorianFields()
.
+ * @internal
+ */
+ int32_t getGregorianDayOfMonth() const {
+ return fGregorianDayOfMonth;
+ }
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Called by computeJulianDay. Returns the default month (0-based) for the year,
+ * taking year and era into account. Defaults to 0 for Gregorian, which doesn't care.
+ * @param eyear The extended year
+ * @param status Output param set to failure code on function return
+ * when this function fails.
+ * @internal
+ */
+ virtual int32_t getDefaultMonthInYear(int32_t eyear, UErrorCode& status);
+
+
+ /**
+ * Called by computeJulianDay. Returns the default day (1-based) for the month,
+ * taking currently-set year and era into account. Defaults to 1 for Gregorian.
+ * @param eyear the extended year
+ * @param month the month in the year
+ * @param status Output param set to failure code on function return
+ * when this function fails.
+ * @internal
+ */
+ virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month, UErrorCode& status);
+
+ //-------------------------------------------------------------------------
+ // Protected utility methods for use by subclasses. These are very handy
+ // for implementing add, roll, and computeFields.
+ //-------------------------------------------------------------------------
+
+ /**
+ * Adjust the specified field so that it is within
+ * the allowable range for the date to which this calendar is set.
+ * For example, in a Gregorian calendar pinning the {@link #UCalendarDateFields DAY_OF_MONTH}
+ * field for a calendar set to April 31 would cause it to be set
+ * to April 30.
+ *
+ * This utility method is intended for use by subclasses that need to implement
+ * their own overrides of {@link #roll roll} and {@link #add add}.
+ * pinField
is implemented in terms of
+ * {@link #getActualMinimum getActualMinimum}
+ * and {@link #getActualMaximum getActualMaximum}. If either of those methods uses
+ * a slow, iterative algorithm for a particular field, it would be
+ * unwise to attempt to call pinField
for that field. If you
+ * really do need to do so, you should override this method to do
+ * something more efficient for that field.
+ *
+ * This method is intended for use by subclasses in implementing their
+ * {@link #computeTime computeTime} and/or {@link #computeFields computeFields} methods.
+ * It is often useful in {@link #getActualMinimum getActualMinimum} and
+ * {@link #getActualMaximum getActualMaximum} as well.
+ * knownDayOfWeek
parameter.
+ * Should be 1 for first day of period.
+ *
+ * @param dayOfWeek The {@link #UCalendarDateFields DAY_OF_WEEK} for the day
+ * corresponding to the knownDayOfPeriod
parameter.
+ * 1-based with 1=Sunday.
+ *
+ * @return The week number (one-based), or zero if the day falls before
+ * the first week because
+ * {@link #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek}
+ * is more than one.
+ *
+ * @stable ICU 2.8
+ */
+ int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
+
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Return the week number of a day, within a period. This may be the week number in
+ * a year, or the week number in a month. Usually this will be a value >= 1, but if
+ * some initial days of the period are excluded from week 1, because
+ * {@link #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek} is > 1,
+ * then the week number will be zero for those
+ * initial days. This method requires the day of week for the given date in order to
+ * determine the result.
+ *
+ * This method is intended for use by subclasses in implementing their
+ * {@link #computeTime computeTime} and/or {@link #computeFields computeFields} methods.
+ * It is often useful in {@link #getActualMinimum getActualMinimum} and
+ * {@link #getActualMaximum getActualMaximum} as well.
+ * dayOfPeriod
parameter.
+ * 1-based with 1=Sunday.
+ *
+ * @return The week number (one-based), or zero if the day falls before
+ * the first week because
+ * {@link #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek}
+ * is more than one.
+ * @internal
+ */
+ inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
+
+ /**
+ * returns the local DOW, valid range 0..6
+ * @internal
+ */
+ int32_t getLocalDOW(UErrorCode& status);
+#endif /* U_HIDE_INTERNAL_API */
+
+private:
+
+ /**
+ * The next available value for fStamp[]
+ */
+ int8_t fNextStamp = kMinimumUserStamp;
+
+ /**
+ * Recalculates the time stamp array (fStamp).
+ * Resets fNextStamp to lowest next stamp value.
+ */
+ void recalculateStamp();
+
+ /**
+ * The current time set for the calendar.
+ */
+ UDate fTime = 0;
+
+ /**
+ * Time zone affects the time calculation done by Calendar. Calendar subclasses use
+ * the time zone data to produce the local time. Always set; never nullptr.
+ */
+ TimeZone* fZone = nullptr;
+
+ /**
+ * The flag which indicates if the current time is set in the calendar.
+ */
+ bool fIsTimeSet:1;
+
+ /**
+ * True if the fields are in sync with the currently set time of this Calendar.
+ * If false, then the next attempt to get the value of a field will
+ * force a recomputation of all fields from the current value of the time
+ * field.
+ * U_ILLEGAL_ARGUMENT_ERROR
will be set. Subclasses may
+ * use this method in their implementation of {@link
+ * #validateField(int, int&)}.
+ */
+ void validateField(UCalendarDateFields field, int32_t min, int32_t max, UErrorCode& status);
+
+ protected:
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Convert a quasi Julian date to the day of the week. The Julian date used here is
+ * not a true Julian date, since it is measured from midnight, not noon. Return
+ * value is one-based.
+ *
+ * @param julian The given Julian date number.
+ * @return Day number from 1..7 (SUN..SAT).
+ * @internal
+ */
+ static uint8_t julianDayToDayOfWeek(int32_t julian);
+#endif /* U_HIDE_INTERNAL_API */
+
+ private:
+ CharString* validLocale = nullptr;
+ CharString* actualLocale = nullptr;
+
+ public:
+#if !UCONFIG_NO_SERVICE
+ /**
+ * INTERNAL FOR 2.6 -- Registration.
+ */
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Return a StringEnumeration over the locales available at the time of the call,
+ * including registered locales.
+ * @return a StringEnumeration over the locales available at the time of the call
+ * @internal
+ */
+ static StringEnumeration* getAvailableLocales();
+
+ /**
+ * Register a new Calendar factory. The factory will be adopted.
+ * INTERNAL in 2.6
+ *
+ * Because ICU may choose to cache Calendars internally, this must
+ * be called at application startup, prior to any calls to
+ * Calendar::createInstance to avoid undefined behavior.
+ *
+ * @param toAdopt the factory instance to be adopted
+ * @param status the in/out status code, no special meanings are assigned
+ * @return a registry key that can be used to unregister this factory
+ * @internal
+ */
+ static URegistryKey registerFactory(ICUServiceFactory* toAdopt, UErrorCode& status);
+
+ /**
+ * Unregister a previously-registered CalendarFactory using the key returned from the
+ * register call. Key becomes invalid after a successful call and should not be used again.
+ * The CalendarFactory corresponding to the key will be deleted.
+ * INTERNAL in 2.6
+ *
+ * Because ICU may choose to cache Calendars internally, this should
+ * be called during application shutdown, after all calls to
+ * Calendar::createInstance to avoid undefined behavior.
+ *
+ * @param key the registry key returned by a previous call to registerFactory
+ * @param status the in/out status code, no special meanings are assigned
+ * @return true if the factory for the key was successfully unregistered
+ * @internal
+ */
+ static UBool unregister(URegistryKey key, UErrorCode& status);
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Multiple Calendar Implementation
+ * @internal
+ */
+ friend class CalendarFactory;
+
+ /**
+ * Multiple Calendar Implementation
+ * @internal
+ */
+ friend class CalendarService;
+
+ /**
+ * Multiple Calendar Implementation
+ * @internal
+ */
+ friend class DefaultCalendarFactory;
+#endif /* !UCONFIG_NO_SERVICE */
+
+ /**
+ * @return true if this calendar has a default century (i.e. 03 -> 2003)
+ * @internal
+ */
+ virtual UBool haveDefaultCentury() const = 0;
+
+ /**
+ * @return the start of the default century, as a UDate
+ * @internal
+ */
+ virtual UDate defaultCenturyStart() const = 0;
+ /**
+ * @return the beginning year of the default century, as a year
+ * @internal
+ */
+ virtual int32_t defaultCenturyStartYear() const = 0;
+
+ /** Get the locale for this calendar object. You can choose between valid and actual locale.
+ * @param type type of the locale we're looking for (valid or actual)
+ * @param status error code for the operation
+ * @return the locale
+ * @stable ICU 2.8
+ */
+ Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const;
+
+ /**
+ * @return The related Gregorian year; will be obtained by modifying the value
+ * obtained by get from UCAL_EXTENDED_YEAR field
+ * @internal
+ */
+ virtual int32_t getRelatedYear(UErrorCode &status) const;
+
+ /**
+ * @param year The related Gregorian year to set; will be modified as necessary then
+ * set in UCAL_EXTENDED_YEAR field
+ * @internal
+ */
+ virtual void setRelatedYear(int32_t year);
+
+#ifndef U_HIDE_INTERNAL_API
+ /** Get the locale for this calendar object. You can choose between valid and actual locale.
+ * @param type type of the locale we're looking for (valid or actual)
+ * @param status error code for the operation
+ * @return the locale
+ * @internal
+ */
+ const char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
+#endif /* U_HIDE_INTERNAL_API */
+
+private:
+ /**
+ * Cast TimeZone used by this object to BasicTimeZone, or nullptr if the TimeZone
+ * is not an instance of BasicTimeZone.
+ */
+ BasicTimeZone* getBasicTimeZone() const;
+
+ /**
+ * Find the previous zone transition near the given time.
+ * @param base The base time, inclusive
+ * @param transitionTime Receives the result time
+ * @param status The error status
+ * @return true if a transition is found.
+ */
+ UBool getImmediatePreviousZoneTransition(UDate base, UDate *transitionTime, UErrorCode& status) const;
+
+public:
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Creates a new Calendar from a Locale for the cache.
+ * This method does not set the time or timezone in returned calendar.
+ * @param locale the locale.
+ * @param status any error returned here.
+ * @return the new Calendar object with no time or timezone set.
+ * @internal For ICU use only.
+ */
+ static Calendar * U_EXPORT2 makeInstance(
+ const Locale &locale, UErrorCode &status);
+
+ /**
+ * Get the calendar type for given locale.
+ * @param locale the locale
+ * @param typeBuffer calendar type returned here
+ * @param typeBufferSize The size of typeBuffer in bytes. If the type
+ * can't fit in the buffer, this method sets status to
+ * U_BUFFER_OVERFLOW_ERROR
+ * @param status error, if any, returned here.
+ * @internal For ICU use only.
+ */
+ static void U_EXPORT2 getCalendarTypeFromLocale(
+ const Locale &locale,
+ char *typeBuffer,
+ int32_t typeBufferSize,
+ UErrorCode &status);
+#endif /* U_HIDE_INTERNAL_API */
+};
+
+// -------------------------------------
+
+inline Calendar*
+Calendar::createInstance(TimeZone* zone, UErrorCode& errorCode)
+{
+ // since the Locale isn't specified, use the default locale
+ return createInstance(zone, Locale::getDefault(), errorCode);
+}
+
+// -------------------------------------
+
+inline void
+Calendar::roll(UCalendarDateFields field, UBool up, UErrorCode& status)
+{
+ roll(field, static_cast
Note: the code is intended for use with small strings, and is not suitable for larger ones,
+ * since it has not been optimized for that situation.
+ * Note, CanonicalIterator is not intended to be subclassed.
+ * @author M. Davis
+ * @author C++ port by V. Weinstein
+ * @stable ICU 2.4
+ */
+class U_COMMON_API CanonicalIterator final : public UObject {
+public:
+ /**
+ * Construct a CanonicalIterator object
+ * @param source string to get results for
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @stable ICU 2.4
+ */
+ CanonicalIterator(const UnicodeString &source, UErrorCode &status);
+
+ /** Destructor
+ * Cleans pieces
+ * @stable ICU 2.4
+ */
+ virtual ~CanonicalIterator();
+
+ /**
+ * Gets the NFD form of the current source we are iterating over.
+ * @return gets the source: NOTE: it is the NFD form of source
+ * @stable ICU 2.4
+ */
+ UnicodeString getSource();
+
+ /**
+ * Resets the iterator so that one can start again from the beginning.
+ * @stable ICU 2.4
+ */
+ void reset();
+
+ /**
+ * Get the next canonically equivalent string.
+ *
Warning: The strings are not guaranteed to be in any particular order.
+ * @return the next string that is canonically equivalent. A bogus string is returned when
+ * the iteration is done.
+ * @stable ICU 2.4
+ */
+ UnicodeString next();
+
+ /**
+ * Set a new source for this iterator. Allows object reuse.
+ * @param newSource the source string to iterate against. This allows the same iterator to be used
+ * while changing the source string, saving object creation.
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @stable ICU 2.4
+ */
+ void setSource(const UnicodeString &newSource, UErrorCode &status);
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Dumb recursive implementation of permutation.
+ * TODO: optimize
+ * @param source the string to find permutations for
+ * @param skipZeros determine if skip zeros
+ * @param result the results in a set.
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @param depth depth of the call.
+ * @internal
+ */
+ static void U_EXPORT2 permute(UnicodeString &source, UBool skipZeros, Hashtable *result, UErrorCode &status, int32_t depth=0);
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for this class.
+ *
+ * @stable ICU 2.2
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for the actual class.
+ *
+ * @stable ICU 2.2
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+private:
+ // ===================== PRIVATES ==============================
+ // private default constructor
+ CanonicalIterator() = delete;
+
+
+ /**
+ * Copy constructor. Private for now.
+ * @internal (private)
+ */
+ CanonicalIterator(const CanonicalIterator& other) = delete;
+
+ /**
+ * Assignment operator. Private for now.
+ * @internal (private)
+ */
+ CanonicalIterator& operator=(const CanonicalIterator& other) = delete;
+
+ // fields
+ UnicodeString source;
+ UBool done;
+
+ // 2 dimensional array holds the pieces of the string with
+ // their different canonically equivalent representations
+ UnicodeString **pieces;
+ int32_t pieces_length;
+ int32_t *pieces_lengths;
+
+ // current is used in iterating to combine pieces
+ int32_t *current;
+ int32_t current_length;
+
+ // transient fields
+ UnicodeString buffer;
+
+ const Normalizer2 *nfd;
+ const Normalizer2Impl *nfcImpl;
+
+ // we have a segment, in NFD. Find all the strings that are canonically equivalent to it.
+ UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &result_len, UErrorCode &status); //private String[] getEquivalents(String segment)
+
+ //Set getEquivalents2(String segment);
+ Hashtable *getEquivalents2(Hashtable *fillinResult, const char16_t *segment, int32_t segLen, UErrorCode &status);
+ //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segLen, UErrorCode &status);
+
+ /**
+ * See if the decomposition of cp2 is at segment starting at segmentPos
+ * (with canonical rearrangement!)
+ * If so, take the remainder, and return the equivalents
+ */
+ //Set extract(int comp, String segment, int segmentPos, StringBuffer buffer);
+ Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const char16_t *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
+ //Hashtable *extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
+
+ void cleanPieces();
+
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_NORMALIZATION */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/casemap.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/casemap.h
new file mode 100644
index 0000000000..eca7cbf80a
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/casemap.h
@@ -0,0 +1,497 @@
+// © 2017 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+// casemap.h
+// created: 2017jan12 Markus W. Scherer
+
+#ifndef __CASEMAP_H__
+#define __CASEMAP_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#include "unicode/stringpiece.h"
+#include "unicode/uobject.h"
+
+/**
+ * \file
+ * \brief C++ API: Low-level C++ case mapping functions.
+ */
+
+U_NAMESPACE_BEGIN
+
+class BreakIterator;
+class ByteSink;
+class Edits;
+
+/**
+ * Low-level C++ case mapping functions.
+ *
+ * @stable ICU 59
+ */
+class U_COMMON_API CaseMap final : public UMemory {
+public:
+ /**
+ * Lowercases a UTF-16 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see u_strToLower
+ * @stable ICU 59
+ */
+ static int32_t toLower(
+ const char *locale, uint32_t options,
+ const char16_t *src, int32_t srcLength,
+ char16_t *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+ /**
+ * Uppercases a UTF-16 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see u_strToUpper
+ * @stable ICU 59
+ */
+ static int32_t toUpper(
+ const char *locale, uint32_t options,
+ const char16_t *src, int32_t srcLength,
+ char16_t *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+#if !UCONFIG_NO_BREAK_ITERATION
+
+ /**
+ * Titlecases a UTF-16 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * Titlecasing uses a break iterator to find the first characters of words
+ * that are to be titlecased. It titlecases those characters and lowercases
+ * all others. (This can be modified with options bits.)
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET,
+ * U_TITLECASE_NO_LOWERCASE,
+ * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED,
+ * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES.
+ * @param iter A break iterator to find the first characters of words that are to be titlecased.
+ * It is set to the source string (setText())
+ * and used one or more times for iteration (first() and next()).
+ * If nullptr, then a word break iterator for the locale is used
+ * (or something equivalent).
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see u_strToTitle
+ * @see ucasemap_toTitle
+ * @stable ICU 59
+ */
+ static int32_t toTitle(
+ const char *locale, uint32_t options, BreakIterator *iter,
+ const char16_t *src, int32_t srcLength,
+ char16_t *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+#endif // UCONFIG_NO_BREAK_ITERATION
+
+ /**
+ * Case-folds a UTF-16 string and optionally records edits.
+ *
+ * Case folding is locale-independent and not context-sensitive,
+ * but there is an option for whether to include or exclude mappings for dotted I
+ * and dotless i that are marked with 'T' in CaseFolding.txt.
+ *
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET,
+ * U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I.
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see u_strFoldCase
+ * @stable ICU 59
+ */
+ static int32_t fold(
+ uint32_t options,
+ const char16_t *src, int32_t srcLength,
+ char16_t *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+ /**
+ * Lowercases a UTF-8 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
+ * @param src The original string.
+ * @param sink A ByteSink to which the result string is written.
+ * sink.Flush() is called at the end.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ *
+ * @see ucasemap_utf8ToLower
+ * @stable ICU 60
+ */
+ static void utf8ToLower(
+ const char *locale, uint32_t options,
+ StringPiece src, ByteSink &sink, Edits *edits,
+ UErrorCode &errorCode);
+
+ /**
+ * Uppercases a UTF-8 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
+ * @param src The original string.
+ * @param sink A ByteSink to which the result string is written.
+ * sink.Flush() is called at the end.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ *
+ * @see ucasemap_utf8ToUpper
+ * @stable ICU 60
+ */
+ static void utf8ToUpper(
+ const char *locale, uint32_t options,
+ StringPiece src, ByteSink &sink, Edits *edits,
+ UErrorCode &errorCode);
+
+#if !UCONFIG_NO_BREAK_ITERATION
+
+ /**
+ * Titlecases a UTF-8 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ *
+ * Titlecasing uses a break iterator to find the first characters of words
+ * that are to be titlecased. It titlecases those characters and lowercases
+ * all others. (This can be modified with options bits.)
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET,
+ * U_TITLECASE_NO_LOWERCASE,
+ * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED,
+ * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES.
+ * @param iter A break iterator to find the first characters of words that are to be titlecased.
+ * It is set to the source string (setUText())
+ * and used one or more times for iteration (first() and next()).
+ * If nullptr, then a word break iterator for the locale is used
+ * (or something equivalent).
+ * @param src The original string.
+ * @param sink A ByteSink to which the result string is written.
+ * sink.Flush() is called at the end.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ *
+ * @see ucasemap_utf8ToTitle
+ * @stable ICU 60
+ */
+ static void utf8ToTitle(
+ const char *locale, uint32_t options, BreakIterator *iter,
+ StringPiece src, ByteSink &sink, Edits *edits,
+ UErrorCode &errorCode);
+
+#endif // UCONFIG_NO_BREAK_ITERATION
+
+ /**
+ * Case-folds a UTF-8 string and optionally records edits.
+ *
+ * Case folding is locale-independent and not context-sensitive,
+ * but there is an option for whether to include or exclude mappings for dotted I
+ * and dotless i that are marked with 'T' in CaseFolding.txt.
+ *
+ * The result may be longer or shorter than the original.
+ *
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
+ * @param src The original string.
+ * @param sink A ByteSink to which the result string is written.
+ * sink.Flush() is called at the end.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ *
+ * @see ucasemap_utf8FoldCase
+ * @stable ICU 60
+ */
+ static void utf8Fold(
+ uint32_t options,
+ StringPiece src, ByteSink &sink, Edits *edits,
+ UErrorCode &errorCode);
+
+ /**
+ * Lowercases a UTF-8 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of bytes). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see ucasemap_utf8ToLower
+ * @stable ICU 59
+ */
+ static int32_t utf8ToLower(
+ const char *locale, uint32_t options,
+ const char *src, int32_t srcLength,
+ char *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+ /**
+ * Uppercases a UTF-8 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of bytes). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see ucasemap_utf8ToUpper
+ * @stable ICU 59
+ */
+ static int32_t utf8ToUpper(
+ const char *locale, uint32_t options,
+ const char *src, int32_t srcLength,
+ char *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+#if !UCONFIG_NO_BREAK_ITERATION
+
+ /**
+ * Titlecases a UTF-8 string and optionally records edits.
+ * Casing is locale-dependent and context-sensitive.
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * Titlecasing uses a break iterator to find the first characters of words
+ * that are to be titlecased. It titlecases those characters and lowercases
+ * all others. (This can be modified with options bits.)
+ *
+ * @param locale The locale ID. ("" = root locale, nullptr = default locale.)
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET,
+ * U_TITLECASE_NO_LOWERCASE,
+ * U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED,
+ * U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES.
+ * @param iter A break iterator to find the first characters of words that are to be titlecased.
+ * It is set to the source string (setUText())
+ * and used one or more times for iteration (first() and next()).
+ * If nullptr, then a word break iterator for the locale is used
+ * (or something equivalent).
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of bytes). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see ucasemap_utf8ToTitle
+ * @stable ICU 59
+ */
+ static int32_t utf8ToTitle(
+ const char *locale, uint32_t options, BreakIterator *iter,
+ const char *src, int32_t srcLength,
+ char *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+#endif // UCONFIG_NO_BREAK_ITERATION
+
+ /**
+ * Case-folds a UTF-8 string and optionally records edits.
+ *
+ * Case folding is locale-independent and not context-sensitive,
+ * but there is an option for whether to include or exclude mappings for dotted I
+ * and dotless i that are marked with 'T' in CaseFolding.txt.
+ *
+ * The result may be longer or shorter than the original.
+ * The source string and the destination buffer must not overlap.
+ *
+ * @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET,
+ * U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I.
+ * @param src The original string.
+ * @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
+ * @param dest A buffer for the result string. The result will be NUL-terminated if
+ * the buffer is large enough.
+ * The contents is undefined in case of failure.
+ * @param destCapacity The size of the buffer (number of bytes). If it is 0, then
+ * dest may be nullptr and the function will only return the length of the result
+ * without writing any of the result string.
+ * @param edits Records edits for index mapping, working with styled text,
+ * and getting only changes (if any).
+ * The Edits contents is undefined if any error occurs.
+ * This function calls edits->reset() first unless
+ * options includes U_EDITS_NO_RESET. edits can be nullptr.
+ * @param errorCode Reference to an in/out error code value
+ * which must not indicate a failure before the function call.
+ * @return The length of the result string, if successful.
+ * When the result would be longer than destCapacity,
+ * the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
+ *
+ * @see ucasemap_utf8FoldCase
+ * @stable ICU 59
+ */
+ static int32_t utf8Fold(
+ uint32_t options,
+ const char *src, int32_t srcLength,
+ char *dest, int32_t destCapacity, Edits *edits,
+ UErrorCode &errorCode);
+
+private:
+ CaseMap() = delete;
+ CaseMap(const CaseMap &other) = delete;
+ CaseMap &operator=(const CaseMap &other) = delete;
+};
+
+U_NAMESPACE_END
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __CASEMAP_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/char16ptr.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/char16ptr.h
new file mode 100644
index 0000000000..049de9efee
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/char16ptr.h
@@ -0,0 +1,453 @@
+// © 2017 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+// char16ptr.h
+// created: 2017feb28 Markus W. Scherer
+
+#ifndef __CHAR16PTR_H__
+#define __CHAR16PTR_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API || U_SHOW_CPLUSPLUS_HEADER_API
+
+#include return text[position++]
.
+ * It provides next32PostInc() to access a code point and advance an internal
+ * position.
+ *
+ *
+ * Example:
+ * \code
+ * void function1(ForwardCharacterIterator &it) {
+ * UChar32 c;
+ * while(it.hasNext()) {
+ * c=it.next32PostInc();
+ * // use c
+ * }
+ * }
+ *
+ * void function1(ForwardCharacterIterator &it) {
+ * char16_t c;
+ * while((c=it.nextPostInc())!=ForwardCharacterIterator::DONE) {
+ * // use c
+ * }
+ * }
+ * \endcode
+ *
+ *
+ *
+ * See ForwardCharacterIterator for examples for using the new forward iteration
+ * functions. For backward iteration, there is also a hasPrevious() function
+ * that can be used analogously to hasNext().
+ * The old functions work as before and are shown below.
Examples for some of the new functions:
+ * + * Forward iteration with hasNext(): + * \code + * void forward1(CharacterIterator &it) { + * UChar32 c; + * for(it.setToStart(); it.hasNext();) { + * c=it.next32PostInc(); + * // use c + * } + * } + * \endcode + * Forward iteration more similar to loops with the old forward iteration, + * showing a way to convert simple for() loops: + * \code + * void forward2(CharacterIterator &it) { + * char16_t c; + * for(c=it.firstPostInc(); c!=CharacterIterator::DONE; c=it.nextPostInc()) { + * // use c + * } + * } + * \endcode + * Backward iteration with setToEnd() and hasPrevious(): + * \code + * void backward1(CharacterIterator &it) { + * UChar32 c; + * for(it.setToEnd(); it.hasPrevious();) { + * c=it.previous32(); + * // use c + * } + * } + * \endcode + * Backward iteration with a more traditional for() loop: + * \code + * void backward2(CharacterIterator &it) { + * char16_t c; + * for(c=it.last(); c!=CharacterIterator::DONE; c=it.previous()) { + * // use c + * } + * } + * \endcode + * + * Example for random access: + * \code + * void random(CharacterIterator &it) { + * // set to the third code point from the beginning + * it.move32(3, CharacterIterator::kStart); + * // get a code point from here without moving the position + * UChar32 c=it.current32(); + * // get the position + * int32_t pos=it.getIndex(); + * // get the previous code unit + * char16_t u=it.previous(); + * // move back one more code unit + * it.move(-1, CharacterIterator::kCurrent); + * // set the position back to where it was + * // and read the same code point c and move beyond it + * it.setIndex(pos); + * if(c!=it.next32PostInc()) { + * exit(1); // CharacterIterator inconsistent + * } + * } + * \endcode + * + *Examples, especially for the old API:
+ * + * Function processing characters, in this example simple output + *+ * \code + * void processChar( char16_t c ) + * { + * cout << " " << c; + * } + * \endcode + *+ * Traverse the text from start to finish + *
+ * \code + * void traverseForward(CharacterIterator& iter) + * { + * for(char16_t c = iter.first(); c != CharacterIterator::DONE; c = iter.next()) { + * processChar(c); + * } + * } + * \endcode + *+ * Traverse the text backwards, from end to start + *
+ * \code + * void traverseBackward(CharacterIterator& iter) + * { + * for(char16_t c = iter.last(); c != CharacterIterator::DONE; c = iter.previous()) { + * processChar(c); + * } + * } + * \endcode + *+ * Traverse both forward and backward from a given position in the text. + * Calls to notBoundary() in this example represents some additional stopping criteria. + *
+ * \code + * void traverseOut(CharacterIterator& iter, int32_t pos) + * { + * char16_t c; + * for (c = iter.setIndex(pos); + * c != CharacterIterator::DONE && (Unicode::isLetter(c) || Unicode::isDigit(c)); + * c = iter.next()) {} + * int32_t end = iter.getIndex(); + * for (c = iter.setIndex(pos); + * c != CharacterIterator::DONE && (Unicode::isLetter(c) || Unicode::isDigit(c)); + * c = iter.previous()) {} + * int32_t start = iter.getIndex() + 1; + * + * cout << "start: " << start << " end: " << end << endl; + * for (c = iter.setIndex(start); iter.getIndex() < end; c = iter.next() ) { + * processChar(c); + * } + * } + * \endcode + *+ * Creating a StringCharacterIterator and calling the test functions + *
+ * \code + * void CharacterIterator_Example( void ) + * { + * cout << endl << "===== CharacterIterator_Example: =====" << endl; + * UnicodeString text("Ein kleiner Satz."); + * StringCharacterIterator iterator(text); + * cout << "----- traverseForward: -----------" << endl; + * traverseForward( iterator ); + * cout << endl << endl << "----- traverseBackward: ----------" << endl; + * traverseBackward( iterator ); + * cout << endl << endl << "----- traverseOut: ---------------" << endl; + * traverseOut( iterator, 7 ); + * cout << endl << endl << "-----" << endl; + * } + * \endcode + *+ * + * @stable ICU 2.0 + */ +class U_COMMON_API CharacterIterator : public ForwardCharacterIterator { +public: + /** + * Origin enumeration for the move() and move32() functions. + * @stable ICU 2.0 + */ + enum EOrigin { kStart, kCurrent, kEnd }; + + /** + * Destructor. + * @stable ICU 2.0 + */ + virtual ~CharacterIterator(); + + /** + * Returns a pointer to a new CharacterIterator of the same + * concrete class as this one, and referring to the same + * character in the same text-storage object as this one. The + * caller is responsible for deleting the new clone. + * @return a pointer to a new CharacterIterator + * @stable ICU 2.0 + */ + virtual CharacterIterator* clone() const = 0; + + /** + * Sets the iterator to refer to the first code unit in its + * iteration range, and returns that code unit. + * This can be used to begin an iteration with next(). + * @return the first code unit in its iteration range. + * @stable ICU 2.0 + */ + virtual char16_t first() = 0; + + /** + * Sets the iterator to refer to the first code unit in its + * iteration range, returns that code unit, and moves the position + * to the second code unit. This is an alternative to setToStart() + * for forward iteration with nextPostInc(). + * @return the first code unit in its iteration range. + * @stable ICU 2.0 + */ + virtual char16_t firstPostInc(); + + /** + * Sets the iterator to refer to the first code point in its + * iteration range, and returns that code unit, + * This can be used to begin an iteration with next32(). + * Note that an iteration with next32PostInc(), beginning with, + * e.g., setToStart() or firstPostInc(), is more efficient. + * @return the first code point in its iteration range. + * @stable ICU 2.0 + */ + virtual UChar32 first32() = 0; + + /** + * Sets the iterator to refer to the first code point in its + * iteration range, returns that code point, and moves the position + * to the second code point. This is an alternative to setToStart() + * for forward iteration with next32PostInc(). + * @return the first code point in its iteration range. + * @stable ICU 2.0 + */ + virtual UChar32 first32PostInc(); + + /** + * Sets the iterator to refer to the first code unit or code point in its + * iteration range. This can be used to begin a forward + * iteration with nextPostInc() or next32PostInc(). + * @return the start position of the iteration range + * @stable ICU 2.0 + */ + inline int32_t setToStart(); + + /** + * Sets the iterator to refer to the last code unit in its + * iteration range, and returns that code unit. + * This can be used to begin an iteration with previous(). + * @return the last code unit. + * @stable ICU 2.0 + */ + virtual char16_t last() = 0; + + /** + * Sets the iterator to refer to the last code point in its + * iteration range, and returns that code unit. + * This can be used to begin an iteration with previous32(). + * @return the last code point. + * @stable ICU 2.0 + */ + virtual UChar32 last32() = 0; + + /** + * Sets the iterator to the end of its iteration range, just behind + * the last code unit or code point. This can be used to begin a backward + * iteration with previous() or previous32(). + * @return the end position of the iteration range + * @stable ICU 2.0 + */ + inline int32_t setToEnd(); + + /** + * Sets the iterator to refer to the "position"-th code unit + * in the text-storage object the iterator refers to, and + * returns that code unit. + * @param position the "position"-th code unit in the text-storage object + * @return the "position"-th code unit. + * @stable ICU 2.0 + */ + virtual char16_t setIndex(int32_t position) = 0; + + /** + * Sets the iterator to refer to the beginning of the code point + * that contains the "position"-th code unit + * in the text-storage object the iterator refers to, and + * returns that code point. + * The current position is adjusted to the beginning of the code point + * (its first code unit). + * @param position the "position"-th code unit in the text-storage object + * @return the "position"-th code point. + * @stable ICU 2.0 + */ + virtual UChar32 setIndex32(int32_t position) = 0; + + /** + * Returns the code unit the iterator currently refers to. + * @return the current code unit. + * @stable ICU 2.0 + */ + virtual char16_t current() const = 0; + + /** + * Returns the code point the iterator currently refers to. + * @return the current code point. + * @stable ICU 2.0 + */ + virtual UChar32 current32() const = 0; + + /** + * Advances to the next code unit in the iteration range + * (toward endIndex()), and returns that code unit. If there are + * no more code units to return, returns DONE. + * @return the next code unit. + * @stable ICU 2.0 + */ + virtual char16_t next() = 0; + + /** + * Advances to the next code point in the iteration range + * (toward endIndex()), and returns that code point. If there are + * no more code points to return, returns DONE. + * Note that iteration with "pre-increment" semantics is less + * efficient than iteration with "post-increment" semantics + * that is provided by next32PostInc(). + * @return the next code point. + * @stable ICU 2.0 + */ + virtual UChar32 next32() = 0; + + /** + * Advances to the previous code unit in the iteration range + * (toward startIndex()), and returns that code unit. If there are + * no more code units to return, returns DONE. + * @return the previous code unit. + * @stable ICU 2.0 + */ + virtual char16_t previous() = 0; + + /** + * Advances to the previous code point in the iteration range + * (toward startIndex()), and returns that code point. If there are + * no more code points to return, returns DONE. + * @return the previous code point. + * @stable ICU 2.0 + */ + virtual UChar32 previous32() = 0; + + /** + * Returns false if there are no more code units or code points + * before the current position in the iteration range. + * This is used with previous() or previous32() in backward + * iteration. + * @return false if there are no more code units or code points + * before the current position in the iteration range, return true otherwise. + * @stable ICU 2.0 + */ + virtual UBool hasPrevious() = 0; + + /** + * Returns the numeric index in the underlying text-storage + * object of the character returned by first(). Since it's + * possible to create an iterator that iterates across only + * part of a text-storage object, this number isn't + * necessarily 0. + * @returns the numeric index in the underlying text-storage + * object of the character returned by first(). + * @stable ICU 2.0 + */ + inline int32_t startIndex() const; + + /** + * Returns the numeric index in the underlying text-storage + * object of the position immediately BEYOND the character + * returned by last(). + * @return the numeric index in the underlying text-storage + * object of the position immediately BEYOND the character + * returned by last(). + * @stable ICU 2.0 + */ + inline int32_t endIndex() const; + + /** + * Returns the numeric index in the underlying text-storage + * object of the character the iterator currently refers to + * (i.e., the character returned by current()). + * @return the numeric index in the text-storage object of + * the character the iterator currently refers to + * @stable ICU 2.0 + */ + inline int32_t getIndex() const; + + /** + * Returns the length of the entire text in the underlying + * text-storage object. + * @return the length of the entire text in the text-storage object + * @stable ICU 2.0 + */ + inline int32_t getLength() const; + + /** + * Moves the current position relative to the start or end of the + * iteration range, or relative to the current position itself. + * The movement is expressed in numbers of code units forward + * or backward by specifying a positive or negative delta. + * @param delta the position relative to origin. A positive delta means forward; + * a negative delta means backward. + * @param origin Origin enumeration {kStart, kCurrent, kEnd} + * @return the new position + * @stable ICU 2.0 + */ + virtual int32_t move(int32_t delta, EOrigin origin) = 0; + + /** + * Moves the current position relative to the start or end of the + * iteration range, or relative to the current position itself. + * The movement is expressed in numbers of code points forward + * or backward by specifying a positive or negative delta. + * @param delta the position relative to origin. A positive delta means forward; + * a negative delta means backward. + * @param origin Origin enumeration {kStart, kCurrent, kEnd} + * @return the new position + * @stable ICU 2.0 + */ +#ifdef move32 + // One of the system headers right now is sometimes defining a conflicting macro we don't use +#undef move32 +#endif + virtual int32_t move32(int32_t delta, EOrigin origin) = 0; + + /** + * Copies the text under iteration into the UnicodeString + * referred to by "result". + * @param result Receives a copy of the text under iteration. + * @stable ICU 2.0 + */ + virtual void getText(UnicodeString& result) = 0; + +protected: + /** + * Empty constructor. + * @stable ICU 2.0 + */ + CharacterIterator(); + + /** + * Constructor, just setting the length field in this base class. + * @stable ICU 2.0 + */ + CharacterIterator(int32_t length); + + /** + * Constructor, just setting the length and position fields in this base class. + * @stable ICU 2.0 + */ + CharacterIterator(int32_t length, int32_t position); + + /** + * Constructor, just setting the length, start, end, and position fields in this base class. + * @stable ICU 2.0 + */ + CharacterIterator(int32_t length, int32_t textBegin, int32_t textEnd, int32_t position); + + /** + * Copy constructor. + * + * @param that The CharacterIterator to be copied + * @stable ICU 2.0 + */ + CharacterIterator(const CharacterIterator &that); + + /** + * Assignment operator. Sets this CharacterIterator to have the same behavior, + * as the one passed in. + * @param that The CharacterIterator passed in. + * @return the newly set CharacterIterator. + * @stable ICU 2.0 + */ + CharacterIterator &operator=(const CharacterIterator &that); + + /** + * Base class text length field. + * Necessary this for correct getText() and hashCode(). + * @stable ICU 2.0 + */ + int32_t textLength; + + /** + * Base class field for the current position. + * @stable ICU 2.0 + */ + int32_t pos; + + /** + * Base class field for the start of the iteration range. + * @stable ICU 2.0 + */ + int32_t begin; + + /** + * Base class field for the end of the iteration range. + * @stable ICU 2.0 + */ + int32_t end; +}; + +inline bool +ForwardCharacterIterator::operator!=(const ForwardCharacterIterator& that) const { + return !operator==(that); +} + +inline int32_t +CharacterIterator::setToStart() { + return move(0, kStart); +} + +inline int32_t +CharacterIterator::setToEnd() { + return move(0, kEnd); +} + +inline int32_t +CharacterIterator::startIndex() const { + return begin; +} + +inline int32_t +CharacterIterator::endIndex() const { + return end; +} + +inline int32_t +CharacterIterator::getIndex() const { + return pos; +} + +inline int32_t +CharacterIterator::getLength() const { + return textLength; +} + +U_NAMESPACE_END + +#endif /* U_SHOW_CPLUSPLUS_API */ + +#endif diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/choicfmt.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/choicfmt.h new file mode 100644 index 0000000000..2b6fb626ac --- /dev/null +++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/choicfmt.h @@ -0,0 +1,601 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************** +* Copyright (C) 1997-2013, International Business Machines +* Corporation and others. All Rights Reserved. +******************************************************************************** +* +* File CHOICFMT.H +* +* Modification History: +* +* Date Name Description +* 02/19/97 aliu Converted from java. +* 03/20/97 helena Finished first cut of implementation and got rid +* of nextDouble/previousDouble and replaced with +* boolean array. +* 4/10/97 aliu Clean up. Modified to work on AIX. +* 8/6/97 nos Removed overloaded constructor, member var 'buffer'. +* 07/22/98 stephen Removed operator!= (implemented in Format) +******************************************************************************** +*/ + +#ifndef CHOICFMT_H +#define CHOICFMT_H + +#include "unicode/utypes.h" + +#if U_SHOW_CPLUSPLUS_API + +/** + * \file + * \brief C++ API: Choice Format. + */ + +#if !UCONFIG_NO_FORMATTING + +#include "unicode/fieldpos.h" +#include "unicode/format.h" +#include "unicode/messagepattern.h" +#include "unicode/numfmt.h" +#include "unicode/unistr.h" + +#ifndef U_HIDE_DEPRECATED_API + +U_NAMESPACE_BEGIN + +class MessageFormat; + +/** + * ChoiceFormat converts between ranges of numeric values and strings for those ranges. + * The strings must conform to the MessageFormat pattern syntax. + * + *
ChoiceFormat
is probably not what you need.
+ * Please use MessageFormat
+ * with plural
arguments for proper plural selection,
+ * and select
arguments for simple selection among a fixed set of choices!
A ChoiceFormat
splits
+ * the real number line \htmlonly-∞
to
+ * +∞
\endhtmlonly into two
+ * or more contiguous ranges. Each range is mapped to a
+ * string.
ChoiceFormat
was originally intended
+ * for displaying grammatically correct
+ * plurals such as "There is one file." vs. "There are 2 files."
+ * However, plural rules for many languages
+ * are too complex for the capabilities of ChoiceFormat,
+ * and its requirement of specifying the precise rules for each message
+ * is unmanageable for translators.
There are two methods of defining a ChoiceFormat
; both
+ * are equivalent. The first is by using a string pattern. This is the
+ * preferred method in most cases. The second method is through direct
+ * specification of the arrays that logically make up the
+ * ChoiceFormat
.
Note: Typically, choice formatting is done (if done at all) via MessageFormat
+ * with a choice
argument type,
+ * rather than using a stand-alone ChoiceFormat
.
The pattern string defines the range boundaries and the strings for each number range. + * Syntax: + *
+ * choiceStyle = number separator message ('|' number separator message)* + * number = normal_number | ['-'] \htmlonly∞\endhtmlonly (U+221E, infinity) + * normal_number = double value (unlocalized ASCII string) + * separator = less_than | less_than_or_equal + * less_than = '<' + * less_than_or_equal = '#' | \htmlonly≤\endhtmlonly (U+2264) + * message: see {@link MessageFormat} + *+ * Pattern_White_Space between syntax elements is ignored, except + * around each range's sub-message. + * + *
Each numeric sub-range extends from the current range's number
+ * to the next range's number.
+ * The number itself is included in its range if a less_than_or_equal
sign is used,
+ * and excluded from its range (and instead included in the previous range)
+ * if a less_than
sign is used.
When a ChoiceFormat
is constructed from
+ * arrays of numbers, closure flags and strings,
+ * they are interpreted just like
+ * the sequence of (number separator string)
in an equivalent pattern string.
+ * closure[i]==true
corresponds to a less_than
separator sign.
+ * The equivalent pattern string will be constructed automatically.
During formatting, a number is mapped to the first range + * where the number is not greater than the range's upper limit. + * That range's message string is returned. A NaN maps to the very first range.
+ * + *During parsing, a range is selected for the longest match of + * any range's message. That range's number is returned, ignoring the separator/closure. + * Only a simple string match is performed, without parsing of arguments that + * might be specified in the message strings.
+ * + *Note that the first range's number is ignored in formatting + * but may be returned from parsing.
+ * + *Here is an example of two arrays that map the number
+ * 1..7
to the English day of the week abbreviations
+ * Sun..Sat
. No closures array is given; this is the same as
+ * specifying all closures to be false
.
{1,2,3,4,5,6,7}, + * {"Sun","Mon","Tue","Wed","Thur","Fri","Sat"}+ * + *
Here is an example that maps the ranges [-Inf, 1), [1, 1], and (1, + * +Inf] to three strings. That is, the number line is split into three + * ranges: x < 1.0, x = 1.0, and x > 1.0. + * (The round parentheses in the notation above indicate an exclusive boundary, + * like the turned bracket in European notation: [-Inf, 1) == [-Inf, 1[ )
+ * + *{0, 1, 1}, + * {false, false, true}, + * {"no files", "one file", "many files"}+ * + *
Here is an example that shows formatting and parsing:
+ * + * \code + * #includeUser subclasses are not supported. While clients may write
+ * subclasses, such code will not necessarily work and will not be
+ * guaranteed to work stably from release to release.
+ *
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+class U_I18N_API ChoiceFormat: public NumberFormat {
+public:
+ /**
+ * Constructs a new ChoiceFormat from the pattern string.
+ *
+ * @param pattern Pattern used to construct object.
+ * @param status Output param to receive success code. If the
+ * pattern cannot be parsed, set to failure code.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ ChoiceFormat(const UnicodeString& pattern,
+ UErrorCode& status);
+
+
+ /**
+ * Constructs a new ChoiceFormat with the given limits and message strings.
+ * All closure flags default to false
,
+ * equivalent to less_than_or_equal
separators.
+ *
+ * Copies the limits and formats instead of adopting them.
+ *
+ * @param limits Array of limit values.
+ * @param formats Array of formats.
+ * @param count Size of 'limits' and 'formats' arrays.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ ChoiceFormat(const double* limits,
+ const UnicodeString* formats,
+ int32_t count );
+
+ /**
+ * Constructs a new ChoiceFormat with the given limits, closure flags and message strings.
+ *
+ * Copies the limits and formats instead of adopting them.
+ *
+ * @param limits Array of limit values
+ * @param closures Array of booleans specifying whether each
+ * element of 'limits' is open or closed. If false, then the
+ * corresponding limit number is a member of its range.
+ * If true, then the limit number belongs to the previous range it.
+ * @param formats Array of formats
+ * @param count Size of 'limits', 'closures', and 'formats' arrays
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ ChoiceFormat(const double* limits,
+ const UBool* closures,
+ const UnicodeString* formats,
+ int32_t count);
+
+ /**
+ * Copy constructor.
+ *
+ * @param that ChoiceFormat object to be copied from
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ ChoiceFormat(const ChoiceFormat& that);
+
+ /**
+ * Assignment operator.
+ *
+ * @param that ChoiceFormat object to be copied
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ const ChoiceFormat& operator=(const ChoiceFormat& that);
+
+ /**
+ * Destructor.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual ~ChoiceFormat();
+
+ /**
+ * Clones this Format object. The caller owns the
+ * result and must delete it when done.
+ *
+ * @return a copy of this object
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual ChoiceFormat* clone() const override;
+
+ /**
+ * Returns true if the given Format objects are semantically equal.
+ * Objects of different subclasses are considered unequal.
+ *
+ * @param other ChoiceFormat object to be compared
+ * @return true if other is the same as this.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual bool operator==(const Format& other) const override;
+
+ /**
+ * Sets the pattern.
+ * @param pattern The pattern to be applied.
+ * @param status Output param set to success/failure code on
+ * exit. If the pattern is invalid, this will be
+ * set to a failure result.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual void applyPattern(const UnicodeString& pattern,
+ UErrorCode& status);
+
+ /**
+ * Sets the pattern.
+ * @param pattern The pattern to be applied.
+ * @param parseError Struct to receive information on position
+ * of error if an error is encountered
+ * @param status Output param set to success/failure code on
+ * exit. If the pattern is invalid, this will be
+ * set to a failure result.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual void applyPattern(const UnicodeString& pattern,
+ UParseError& parseError,
+ UErrorCode& status);
+ /**
+ * Gets the pattern.
+ *
+ * @param pattern Output param which will receive the pattern
+ * Previous contents are deleted.
+ * @return A reference to 'pattern'
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual UnicodeString& toPattern(UnicodeString &pattern) const;
+
+ /**
+ * Sets the choices to be used in formatting.
+ * For details see the constructor with the same parameter list.
+ *
+ * @param limitsToCopy Contains the top value that you want
+ * parsed with that format,and should be in
+ * ascending sorted order. When formatting X,
+ * the choice will be the i, where limit[i]
+ * <= X < limit[i+1].
+ * @param formatsToCopy The format strings you want to use for each limit.
+ * @param count The size of the above arrays.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual void setChoices(const double* limitsToCopy,
+ const UnicodeString* formatsToCopy,
+ int32_t count );
+
+ /**
+ * Sets the choices to be used in formatting.
+ * For details see the constructor with the same parameter list.
+ *
+ * @param limits Array of limits
+ * @param closures Array of limit booleans
+ * @param formats Array of format string
+ * @param count The size of the above arrays
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual void setChoices(const double* limits,
+ const UBool* closures,
+ const UnicodeString* formats,
+ int32_t count);
+
+ /**
+ * Returns nullptr and 0.
+ * Before ICU 4.8, this used to return the choice limits array.
+ *
+ * @param count Will be set to 0.
+ * @return nullptr
+ * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern.
+ */
+ virtual const double* getLimits(int32_t& count) const;
+
+ /**
+ * Returns nullptr and 0.
+ * Before ICU 4.8, this used to return the limit booleans array.
+ *
+ * @param count Will be set to 0.
+ * @return nullptr
+ * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern.
+ */
+ virtual const UBool* getClosures(int32_t& count) const;
+
+ /**
+ * Returns nullptr and 0.
+ * Before ICU 4.8, this used to return the array of choice strings.
+ *
+ * @param count Will be set to 0.
+ * @return nullptr
+ * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern.
+ */
+ virtual const UnicodeString* getFormats(int32_t& count) const;
+
+
+ using NumberFormat::format;
+
+ /**
+ * Formats a double number using this object's choices.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @return Reference to 'appendTo' parameter.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual UnicodeString& format(double number,
+ UnicodeString& appendTo,
+ FieldPosition& pos) const override;
+ /**
+ * Formats an int32_t number using this object's choices.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @return Reference to 'appendTo' parameter.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual UnicodeString& format(int32_t number,
+ UnicodeString& appendTo,
+ FieldPosition& pos) const override;
+
+ /**
+ * Formats an int64_t number using this object's choices.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @return Reference to 'appendTo' parameter.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual UnicodeString& format(int64_t number,
+ UnicodeString& appendTo,
+ FieldPosition& pos) const override;
+
+ /**
+ * Formats an array of objects using this object's choices.
+ *
+ * @param objs The array of objects to be formatted.
+ * @param cnt The size of objs.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param success Output param set to success/failure code on
+ * exit.
+ * @return Reference to 'appendTo' parameter.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual UnicodeString& format(const Formattable* objs,
+ int32_t cnt,
+ UnicodeString& appendTo,
+ FieldPosition& pos,
+ UErrorCode& success) const;
+
+ using NumberFormat::parse;
+
+ /**
+ * Looks for the longest match of any message string on the input text and,
+ * if there is a match, sets the result object to the corresponding range's number.
+ *
+ * If no string matches, then the parsePosition is unchanged.
+ *
+ * @param text The text to be parsed.
+ * @param result Formattable to be set to the parse result.
+ * If parse fails, return contents are undefined.
+ * @param parsePosition The position to start parsing at on input.
+ * On output, moved to after the last successfully
+ * parse character. On parse failure, does not change.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual void parse(const UnicodeString& text,
+ Formattable& result,
+ ParsePosition& parsePosition) const override;
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Part of ICU's "poor man's RTTI".
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments.
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * Returns the class ID for this class. This is useful only for
+ * comparing to a return value from getDynamicClassID(). For example:
+ *
+ * . Base* polymorphic_pointer = createPolymorphicObject(); + * . if (polymorphic_pointer->getDynamicClassID() == + * . Derived::getStaticClassID()) ... + *+ * @return The class ID for all objects of this class. + * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. + */ + static UClassID U_EXPORT2 getStaticClassID(); + +private: + /** + * Converts a double value to a string. + * @param value the double number to be converted. + * @param string the result string. + * @return the converted string. + */ + static UnicodeString& dtos(double value, UnicodeString& string); + + ChoiceFormat() = delete; // default constructor not implemented + + /** + * Construct a new ChoiceFormat with the limits and the corresponding formats + * based on the pattern. + * + * @param newPattern Pattern used to construct object. + * @param parseError Struct to receive information on position + * of error if an error is encountered. + * @param status Output param to receive success code. If the + * pattern cannot be parsed, set to failure code. + */ + ChoiceFormat(const UnicodeString& newPattern, + UParseError& parseError, + UErrorCode& status); + + friend class MessageFormat; + + virtual void setChoices(const double* limits, + const UBool* closures, + const UnicodeString* formats, + int32_t count, + UErrorCode &errorCode); + + /** + * Finds the ChoiceFormat sub-message for the given number. + * @param pattern A MessagePattern. + * @param partIndex the index of the first ChoiceFormat argument style part. + * @param number a number to be mapped to one of the ChoiceFormat argument's intervals + * @return the sub-message start part index. + */ + static int32_t findSubMessage(const MessagePattern &pattern, int32_t partIndex, double number); + + static double parseArgument( + const MessagePattern &pattern, int32_t partIndex, + const UnicodeString &source, ParsePosition &pos); + + /** + * Matches the pattern string from the end of the partIndex to + * the beginning of the limitPartIndex, + * including all syntax except SKIP_SYNTAX, + * against the source string starting at sourceOffset. + * If they match, returns the length of the source string match. + * Otherwise returns -1. + */ + static int32_t matchStringUntilLimitPart( + const MessagePattern &pattern, int32_t partIndex, int32_t limitPartIndex, + const UnicodeString &source, int32_t sourceOffset); + + /** + * Some of the ChoiceFormat constructors do not have a UErrorCode parameter. + * We need _some_ way to provide one for the MessagePattern constructor. + * Alternatively, the MessagePattern could be a pointer field, but that is + * not nice either. + */ + UErrorCode constructorErrorCode; + + /** + * The MessagePattern which contains the parsed structure of the pattern string. + * + * Starting with ICU 4.8, the MessagePattern contains a sequence of + * numeric/selector/message parts corresponding to the parsed pattern. + * For details see the MessagePattern class API docs. + */ + MessagePattern msgPattern; + + /** + * Docs & fields from before ICU 4.8, before MessagePattern was used. + * Commented out, and left only for explanation of semantics. + * -------- + * Each ChoiceFormat divides the range -Inf..+Inf into fCount + * intervals. The intervals are: + * + * 0: fChoiceLimits[0]..fChoiceLimits[1] + * 1: fChoiceLimits[1]..fChoiceLimits[2] + * ... + * fCount-2: fChoiceLimits[fCount-2]..fChoiceLimits[fCount-1] + * fCount-1: fChoiceLimits[fCount-1]..+Inf + * + * Interval 0 is special; during formatting (mapping numbers to + * strings), it also contains all numbers less than + * fChoiceLimits[0], as well as NaN values. + * + * Interval i maps to and from string fChoiceFormats[i]. When + * parsing (mapping strings to numbers), then intervals map to + * their lower limit, that is, interval i maps to fChoiceLimit[i]. + * + * The intervals may be closed, half open, or open. This affects + * formatting but does not affect parsing. Interval i is affected + * by fClosures[i] and fClosures[i+1]. If fClosures[i] + * is false, then the value fChoiceLimits[i] is in interval i. + * That is, intervals i and i are: + * + * i-1: ... x < fChoiceLimits[i] + * i: fChoiceLimits[i] <= x ... + * + * If fClosures[i] is true, then the value fChoiceLimits[i] is + * in interval i-1. That is, intervals i-1 and i are: + * + * i-1: ... x <= fChoiceLimits[i] + * i: fChoiceLimits[i] < x ... + * + * Because of the nature of interval 0, fClosures[0] has no + * effect. + */ + // double* fChoiceLimits; + // UBool* fClosures; + // UnicodeString* fChoiceFormats; + // int32_t fCount; +}; + + +U_NAMESPACE_END + +#endif // U_HIDE_DEPRECATED_API +#endif /* #if !UCONFIG_NO_FORMATTING */ + +#endif /* U_SHOW_CPLUSPLUS_API */ + +#endif // CHOICFMT_H +//eof diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/coleitr.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/coleitr.h new file mode 100644 index 0000000000..a147d6cfba --- /dev/null +++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/coleitr.h @@ -0,0 +1,411 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* + ****************************************************************************** + * Copyright (C) 1997-2014, International Business Machines + * Corporation and others. All Rights Reserved. + ****************************************************************************** + */ + +/** + * \file + * \brief C++ API: Collation Element Iterator. + */ + +/** +* File coleitr.h +* +* Created by: Helena Shih +* +* Modification History: +* +* Date Name Description +* +* 8/18/97 helena Added internal API documentation. +* 08/03/98 erm Synched with 1.2 version CollationElementIterator.java +* 12/10/99 aliu Ported Thai collation support from Java. +* 01/25/01 swquek Modified into a C++ wrapper calling C APIs (ucoliter.h) +* 02/19/01 swquek Removed CollationElementsIterator() since it is +* private constructor and no calls are made to it +* 2012-2014 markus Rewritten in C++ again. +*/ + +#ifndef COLEITR_H +#define COLEITR_H + +#include "unicode/utypes.h" + +#if U_SHOW_CPLUSPLUS_API + +#if !UCONFIG_NO_COLLATION + +#include "unicode/unistr.h" +#include "unicode/uobject.h" + +struct UCollationElements; +struct UHashtable; + +U_NAMESPACE_BEGIN + +struct CollationData; + +class CharacterIterator; +class CollationIterator; +class RuleBasedCollator; +class UCollationPCE; +class UVector32; + +/** +* The CollationElementIterator class is used as an iterator to walk through +* each character of an international string. Use the iterator to return the +* ordering priority of the positioned character. The ordering priority of a +* character, which we refer to as a key, defines how a character is collated in +* the given collation object. +* For example, consider the following in Slovak and in traditional Spanish collation: +*
+* "ca" -> the first key is key('c') and second key is key('a'). +* "cha" -> the first key is key('ch') and second key is key('a').+* And in German phonebook collation, +*
\htmlonly "æb"-> the first key is key('a'), the second key is key('e'), and +* the third key is key('b'). \endhtmlonly+* The key of a character, is an integer composed of primary order(short), +* secondary order(char), and tertiary order(char). Java strictly defines the +* size and signedness of its primitive data types. Therefore, the static +* functions primaryOrder(), secondaryOrder(), and tertiaryOrder() return +* int32_t to ensure the correctness of the key value. +*
Example of the iterator usage: (without error checking) +*
+* \code +* void CollationElementIterator_Example() +* { +* UnicodeString str = "This is a test"; +* UErrorCode success = U_ZERO_ERROR; +* RuleBasedCollator* rbc = +* (RuleBasedCollator*) RuleBasedCollator::createInstance(success); +* CollationElementIterator* c = +* rbc->createCollationElementIterator( str ); +* int32_t order = c->next(success); +* c->reset(); +* order = c->previous(success); +* delete c; +* delete rbc; +* } +* \endcode +*+*
+* The method next() returns the collation order of the next character based on +* the comparison level of the collator. The method previous() returns the +* collation order of the previous character based on the comparison level of +* the collator. The Collation Element Iterator moves only in one direction +* between calls to reset(), setOffset(), or setText(). That is, next() +* and previous() can not be inter-used. Whenever previous() is to be called after +* next() or vice versa, reset(), setOffset() or setText() has to be called first +* to reset the status, shifting pointers to either the end or the start of +* the string (reset() or setText()), or the specified position (setOffset()). +* Hence at the next call of next() or previous(), the first or last collation order, +* or collation order at the specified position will be returned. If a change of +* direction is done without one of these calls, the result is undefined. +*
+* The result of a forward iterate (next()) and reversed result of the backward
+* iterate (previous()) on the same string are equivalent, if collation orders
+* with the value 0 are ignored.
+* Character based on the comparison level of the collator. A collation order
+* consists of primary order, secondary order and tertiary order. The data
+* type of the collation order is int32_t.
+*
+* Note, CollationElementIterator should not be subclassed.
+* @see Collator
+* @see RuleBasedCollator
+* @version 1.8 Jan 16 2001
+*/
+class U_I18N_API CollationElementIterator final : public UObject {
+public:
+
+ // CollationElementIterator public data member ------------------------------
+
+ enum {
+ /**
+ * NULLORDER indicates that an error has occurred while processing
+ * @stable ICU 2.0
+ */
+ NULLORDER = static_cast
+*
+* Like other locale-sensitive classes, you can use the static factory method,
+*
+* The following example shows how to compare two strings using the
+*
+* You can set a Collator
class performs locale-sensitive string
+* comparison.
+* You use this class to build searching and sorting routines for natural
+* language text.
+* Collator
is an abstract base class. Subclasses implement
+* specific collation strategies. One subclass,
+* RuleBasedCollator
, is currently provided and is applicable
+* to a wide set of languages. Other subclasses may be created to handle more
+* specialized needs.
+* createInstance
, to obtain the appropriate
+* Collator
object for a given locale. You will only need to
+* look at the subclasses of Collator
if you need to
+* understand the details of a particular collation strategy or if you need to
+* modify that strategy.
+* Collator
for the default locale.
+* \htmlonly\endhtmlonly
+*
\endhtmlonly
+*
+* \code
+* // Compare two strings in the default locale
+* UErrorCode success = U_ZERO_ERROR;
+* Collator* myCollator = Collator::createInstance(success);
+* if (myCollator->compare("abc", "ABC") < 0)
+* cout << "abc is less than ABC" << endl;
+* else
+* cout << "abc is greater than or equal to ABC" << endl;
+* \endcode
+*
+* \htmlonlyCollator
's strength attribute to
+* determine the level of difference considered significant in comparisons.
+* Five strengths are provided: PRIMARY
, SECONDARY
,
+* TERTIARY
, QUATERNARY
and IDENTICAL
.
+* The exact assignment of strengths to language features is locale dependent.
+* For example, in Czech, "e" and "f" are considered primary differences,
+* while "e" and "\u00EA" are secondary differences, "e" and "E" are tertiary
+* differences and "e" and "e" are identical. The following shows how both case
+* and accents could be ignored for US English.
+* \htmlonly\endhtmlonly
+*
\endhtmlonly
+*
+* The
+* \code
+* //Get the Collator for US English and set its strength to PRIMARY
+* UErrorCode success = U_ZERO_ERROR;
+* Collator* usCollator = Collator::createInstance(Locale::getUS(), success);
+* usCollator->setStrength(Collator::PRIMARY);
+* if (usCollator->compare("abc", "ABC") == 0)
+* cout << "'abc' and 'ABC' strings are equivalent with strength PRIMARY" << endl;
+* \endcode
+*
+* \htmlonlygetSortKey
methods
+* convert a string to a series of bytes that can be compared bitwise against
+* other sort keys using strcmp()
. Sort keys are written as
+* zero-terminated byte strings.
+*
+* Another set of APIs returns a CollationKey
object that wraps
+* the sort key bytes instead of returning the bytes themselves.
+*
+* Note: Collator
s with different Locale,
+* and CollationStrength settings will return different sort
+* orders for the same set of strings. Locales have specific collation rules,
+* and the way in which secondary and tertiary differences are taken into
+* account, for example, will result in a different sorting order for same
+* strings.
+*
Example of use: + *
+ * . char16_t ABC[] = {0x41, 0x42, 0x43, 0}; // = "ABC" + * . char16_t abc[] = {0x61, 0x62, 0x63, 0}; // = "abc" + * . UErrorCode status = U_ZERO_ERROR; + * . Collator *myCollation = + * . Collator::createInstance(Locale::getUS(), status); + * . if (U_FAILURE(status)) return; + * . myCollation->setStrength(Collator::PRIMARY); + * . // result would be Collator::EQUAL ("abc" == "ABC") + * . // (no primary difference between "abc" and "ABC") + * . Collator::EComparisonResult result = + * . myCollation->compare(abc, 3, ABC, 3); + * . myCollation->setStrength(Collator::TERTIARY); + * . // result would be Collator::LESS ("abc" <<< "ABC") + * . // (with tertiary difference between "abc" and "ABC") + * . result = myCollation->compare(abc, 3, ABC, 3); + *+ * @param source the source string array to be compared with. + * @param sourceLength the length of the source string array. If this value + * is equal to -1, the string array is null-terminated. + * @param target the string that is to be compared with the source string. + * @param targetLength the length of the target string array. If this value + * is equal to -1, the string array is null-terminated. + * @return Returns a byte value. GREATER if source is greater than target; + * EQUAL if source is equal to target; LESS if source is less than + * target + * @deprecated ICU 2.6 use the overload with UErrorCode & + */ + virtual EComparisonResult compare(const char16_t* source, int32_t sourceLength, + const char16_t* target, int32_t targetLength) + const; +#endif // U_FORCE_HIDE_DEPRECATED_API + + /** + * The comparison function compares the character data stored in two + * different string arrays. Returns information about whether a string array + * is less than, greater than or equal to another string array. + * @param source the source string array to be compared with. + * @param sourceLength the length of the source string array. If this value + * is equal to -1, the string array is null-terminated. + * @param target the string that is to be compared with the source string. + * @param targetLength the length of the target string array. If this value + * is equal to -1, the string array is null-terminated. + * @param status possible error code + * @return Returns an enum value. UCOL_GREATER if source is greater + * than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less + * than target + * @stable ICU 2.6 + */ + virtual UCollationResult compare(const char16_t* source, int32_t sourceLength, + const char16_t* target, int32_t targetLength, + UErrorCode &status) const = 0; + + /** + * Compares two strings using the Collator. + * Returns whether the first one compares less than/equal to/greater than + * the second one. + * This version takes UCharIterator input. + * @param sIter the first ("source") string iterator + * @param tIter the second ("target") string iterator + * @param status ICU status + * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER + * @stable ICU 4.2 + */ + virtual UCollationResult compare(UCharIterator &sIter, + UCharIterator &tIter, + UErrorCode &status) const; + + /** + * Compares two UTF-8 strings using the Collator. + * Returns whether the first one compares less than/equal to/greater than + * the second one. + * This version takes UTF-8 input. + * Note that a StringPiece can be implicitly constructed + * from a std::string or a NUL-terminated const char * string. + * @param source the first UTF-8 string + * @param target the second UTF-8 string + * @param status ICU status + * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER + * @stable ICU 4.2 + */ + virtual UCollationResult compareUTF8(const StringPiece &source, + const StringPiece &target, + UErrorCode &status) const; + + /** + * Transforms the string into a series of characters that can be compared + * with CollationKey::compareTo. It is not possible to restore the original + * string from the chars in the sort key. + *
Use CollationKey::equals or CollationKey::compare to compare the + * generated sort keys. + * If the source string is null, a null collation key will be returned. + * + * Note that sort keys are often less efficient than simply doing comparison. + * For more details, see the ICU User Guide. + * + * @param source the source string to be transformed into a sort key. + * @param key the collation key to be filled in + * @param status the error code status. + * @return the collation key of the string based on the collation rules. + * @see CollationKey#compare + * @stable ICU 2.0 + */ + virtual CollationKey& getCollationKey(const UnicodeString& source, + CollationKey& key, + UErrorCode& status) const = 0; + + /** + * Transforms the string into a series of characters that can be compared + * with CollationKey::compareTo. It is not possible to restore the original + * string from the chars in the sort key. + *
Use CollationKey::equals or CollationKey::compare to compare the + * generated sort keys. + *
If the source string is null, a null collation key will be returned.
+ *
+ * Note that sort keys are often less efficient than simply doing comparison.
+ * For more details, see the ICU User Guide.
+ *
+ * @param source the source string to be transformed into a sort key.
+ * @param sourceLength length of the collation key
+ * @param key the collation key to be filled in
+ * @param status the error code status.
+ * @return the collation key of the string based on the collation rules.
+ * @see CollationKey#compare
+ * @stable ICU 2.0
+ */
+ virtual CollationKey& getCollationKey(const char16_t*source,
+ int32_t sourceLength,
+ CollationKey& key,
+ UErrorCode& status) const = 0;
+ /**
+ * Generates the hash code for the collation object
+ * @stable ICU 2.0
+ */
+ virtual int32_t hashCode() const = 0;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Gets the locale of the Collator
+ *
+ * @param type can be either requested, valid or actual locale. For more
+ * information see the definition of ULocDataLocaleType in
+ * uloc.h
+ * @param status the error code status.
+ * @return locale where the collation data lives. If the collator
+ * was instantiated from rules, locale is empty.
+ * @deprecated ICU 2.8 This API is under consideration for revision
+ * in ICU 3.0.
+ */
+ virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const = 0;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Convenience method for comparing two strings based on the collation rules.
+ * @param source the source string to be compared with.
+ * @param target the target string to be compared with.
+ * @return true if the first string is greater than the second one,
+ * according to the collation rules. false, otherwise.
+ * @see Collator#compare
+ * @stable ICU 2.0
+ */
+ UBool greater(const UnicodeString& source, const UnicodeString& target)
+ const;
+
+ /**
+ * Convenience method for comparing two strings based on the collation rules.
+ * @param source the source string to be compared with.
+ * @param target the target string to be compared with.
+ * @return true if the first string is greater than or equal to the second
+ * one, according to the collation rules. false, otherwise.
+ * @see Collator#compare
+ * @stable ICU 2.0
+ */
+ UBool greaterOrEqual(const UnicodeString& source,
+ const UnicodeString& target) const;
+
+ /**
+ * Convenience method for comparing two strings based on the collation rules.
+ * @param source the source string to be compared with.
+ * @param target the target string to be compared with.
+ * @return true if the strings are equal according to the collation rules.
+ * false, otherwise.
+ * @see Collator#compare
+ * @stable ICU 2.0
+ */
+ UBool equals(const UnicodeString& source, const UnicodeString& target) const;
+
+#ifndef U_HIDE_DRAFT_API
+
+ /**
+ * Creates a comparison function object that uses this collator.
+ * Like E.g. with strength == SECONDARY, the tertiary difference is ignored
+ * E.g. with strength == PRIMARY, the secondary and tertiary difference
+ * are ignored.
+ * @return the current comparison level.
+ * @see Collator#setStrength
+ * @deprecated ICU 2.6 Use getAttribute(UCOL_STRENGTH...) instead
+ */
+ virtual ECollationStrength getStrength() const;
+
+ /**
+ * Sets the minimum strength to be used in comparison or transformation.
+ * Example of use:
+ * The reordering codes are a combination of script codes and reorder codes.
+ * @param reorderCodes An array of script codes in the new order. This can be nullptr if the
+ * length is also set to 0. An empty array will clear any reordering codes on the collator.
+ * @param reorderCodesLength The length of reorderCodes.
+ * @param status error code
+ * @see ucol_setReorderCodes
+ * @see Collator#getReorderCodes
+ * @see Collator#getEquivalentReorderCodes
+ * @see UScriptCode
+ * @see UColReorderCode
+ * @stable ICU 4.8
+ */
+ virtual void setReorderCodes(const int32_t* reorderCodes,
+ int32_t reorderCodesLength,
+ UErrorCode& status) ;
+
+ /**
+ * Retrieves the reorder codes that are grouped with the given reorder code. Some reorder
+ * codes will be grouped and must reorder together.
+ * Beginning with ICU 55, scripts only reorder together if they are primary-equal,
+ * for example Hiragana and Katakana.
+ *
+ * @param reorderCode The reorder code to determine equivalence for.
+ * @param dest The array to fill with the script equivalence reordering codes.
+ * @param destCapacity The length of dest. If it is 0, then dest may be nullptr and the
+ * function will only return the length of the result without writing any codes (pre-flighting).
+ * @param status A reference to an error code value, which must not indicate
+ * a failure before the function call.
+ * @return The length of the of the reordering code equivalence array.
+ * @see ucol_setReorderCodes
+ * @see Collator#getReorderCodes
+ * @see Collator#setReorderCodes
+ * @see UScriptCode
+ * @see UColReorderCode
+ * @stable ICU 4.8
+ */
+ static int32_t U_EXPORT2 getEquivalentReorderCodes(int32_t reorderCode,
+ int32_t* dest,
+ int32_t destCapacity,
+ UErrorCode& status);
+
+ /**
+ * Get name of the object for the desired Locale, in the desired language
+ * @param objectLocale must be from getAvailableLocales
+ * @param displayLocale specifies the desired locale for output
+ * @param name the fill-in parameter of the return value
+ * @return display-able name of the object for the object locale in the
+ * desired language
+ * @stable ICU 2.0
+ */
+ static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
+ const Locale& displayLocale,
+ UnicodeString& name);
+
+ /**
+ * Get name of the object for the desired Locale, in the language of the
+ * default locale.
+ * @param objectLocale must be from getAvailableLocales
+ * @param name the fill-in parameter of the return value
+ * @return name of the object for the desired locale in the default language
+ * @stable ICU 2.0
+ */
+ static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
+ UnicodeString& name);
+
+ /**
+ * Get the set of Locales for which Collations are installed.
+ *
+ * Note this does not include locales supported by registered collators.
+ * If collators might have been registered, use the overload of getAvailableLocales
+ * that returns a StringEnumeration.
+ * If standard locale display names are sufficient, Collator instances can
+ * be registered using registerInstance instead.
+ * Note: if the collators are to be used from C APIs, they must be instances
+ * of RuleBasedCollator.
+ * DateFormat helps you to format and parse dates for any locale. Your code can
+ * be completely independent of the locale conventions for months, days of the
+ * week, or even the calendar format: lunar vs. solar.
+ *
+ * To format a date for the current Locale, use one of the static factory
+ * methods:
+ *
+ * You can also use forms of the parse and format methods with ParsePosition and
+ * FieldPosition to allow you to
+ * User subclasses are not supported. While clients may write
+ * subclasses, such code will not necessarily work and will not be
+ * guaranteed to work stably from release to release.
+ */
+class U_I18N_API DateFormat : public Format {
+public:
+
+ /**
+ * Constants for various style patterns. These reflect the order of items in
+ * the DateTimePatterns resource. There are 4 time patterns, 4 date patterns,
+ * the default date-time pattern, and 4 date-time patterns. Each block of 4 values
+ * in the resource occurs in the order full, long, medium, short.
+ * @stable ICU 2.4
+ */
+ enum EStyle
+ {
+ kNone = -1,
+
+ kFull = 0,
+ kLong = 1,
+ kMedium = 2,
+ kShort = 3,
+
+ kDateOffset = kShort + 1,
+ // kFull + kDateOffset = 4
+ // kLong + kDateOffset = 5
+ // kMedium + kDateOffset = 6
+ // kShort + kDateOffset = 7
+
+ kDateTime = 8,
+ // Default DateTime
+
+ kDateTimeOffset = kDateTime + 1,
+ // kFull + kDateTimeOffset = 9
+ // kLong + kDateTimeOffset = 10
+ // kMedium + kDateTimeOffset = 11
+ // kShort + kDateTimeOffset = 12
+
+ // relative dates
+ kRelative = (1 << 7),
+
+ kFullRelative = (kFull | kRelative),
+
+ kLongRelative = kLong | kRelative,
+
+ kMediumRelative = kMedium | kRelative,
+
+ kShortRelative = kShort | kRelative,
+
+
+ kDefault = kMedium,
+
+
+
+ /**
+ * These constants are provided for backwards compatibility only.
+ * Please use the C++ style constants defined above.
+ */
+ FULL = kFull,
+ LONG = kLong,
+ MEDIUM = kMedium,
+ SHORT = kShort,
+ DEFAULT = kDefault,
+ DATE_OFFSET = kDateOffset,
+ NONE = kNone,
+ DATE_TIME = kDateTime
+ };
+
+ /**
+ * Destructor.
+ * @stable ICU 2.0
+ */
+ virtual ~DateFormat();
+
+ /**
+ * Clones this object polymorphically.
+ * The caller owns the result and should delete it when done.
+ * @return clone, or nullptr if an error occurred
+ * @stable ICU 2.0
+ */
+ virtual DateFormat* clone() const override = 0;
+
+ /**
+ * Equality operator. Returns true if the two formats have the same behavior.
+ * @stable ICU 2.0
+ */
+ virtual bool operator==(const Format&) const override;
+
+
+ using Format::format;
+
+ /**
+ * Format an object to produce a string. This method handles Formattable
+ * objects with a UDate type. If a the Formattable object type is not a Date,
+ * then it returns a failing UErrorCode.
+ *
+ * @param obj The object to format. Must be a Date.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.0
+ */
+ virtual UnicodeString& format(const Formattable& obj,
+ UnicodeString& appendTo,
+ FieldPosition& pos,
+ UErrorCode& status) const override;
+
+ /**
+ * Format an object to produce a string. This method handles Formattable
+ * objects with a UDate type. If a the Formattable object type is not a Date,
+ * then it returns a failing UErrorCode.
+ *
+ * @param obj The object to format. Must be a Date.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call. Field values
+ * are defined in UDateFormatField. Can be nullptr.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ virtual UnicodeString& format(const Formattable& obj,
+ UnicodeString& appendTo,
+ FieldPositionIterator* posIter,
+ UErrorCode& status) const override;
+ /**
+ * Formats a date into a date/time string. This is an abstract method which
+ * concrete subclasses must implement.
+ *
+ * On input, the FieldPosition parameter may have its "field" member filled with
+ * an enum value specifying a field. On output, the FieldPosition will be filled
+ * in with the text offsets for that field.
+ * For example, given a time text
+ * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
+ * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
+ * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
+ * Notice
+ * that if the same time field appears more than once in a pattern, the status will
+ * be set for the first occurrence of that time field. For instance,
+ * formatting a UDate to the time string "1 PM PDT (Pacific Daylight Time)"
+ * using the pattern "h a z (zzzz)" and the alignment field
+ * DateFormat::TIMEZONE_FIELD, the offsets fieldPosition.beginIndex and
+ * fieldPosition.getEndIndex will be set to 5 and 8, respectively, for the first
+ * occurrence of the timezone pattern character 'z'.
+ *
+ * @param cal Calendar set to the date and time to be formatted
+ * into a date/time string. When the calendar type is
+ * different from the internal calendar held by this
+ * DateFormat instance, the date and the time zone will
+ * be inherited from the input calendar, but other calendar
+ * field values will be calculated by the internal calendar.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param fieldPosition On input: an alignment field, if desired (see examples above)
+ * On output: the offsets of the alignment field (see examples above)
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.1
+ */
+ virtual UnicodeString& format( Calendar& cal,
+ UnicodeString& appendTo,
+ FieldPosition& fieldPosition) const = 0;
+
+ /**
+ * Formats a date into a date/time string. Subclasses should implement this method.
+ *
+ * @param cal Calendar set to the date and time to be formatted
+ * into a date/time string. When the calendar type is
+ * different from the internal calendar held by this
+ * DateFormat instance, the date and the time zone will
+ * be inherited from the input calendar, but other calendar
+ * field values will be calculated by the internal calendar.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call. Field values
+ * are defined in UDateFormatField. Can be nullptr.
+ * @param status error status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ virtual UnicodeString& format(Calendar& cal,
+ UnicodeString& appendTo,
+ FieldPositionIterator* posIter,
+ UErrorCode& status) const;
+ /**
+ * Formats a UDate into a date/time string.
+ *
+ * On input, the FieldPosition parameter may have its "field" member filled with
+ * an enum value specifying a field. On output, the FieldPosition will be filled
+ * in with the text offsets for that field.
+ * For example, given a time text
+ * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
+ * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
+ * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
+ * Notice
+ * that if the same time field appears more than once in a pattern, the status will
+ * be set for the first occurrence of that time field. For instance,
+ * formatting a UDate to the time string "1 PM PDT (Pacific Daylight Time)"
+ * using the pattern "h a z (zzzz)" and the alignment field
+ * DateFormat::TIMEZONE_FIELD, the offsets fieldPosition.beginIndex and
+ * fieldPosition.getEndIndex will be set to 5 and 8, respectively, for the first
+ * occurrence of the timezone pattern character 'z'.
+ *
+ * @param date UDate to be formatted into a date/time string.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param fieldPosition On input: an alignment field, if desired (see examples above)
+ * On output: the offsets of the alignment field (see examples above)
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.0
+ */
+ UnicodeString& format( UDate date,
+ UnicodeString& appendTo,
+ FieldPosition& fieldPosition) const;
+
+ /**
+ * Formats a UDate into a date/time string.
+ *
+ * @param date UDate to be formatted into a date/time string.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call. Field values
+ * are defined in UDateFormatField. Can be nullptr.
+ * @param status error status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ UnicodeString& format(UDate date,
+ UnicodeString& appendTo,
+ FieldPositionIterator* posIter,
+ UErrorCode& status) const;
+ /**
+ * Formats a UDate into a date/time string. If there is a problem, you won't
+ * know, using this method. Use the overloaded format() method which takes a
+ * FieldPosition& to detect formatting problems.
+ *
+ * @param date The UDate value to be formatted into a string.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.0
+ */
+ UnicodeString& format(UDate date, UnicodeString& appendTo) const;
+
+ /**
+ * Parse a date/time string. For example, a time text "07/10/96 4:5 PM, PDT"
+ * will be parsed into a UDate that is equivalent to Date(837039928046).
+ * Parsing begins at the beginning of the string and proceeds as far as
+ * possible. Assuming no parse errors were encountered, this function
+ * doesn't return any information about how much of the string was consumed
+ * by the parsing. If you need that information, use the version of
+ * parse() that takes a ParsePosition.
+ *
+ * By default, parsing is lenient: If the input is not in the form used by
+ * this object's format method but can still be parsed as a date, then the
+ * parse succeeds. Clients may insist on strict adherence to the format by
+ * calling setLenient(false).
+ * @see DateFormat::setLenient(boolean)
+ *
+ * Note that the normal date formats associated with some calendars - such
+ * as the Chinese lunar calendar - do not specify enough fields to enable
+ * dates to be parsed unambiguously. In the case of the Chinese lunar
+ * calendar, while the year within the current 60-year cycle is specified,
+ * the number of such cycles since the start date of the calendar (in the
+ * ERA field of the Calendar object) is not normally part of the format,
+ * and parsing may assume the wrong era. For cases such as this it is
+ * recommended that clients parse using the method
+ * parse(const UnicodeString&, Calendar& cal, ParsePosition&)
+ * with the Calendar passed in set to the current date, or to a date
+ * within the era/cycle that should be assumed if absent in the format.
+ *
+ * @param text The date/time string to be parsed into a UDate value.
+ * @param status Output param to be set to success/failure code. If
+ * 'text' cannot be parsed, it will be set to a failure
+ * code.
+ * @return The parsed UDate value, if successful.
+ * @stable ICU 2.0
+ */
+ virtual UDate parse( const UnicodeString& text,
+ UErrorCode& status) const;
+
+ /**
+ * Parse a date/time string beginning at the given parse position. For
+ * example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date
+ * that is equivalent to Date(837039928046).
+ *
+ * By default, parsing is lenient: If the input is not in the form used by
+ * this object's format method but can still be parsed as a date, then the
+ * parse succeeds. Clients may insist on strict adherence to the format by
+ * calling setLenient(false).
+ * @see DateFormat::setLenient(boolean)
+ *
+ * @param text The date/time string to be parsed.
+ * @param cal A Calendar set on input to the date and time to be used for
+ * missing values in the date/time string being parsed, and set
+ * on output to the parsed date/time. When the calendar type is
+ * different from the internal calendar held by this DateFormat
+ * instance, the internal calendar will be cloned to a work
+ * calendar set to the same milliseconds and time zone as the
+ * cal parameter, field values will be parsed based on the work
+ * calendar, then the result (milliseconds and time zone) will
+ * be set in this calendar.
+ * @param pos On input, the position at which to start parsing; on
+ * output, the position at which parsing terminated, or the
+ * start position if the parse failed.
+ * @stable ICU 2.1
+ */
+ virtual void parse( const UnicodeString& text,
+ Calendar& cal,
+ ParsePosition& pos) const = 0;
+
+ /**
+ * Parse a date/time string beginning at the given parse position. For
+ * example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date
+ * that is equivalent to Date(837039928046).
+ *
+ * By default, parsing is lenient: If the input is not in the form used by
+ * this object's format method but can still be parsed as a date, then the
+ * parse succeeds. Clients may insist on strict adherence to the format by
+ * calling setLenient(false).
+ * @see DateFormat::setLenient(boolean)
+ *
+ * Note that the normal date formats associated with some calendars - such
+ * as the Chinese lunar calendar - do not specify enough fields to enable
+ * dates to be parsed unambiguously. In the case of the Chinese lunar
+ * calendar, while the year within the current 60-year cycle is specified,
+ * the number of such cycles since the start date of the calendar (in the
+ * ERA field of the Calendar object) is not normally part of the format,
+ * and parsing may assume the wrong era. For cases such as this it is
+ * recommended that clients parse using the method
+ * parse(const UnicodeString&, Calendar& cal, ParsePosition&)
+ * with the Calendar passed in set to the current date, or to a date
+ * within the era/cycle that should be assumed if absent in the format.
+ *
+ * @param text The date/time string to be parsed into a UDate value.
+ * @param pos On input, the position at which to start parsing; on
+ * output, the position at which parsing terminated, or the
+ * start position if the parse failed.
+ * @return A valid UDate if the input could be parsed.
+ * @stable ICU 2.0
+ */
+ UDate parse( const UnicodeString& text,
+ ParsePosition& pos) const;
+
+ /**
+ * Parse a string to produce an object. This methods handles parsing of
+ * date/time strings into Formattable objects with UDate types.
+ *
+ * Before calling, set parse_pos.index to the offset you want to start
+ * parsing at in the source. After calling, parse_pos.index is the end of
+ * the text you parsed. If error occurs, index is unchanged.
+ *
+ * When parsing, leading whitespace is discarded (with a successful parse),
+ * while trailing whitespace is left as is.
+ *
+ * See Format::parseObject() for more.
+ *
+ * @param source The string to be parsed into an object.
+ * @param result Formattable to be set to the parse result.
+ * If parse fails, return contents are undefined.
+ * @param parse_pos The position to start parsing at. Upon return
+ * this param is set to the position after the
+ * last character successfully parsed. If the
+ * source is not parsed successfully, this param
+ * will remain unchanged.
+ * @stable ICU 2.0
+ */
+ virtual void parseObject(const UnicodeString& source,
+ Formattable& result,
+ ParsePosition& parse_pos) const override;
+
+ /**
+ * Create a default date/time formatter that uses the SHORT style for both
+ * the date and the time.
+ *
+ * @return A date/time formatter which the caller owns.
+ * @stable ICU 2.0
+ */
+ static DateFormat* U_EXPORT2 createInstance();
+
+ /**
+ * Creates a time formatter with the given formatting style for the given
+ * locale.
+ *
+ * @param style The given formatting style. For example,
+ * SHORT for "h:mm a" in the US locale. Relative
+ * time styles are not currently supported.
+ * @param aLocale The given locale.
+ * @return A time formatter which the caller owns.
+ * @stable ICU 2.0
+ */
+ static DateFormat* U_EXPORT2 createTimeInstance(EStyle style = kDefault,
+ const Locale& aLocale = Locale::getDefault());
+
+ /**
+ * Creates a date formatter with the given formatting style for the given
+ * const locale.
+ *
+ * @param style The given formatting style. For example, SHORT for "M/d/yy" in the
+ * US locale. As currently implemented, relative date formatting only
+ * affects a limited range of calendar days before or after the
+ * current date, based on the CLDR <field type="day">/<relative> data:
+ * For example, in English, "Yesterday", "Today", and "Tomorrow".
+ * Outside of this range, dates are formatted using the corresponding
+ * non-relative style.
+ * @param aLocale The given locale.
+ * @return A date formatter which the caller owns.
+ * @stable ICU 2.0
+ */
+ static DateFormat* U_EXPORT2 createDateInstance(EStyle style = kDefault,
+ const Locale& aLocale = Locale::getDefault());
+
+ /**
+ * Creates a date/time formatter with the given formatting styles for the
+ * given locale.
+ *
+ * @param dateStyle The given formatting style for the date portion of the result.
+ * For example, SHORT for "M/d/yy" in the US locale. As currently
+ * implemented, relative date formatting only affects a limited range
+ * of calendar days before or after the current date, based on the
+ * CLDR <field type="day">/<relative> data: For example, in English,
+ * "Yesterday", "Today", and "Tomorrow". Outside of this range, dates
+ * are formatted using the corresponding non-relative style.
+ * @param timeStyle The given formatting style for the time portion of the result.
+ * For example, SHORT for "h:mm a" in the US locale. Relative
+ * time styles are not currently supported.
+ * @param aLocale The given locale.
+ * @return A date/time formatter which the caller owns.
+ * @stable ICU 2.0
+ */
+ static DateFormat* U_EXPORT2 createDateTimeInstance(EStyle dateStyle = kDefault,
+ EStyle timeStyle = kDefault,
+ const Locale& aLocale = Locale::getDefault());
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Returns the best pattern given a skeleton and locale.
+ * @param locale the locale
+ * @param skeleton the skeleton
+ * @param status ICU error returned here
+ * @return the best pattern.
+ * @internal For ICU use only.
+ */
+ static UnicodeString getBestPattern(
+ const Locale &locale,
+ const UnicodeString &skeleton,
+ UErrorCode &status);
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Creates a date/time formatter for the given skeleton and
+ * default locale.
+ *
+ * @param skeleton The skeleton e.g "yMMMMd." Fields in the skeleton can
+ * be in any order, and this method uses the locale to
+ * map the skeleton to a pattern that includes locale
+ * specific separators with the fields in the appropriate
+ * order for that locale.
+ * @param status Any error returned here.
+ * @return A date/time formatter which the caller owns.
+ * @stable ICU 55
+ */
+ static DateFormat* U_EXPORT2 createInstanceForSkeleton(
+ const UnicodeString& skeleton,
+ UErrorCode &status);
+
+ /**
+ * Creates a date/time formatter for the given skeleton and locale.
+ *
+ * @param skeleton The skeleton e.g "yMMMMd." Fields in the skeleton can
+ * be in any order, and this method uses the locale to
+ * map the skeleton to a pattern that includes locale
+ * specific separators with the fields in the appropriate
+ * order for that locale.
+ * @param locale The given locale.
+ * @param status Any error returned here.
+ * @return A date/time formatter which the caller owns.
+ * @stable ICU 55
+ */
+ static DateFormat* U_EXPORT2 createInstanceForSkeleton(
+ const UnicodeString& skeleton,
+ const Locale &locale,
+ UErrorCode &status);
+
+ /**
+ * Creates a date/time formatter for the given skeleton and locale.
+ *
+ * @param calendarToAdopt the calendar returned DateFormat is to use.
+ * @param skeleton The skeleton e.g "yMMMMd." Fields in the skeleton can
+ * be in any order, and this method uses the locale to
+ * map the skeleton to a pattern that includes locale
+ * specific separators with the fields in the appropriate
+ * order for that locale.
+ * @param locale The given locale.
+ * @param status Any error returned here.
+ * @return A date/time formatter which the caller owns.
+ * @stable ICU 55
+ */
+ static DateFormat* U_EXPORT2 createInstanceForSkeleton(
+ Calendar *calendarToAdopt,
+ const UnicodeString& skeleton,
+ const Locale &locale,
+ UErrorCode &status);
+
+
+ /**
+ * Gets the set of locales for which DateFormats are installed.
+ * @param count Filled in with the number of locales in the list that is returned.
+ * @return the set of locales for which DateFormats are installed. The caller
+ * does NOT own this list and must not delete it.
+ * @stable ICU 2.0
+ */
+ static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
+
+ /**
+ * Returns whether both date/time parsing in the encapsulated Calendar object and DateFormat whitespace &
+ * numeric processing is lenient.
+ * @stable ICU 2.0
+ */
+ virtual UBool isLenient() const;
+
+ /**
+ * Specifies whether date/time parsing is to be lenient. With
+ * lenient parsing, the parser may use heuristics to interpret inputs that
+ * do not precisely match this object's format. Without lenient parsing,
+ * inputs must match this object's format more closely.
+ *
+ * Note: ICU 53 introduced finer grained control of leniency (and added
+ * new control points) making the preferred method a combination of
+ * setCalendarLenient() & setBooleanAttribute() calls.
+ * This method supports prior functionality but may not support all
+ * future leniency control & behavior of DateFormat. For control of pre 53 leniency,
+ * Calendar and DateFormat whitespace & numeric tolerance, this method is safe to
+ * use. However, mixing leniency control via this method and modification of the
+ * newer attributes via setBooleanAttribute() may produce undesirable
+ * results.
+ *
+ * @param lenient True specifies date/time interpretation to be lenient.
+ * @see Calendar::setLenient
+ * @stable ICU 2.0
+ */
+ virtual void setLenient(UBool lenient);
+
+
+ /**
+ * Returns whether date/time parsing in the encapsulated Calendar object processing is lenient.
+ * @stable ICU 53
+ */
+ virtual UBool isCalendarLenient() const;
+
+ /**
+ * Specifies whether encapsulated Calendar date/time parsing is to be lenient. With
+ * lenient parsing, the parser may use heuristics to interpret inputs that
+ * do not precisely match this object's format. Without lenient parsing,
+ * inputs must match this object's format more closely.
+ * @param lenient when true, parsing is lenient
+ * @see com.ibm.icu.util.Calendar#setLenient
+ * @stable ICU 53
+ */
+ virtual void setCalendarLenient(UBool lenient);
+
+
+ /**
+ * Gets the calendar associated with this date/time formatter.
+ * The calendar is owned by the formatter and must not be modified.
+ * Also, the calendar does not reflect the results of a parse operation.
+ * To parse to a calendar, use {@link #parse(const UnicodeString&, Calendar& cal, ParsePosition&) const parse(const UnicodeString&, Calendar& cal, ParsePosition&)}
+ * @return the calendar associated with this date/time formatter.
+ * @stable ICU 2.0
+ */
+ virtual const Calendar* getCalendar() const;
+
+ /**
+ * Set the calendar to be used by this date format. Initially, the default
+ * calendar for the specified or default locale is used. The caller should
+ * not delete the Calendar object after it is adopted by this call.
+ * Adopting a new calendar will change to the default symbols.
+ *
+ * @param calendarToAdopt Calendar object to be adopted.
+ * @stable ICU 2.0
+ */
+ virtual void adoptCalendar(Calendar* calendarToAdopt);
+
+ /**
+ * Set the calendar to be used by this date format. Initially, the default
+ * calendar for the specified or default locale is used.
+ *
+ * @param newCalendar Calendar object to be set.
+ * @stable ICU 2.0
+ */
+ virtual void setCalendar(const Calendar& newCalendar);
+
+
+ /**
+ * Gets the number formatter which this date/time formatter uses to format
+ * and parse the numeric portions of the pattern.
+ * @return the number formatter which this date/time formatter uses.
+ * @stable ICU 2.0
+ */
+ virtual const NumberFormat* getNumberFormat() const;
+
+ /**
+ * Allows you to set the number formatter. The caller should
+ * not delete the NumberFormat object after it is adopted by this call.
+ * @param formatToAdopt NumberFormat object to be adopted.
+ * @stable ICU 2.0
+ */
+ virtual void adoptNumberFormat(NumberFormat* formatToAdopt);
+
+ /**
+ * Allows you to set the number formatter.
+ * @param newNumberFormat NumberFormat object to be set.
+ * @stable ICU 2.0
+ */
+ virtual void setNumberFormat(const NumberFormat& newNumberFormat);
+
+ /**
+ * Returns a reference to the TimeZone used by this DateFormat's calendar.
+ * @return the time zone associated with the calendar of DateFormat.
+ * @stable ICU 2.0
+ */
+ virtual const TimeZone& getTimeZone() const;
+
+ /**
+ * Sets the time zone for the calendar of this DateFormat object. The caller
+ * no longer owns the TimeZone object and should not delete it after this call.
+ * @param zoneToAdopt the TimeZone to be adopted.
+ * @stable ICU 2.0
+ */
+ virtual void adoptTimeZone(TimeZone* zoneToAdopt);
+
+ /**
+ * Sets the time zone for the calendar of this DateFormat object.
+ * @param zone the new time zone.
+ * @stable ICU 2.0
+ */
+ virtual void setTimeZone(const TimeZone& zone);
+
+ /**
+ * Set a particular UDisplayContext value in the formatter, such as
+ * UDISPCTX_CAPITALIZATION_FOR_STANDALONE.
+ * @param value The UDisplayContext value to set.
+ * @param status Input/output status. If at entry this indicates a failure
+ * status, the function will do nothing; otherwise this will be
+ * updated with any new status from the function.
+ * @stable ICU 53
+ */
+ virtual void setContext(UDisplayContext value, UErrorCode& status);
+
+ /**
+ * Get the formatter's UDisplayContext value for the specified UDisplayContextType,
+ * such as UDISPCTX_TYPE_CAPITALIZATION.
+ * @param type The UDisplayContextType whose value to return
+ * @param status Input/output status. If at entry this indicates a failure
+ * status, the function will do nothing; otherwise this will be
+ * updated with any new status from the function.
+ * @return The UDisplayContextValue for the specified type.
+ * @stable ICU 53
+ */
+ virtual UDisplayContext getContext(UDisplayContextType type, UErrorCode& status) const;
+
+ /**
+ * Sets an boolean attribute on this DateFormat.
+ * May return U_UNSUPPORTED_ERROR if this instance does not support
+ * the specified attribute.
+ * @param attr the attribute to set
+ * @param newvalue new value
+ * @param status the error type
+ * @return *this - for chaining (example: format.setAttribute(...).setAttribute(...) )
+ * @stable ICU 53
+ */
+
+ virtual DateFormat& U_EXPORT2 setBooleanAttribute(UDateFormatBooleanAttribute attr,
+ UBool newvalue,
+ UErrorCode &status);
+
+ /**
+ * Returns a boolean from this DateFormat
+ * May return U_UNSUPPORTED_ERROR if this instance does not support
+ * the specified attribute.
+ * @param attr the attribute to set
+ * @param status the error type
+ * @return the attribute value. Undefined if there is an error.
+ * @stable ICU 53
+ */
+ virtual UBool U_EXPORT2 getBooleanAttribute(UDateFormatBooleanAttribute attr, UErrorCode &status) const;
+
+protected:
+ /**
+ * Default constructor. Creates a DateFormat with no Calendar or NumberFormat
+ * associated with it. This constructor depends on the subclasses to fill in
+ * the calendar and numberFormat fields.
+ * @stable ICU 2.0
+ */
+ DateFormat();
+
+ /**
+ * Copy constructor.
+ * @stable ICU 2.0
+ */
+ DateFormat(const DateFormat&);
+
+ /**
+ * Default assignment operator.
+ * @stable ICU 2.0
+ */
+ DateFormat& operator=(const DateFormat&);
+
+ /**
+ * The calendar that DateFormat uses to produce the time field values needed
+ * to implement date/time formatting. Subclasses should generally initialize
+ * this to the default calendar for the locale associated with this DateFormat.
+ * @stable ICU 2.4
+ */
+ Calendar* fCalendar;
+
+ /**
+ * The number formatter that DateFormat uses to format numbers in dates and
+ * times. Subclasses should generally initialize this to the default number
+ * format for the locale associated with this DateFormat.
+ * @stable ICU 2.4
+ */
+ NumberFormat* fNumberFormat;
+
+
+private:
+
+ /**
+ * Gets the date/time formatter with the given formatting styles for the
+ * given locale.
+ * @param dateStyle the given date formatting style.
+ * @param timeStyle the given time formatting style.
+ * @param inLocale the given locale.
+ * @return a date/time formatter, or 0 on failure.
+ */
+ static DateFormat* U_EXPORT2 create(EStyle timeStyle, EStyle dateStyle, const Locale& inLocale);
+
+
+ /**
+ * enum set of active boolean attributes for this instance
+ */
+ EnumSet
+ * Here are the special characters used in the parts of the
+ * subpattern, with notes on their usage.
+ *
+ * If there is no explicit negative subpattern, - is prefixed to the
+ * positive form. That is, "0.00" alone is equivalent to "0.00;-0.00".
+ *
+ * The grouping separator is commonly used for thousands, but in some
+ * countries for ten-thousands. The interval is a constant number of
+ * digits between the grouping characters, such as 100,000,000 or 1,0000,0000.
+ * If you supply a pattern with multiple grouping characters, the interval
+ * between the last one and the end of the integer is the one that is
+ * used. So "#,##,###,####" == "######,####" == "##,####,####".
+ */
+class U_I18N_API DecimalFormatSymbols : public UObject {
+public:
+ /**
+ * Constants for specifying a number format symbol.
+ * @stable ICU 2.0
+ */
+ enum ENumberFormatSymbol {
+ /** The decimal separator */
+ kDecimalSeparatorSymbol,
+ /** The grouping separator */
+ kGroupingSeparatorSymbol,
+ /** The pattern separator */
+ kPatternSeparatorSymbol,
+ /** The percent sign */
+ kPercentSymbol,
+ /** Zero*/
+ kZeroDigitSymbol,
+ /** Character representing a digit in the pattern */
+ kDigitSymbol,
+ /** The minus sign */
+ kMinusSignSymbol,
+ /** The plus sign */
+ kPlusSignSymbol,
+ /** The currency symbol */
+ kCurrencySymbol,
+ /** The international currency symbol */
+ kIntlCurrencySymbol,
+ /** The monetary separator */
+ kMonetarySeparatorSymbol,
+ /** The exponential symbol */
+ kExponentialSymbol,
+ /** Per mill symbol - replaces kPermillSymbol */
+ kPerMillSymbol,
+ /** Escape padding character */
+ kPadEscapeSymbol,
+ /** Infinity symbol */
+ kInfinitySymbol,
+ /** Nan symbol */
+ kNaNSymbol,
+ /** Significant digit symbol
+ * @stable ICU 3.0 */
+ kSignificantDigitSymbol,
+ /** The monetary grouping separator
+ * @stable ICU 3.6
+ */
+ kMonetaryGroupingSeparatorSymbol,
+ /** One
+ * @stable ICU 4.6
+ */
+ kOneDigitSymbol,
+ /** Two
+ * @stable ICU 4.6
+ */
+ kTwoDigitSymbol,
+ /** Three
+ * @stable ICU 4.6
+ */
+ kThreeDigitSymbol,
+ /** Four
+ * @stable ICU 4.6
+ */
+ kFourDigitSymbol,
+ /** Five
+ * @stable ICU 4.6
+ */
+ kFiveDigitSymbol,
+ /** Six
+ * @stable ICU 4.6
+ */
+ kSixDigitSymbol,
+ /** Seven
+ * @stable ICU 4.6
+ */
+ kSevenDigitSymbol,
+ /** Eight
+ * @stable ICU 4.6
+ */
+ kEightDigitSymbol,
+ /** Nine
+ * @stable ICU 4.6
+ */
+ kNineDigitSymbol,
+ /** Multiplication sign.
+ * @stable ICU 54
+ */
+ kExponentMultiplicationSymbol,
+#ifndef U_HIDE_INTERNAL_API
+ /** Approximately sign.
+ * @internal
+ */
+ kApproximatelySignSymbol,
+#endif /* U_HIDE_INTERNAL_API */
+ /** count symbol constants */
+ kFormatSymbolCount = kExponentMultiplicationSymbol + 2
+ };
+
+ /**
+ * Create a DecimalFormatSymbols object for the given locale.
+ *
+ * @param locale The locale to get symbols for.
+ * @param status Input/output parameter, set to success or
+ * failure code upon return.
+ * @stable ICU 2.0
+ */
+ DecimalFormatSymbols(const Locale& locale, UErrorCode& status);
+
+ /**
+ * Creates a DecimalFormatSymbols instance for the given locale with digits and symbols
+ * corresponding to the given NumberingSystem.
+ *
+ * This constructor behaves equivalently to the normal constructor called with a locale having a
+ * "numbers=xxxx" keyword specifying the numbering system by name.
+ *
+ * In this constructor, the NumberingSystem argument will be used even if the locale has its own
+ * "numbers=xxxx" keyword.
+ *
+ * @param locale The locale to get symbols for.
+ * @param ns The numbering system.
+ * @param status Input/output parameter, set to success or
+ * failure code upon return.
+ * @stable ICU 60
+ */
+ DecimalFormatSymbols(const Locale& locale, const NumberingSystem& ns, UErrorCode& status);
+
+ /**
+ * Create a DecimalFormatSymbols object for the default locale.
+ * This constructor will not fail. If the resource file data is
+ * not available, it will use hard-coded last-resort data and
+ * set status to U_USING_FALLBACK_ERROR.
+ *
+ * @param status Input/output parameter, set to success or
+ * failure code upon return.
+ * @stable ICU 2.0
+ */
+ DecimalFormatSymbols(UErrorCode& status);
+
+ /**
+ * Creates a DecimalFormatSymbols object with last-resort data.
+ * Intended for callers who cache the symbols data and
+ * set all symbols on the resulting object.
+ *
+ * The last-resort symbols are similar to those for the root data,
+ * except that the grouping separators are empty,
+ * the NaN symbol is U+FFFD rather than "NaN",
+ * and the CurrencySpacing patterns are empty.
+ *
+ * @param status Input/output parameter, set to success or
+ * failure code upon return.
+ * @return last-resort symbols
+ * @stable ICU 52
+ */
+ static DecimalFormatSymbols* createWithLastResortData(UErrorCode& status);
+
+ /**
+ * Copy constructor.
+ * @stable ICU 2.0
+ */
+ DecimalFormatSymbols(const DecimalFormatSymbols&);
+
+ /**
+ * Assignment operator.
+ * @stable ICU 2.0
+ */
+ DecimalFormatSymbols& operator=(const DecimalFormatSymbols&);
+
+ /**
+ * Destructor.
+ * @stable ICU 2.0
+ */
+ virtual ~DecimalFormatSymbols();
+
+ /**
+ * Return true if another object is semantically equal to this one.
+ *
+ * @param other the object to be compared with.
+ * @return true if another object is semantically equal to this one.
+ * @stable ICU 2.0
+ */
+ bool operator==(const DecimalFormatSymbols& other) const;
+
+ /**
+ * Return true if another object is semantically unequal to this one.
+ *
+ * @param other the object to be compared with.
+ * @return true if another object is semantically unequal to this one.
+ * @stable ICU 2.0
+ */
+ bool operator!=(const DecimalFormatSymbols& other) const { return !operator==(other); }
+
+ /**
+ * Get one of the format symbols by its enum constant.
+ * Each symbol is stored as a string so that graphemes
+ * (characters with modifier letters) can be used.
+ *
+ * @param symbol Constant to indicate a number format symbol.
+ * @return the format symbols by the param 'symbol'
+ * @stable ICU 2.0
+ */
+ inline UnicodeString getSymbol(ENumberFormatSymbol symbol) const;
+
+ /**
+ * Set one of the format symbols by its enum constant.
+ * Each symbol is stored as a string so that graphemes
+ * (characters with modifier letters) can be used.
+ *
+ * @param symbol Constant to indicate a number format symbol.
+ * @param value value of the format symbol
+ * @param propagateDigits If false, setting the zero digit will not automatically set 1-9.
+ * The default behavior is to automatically set 1-9 if zero is being set and the value
+ * it is being set to corresponds to a known Unicode zero digit.
+ * @stable ICU 2.0
+ */
+ void setSymbol(ENumberFormatSymbol symbol, const UnicodeString &value, const UBool propagateDigits);
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Loads symbols for the specified currency into this instance.
+ *
+ * This method is internal. If you think it should be public, file a ticket.
+ *
+ * @internal
+ */
+ void setCurrency(const char16_t* currency, UErrorCode& status);
+#endif // U_HIDE_INTERNAL_API
+
+ /**
+ * Returns the locale for which this object was constructed.
+ * @stable ICU 2.6
+ */
+ inline Locale getLocale() const;
+
+ /**
+ * Returns the locale for this object. Two flavors are available:
+ * valid and actual locale.
+ * @stable ICU 2.8
+ */
+ Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
+
+ /**
+ * Get pattern string for 'CurrencySpacing' that can be applied to
+ * currency format.
+ * This API gets the CurrencySpacing data from ResourceBundle. The pattern can
+ * be empty if there is no data from current locale and its parent locales.
+ *
+ * @param type : UNUM_CURRENCY_MATCH, UNUM_CURRENCY_SURROUNDING_MATCH or UNUM_CURRENCY_INSERT.
+ * @param beforeCurrency : true if the pattern is for before currency symbol.
+ * false if the pattern is for after currency symbol.
+ * @param status: Input/output parameter, set to success or
+ * failure code upon return.
+ * @return pattern string for currencyMatch, surroundingMatch or spaceInsert.
+ * Return empty string if there is no data for this locale and its parent
+ * locales.
+ * @stable ICU 4.8
+ */
+ const UnicodeString& getPatternForCurrencySpacing(UCurrencySpacing type,
+ UBool beforeCurrency,
+ UErrorCode& status) const;
+ /**
+ * Set pattern string for 'CurrencySpacing' that can be applied to
+ * currency format.
+ *
+ * @param type : UNUM_CURRENCY_MATCH, UNUM_CURRENCY_SURROUNDING_MATCH or UNUM_CURRENCY_INSERT.
+ * @param beforeCurrency : true if the pattern is for before currency symbol.
+ * false if the pattern is for after currency symbol.
+ * @param pattern : pattern string to override current setting.
+ * @stable ICU 4.8
+ */
+ void setPatternForCurrencySpacing(UCurrencySpacing type,
+ UBool beforeCurrency,
+ const UnicodeString& pattern);
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for the actual class.
+ *
+ * @stable ICU 2.2
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for this class.
+ *
+ * @stable ICU 2.2
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+private:
+ DecimalFormatSymbols();
+
+ /**
+ * Initializes the symbols from the LocaleElements resource bundle.
+ * Note: The organization of LocaleElements badly needs to be
+ * cleaned up.
+ *
+ * @param locale The locale to get symbols for.
+ * @param success Input/output parameter, set to success or
+ * failure code upon return.
+ * @param useLastResortData determine if use last resort data
+ * @param ns The NumberingSystem to use; otherwise, fall
+ * back to the locale.
+ */
+ void initialize(const Locale& locale, UErrorCode& success,
+ UBool useLastResortData = false, const NumberingSystem* ns = nullptr);
+
+ /**
+ * Initialize the symbols with default values.
+ */
+ void initialize();
+
+public:
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * @internal For ICU use only
+ */
+ inline UBool isCustomCurrencySymbol() const {
+ return fIsCustomCurrencySymbol;
+ }
+
+ /**
+ * @internal For ICU use only
+ */
+ inline UBool isCustomIntlCurrencySymbol() const {
+ return fIsCustomIntlCurrencySymbol;
+ }
+
+ /**
+ * @internal For ICU use only
+ */
+ inline UChar32 getCodePointZero() const {
+ return fCodePointZero;
+ }
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * _Internal_ function - more efficient version of getSymbol,
+ * returning a const reference to one of the symbol strings.
+ * The returned reference becomes invalid when the symbol is changed
+ * or when the DecimalFormatSymbols are destroyed.
+ * Note: moved \#ifndef U_HIDE_INTERNAL_API after this, since this is needed for inline in DecimalFormat
+ *
+ * This is not currently stable API, but if you think it should be stable,
+ * post a comment on the following ticket and the ICU team will take a look:
+ * https://unicode-org.atlassian.net/browse/ICU-13580
+ *
+ * @param symbol Constant to indicate a number format symbol.
+ * @return the format symbol by the param 'symbol'
+ * @internal
+ */
+ inline const UnicodeString& getConstSymbol(ENumberFormatSymbol symbol) const;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Returns the const UnicodeString reference, like getConstSymbol,
+ * corresponding to the digit with the given value. This is equivalent
+ * to accessing the symbol from getConstSymbol with the corresponding
+ * key, such as kZeroDigitSymbol or kOneDigitSymbol.
+ *
+ * This is not currently stable API, but if you think it should be stable,
+ * post a comment on the following ticket and the ICU team will take a look:
+ * https://unicode-org.atlassian.net/browse/ICU-13580
+ *
+ * @param digit The digit, an integer between 0 and 9 inclusive.
+ * If outside the range 0 to 9, the zero digit is returned.
+ * @return the format symbol for the given digit.
+ * @internal This API is currently for ICU use only.
+ */
+ inline const UnicodeString& getConstDigitSymbol(int32_t digit) const;
+
+ /**
+ * Returns that pattern stored in currency info. Internal API for use by NumberFormat API.
+ * @internal
+ */
+ inline const char16_t* getCurrencyPattern() const;
+
+ /**
+ * Returns the numbering system with which this DecimalFormatSymbols was initialized.
+ * @internal
+ */
+ inline const char* getNumberingSystemName() const;
+#endif /* U_HIDE_INTERNAL_API */
+
+private:
+ /**
+ * Private symbol strings.
+ * They are either loaded from a resource bundle or otherwise owned.
+ * setSymbol() clones the symbol string.
+ * Readonly aliases can only come from a resource bundle, so that we can always
+ * use fastCopyFrom() with them.
+ *
+ * If DecimalFormatSymbols becomes subclassable and the status of fSymbols changes
+ * from private to protected,
+ * or when fSymbols can be set any other way that allows them to be readonly aliases
+ * to non-resource bundle strings,
+ * then regular UnicodeString copies must be used instead of fastCopyFrom().
+ *
+ */
+ UnicodeString fSymbols[kFormatSymbolCount];
+
+ /**
+ * Non-symbol variable for getConstSymbol(). Always empty.
+ */
+ UnicodeString fNoSymbol;
+
+ /**
+ * Dealing with code points is faster than dealing with strings when formatting. Because of
+ * this, we maintain a value containing the zero code point that is used whenever digitStrings
+ * represents a sequence of ten code points in order.
+ *
+ * If the value stored here is positive, it means that the code point stored in this value
+ * corresponds to the digitStrings array, and codePointZero can be used instead of the
+ * digitStrings array for the purposes of efficient formatting; if -1, then digitStrings does
+ * *not* contain a sequence of code points, and it must be used directly.
+ *
+ * It is assumed that codePointZero always shadows the value in digitStrings. codePointZero
+ * should never be set directly; rather, it should be updated only when digitStrings mutates.
+ * That is, the flow of information is digitStrings -> codePointZero, not the other way.
+ */
+ UChar32 fCodePointZero;
+
+ Locale locale;
+
+ CharString* actualLocale = nullptr;
+ CharString* validLocale = nullptr;
+ const char16_t* currPattern = nullptr;
+
+ UnicodeString currencySpcBeforeSym[UNUM_CURRENCY_SPACING_COUNT];
+ UnicodeString currencySpcAfterSym[UNUM_CURRENCY_SPACING_COUNT];
+ UBool fIsCustomCurrencySymbol;
+ UBool fIsCustomIntlCurrencySymbol;
+ char nsName[kInternalNumSysNameCapacity+1] = {};
+};
+
+// -------------------------------------
+
+inline UnicodeString
+DecimalFormatSymbols::getSymbol(ENumberFormatSymbol symbol) const {
+ const UnicodeString *strPtr;
+ if(symbol < kFormatSymbolCount) {
+ strPtr = &fSymbols[symbol];
+ } else {
+ strPtr = &fNoSymbol;
+ }
+ return *strPtr;
+}
+
+// See comments above for this function. Not hidden with #ifdef U_HIDE_INTERNAL_API
+inline const UnicodeString &
+DecimalFormatSymbols::getConstSymbol(ENumberFormatSymbol symbol) const {
+ const UnicodeString *strPtr;
+ if(symbol < kFormatSymbolCount) {
+ strPtr = &fSymbols[symbol];
+ } else {
+ strPtr = &fNoSymbol;
+ }
+ return *strPtr;
+}
+
+#ifndef U_HIDE_INTERNAL_API
+inline const UnicodeString& DecimalFormatSymbols::getConstDigitSymbol(int32_t digit) const {
+ if (digit < 0 || digit > 9) {
+ digit = 0;
+ }
+ if (digit == 0) {
+ return fSymbols[kZeroDigitSymbol];
+ }
+ ENumberFormatSymbol key = static_cast Patterns
+ *
+ * A DecimalFormat consists of a pattern and a set of
+ * symbols. The pattern may be set directly using
+ * applyPattern(), or indirectly using other API methods which
+ * manipulate aspects of the pattern, such as the minimum number of integer
+ * digits. The symbols are stored in a DecimalFormatSymbols
+ * object. When using the NumberFormat factory methods, the
+ * pattern and symbols are read from ICU's locale data.
+ *
+ * Special Pattern Characters
+ *
+ * Many characters in a pattern are taken literally; they are matched during
+ * parsing and output unchanged during formatting. Special characters, on the
+ * other hand, stand for other characters, strings, or classes of characters.
+ * For example, the '#' character is replaced by a localized digit. Often the
+ * replacement character is the same as the pattern character; in the U.S. locale,
+ * the ',' grouping character is replaced by ','. However, the replacement is
+ * still happening, and if the symbols are modified, the grouping character
+ * changes. Some special characters affect the behavior of the formatter by
+ * their presence; for example, if the percent character is seen, then the
+ * value is multiplied by 100 before being displayed.
+ *
+ * To insert a special character in a pattern as a literal, that is, without
+ * any special meaning, the character must be quoted. There are some exceptions to
+ * this which are noted below.
+ *
+ * The characters listed here are used in non-localized patterns. Localized
+ * patterns use the corresponding characters taken from this formatter's
+ * DecimalFormatSymbols object instead, and these characters lose
+ * their special status. Two exceptions are the currency sign and quote, which
+ * are not localized.
+ *
+ * A DecimalFormat pattern contains a positive and negative
+ * subpattern, for example, "#,##0.00;(#,##0.00)". Each subpattern has a
+ * prefix, a numeric part, and a suffix. If there is no explicit negative
+ * subpattern, the negative subpattern is the localized minus sign prefixed to the
+ * positive subpattern. That is, "0.00" alone is equivalent to "0.00;-0.00". If there
+ * is an explicit negative subpattern, it serves only to specify the negative
+ * prefix and suffix; the number of digits, minimal digits, and other
+ * characteristics are ignored in the negative subpattern. That means that
+ * "#,##0.0#;(#)" has precisely the same result as "#,##0.0#;(#,##0.0#)".
+ *
+ * The prefixes, suffixes, and various symbols used for infinity, digits,
+ * thousands separators, decimal separators, etc. may be set to arbitrary
+ * values, and they will appear properly during formatting. However, care must
+ * be taken that the symbols and strings do not conflict, or parsing will be
+ * unreliable. For example, either the positive and negative prefixes or the
+ * suffixes must be distinct for parse() to be able
+ * to distinguish positive from negative values. Another example is that the
+ * decimal separator and thousands separator should be distinct characters, or
+ * parsing will be impossible.
+ *
+ * The grouping separator is a character that separates clusters of
+ * integer digits to make large numbers more legible. It commonly used for
+ * thousands, but in some locales it separates ten-thousands. The grouping
+ * size is the number of digits between the grouping separators, such as 3
+ * for "100,000,000" or 4 for "1 0000 0000". There are actually two different
+ * grouping sizes: One used for the least significant integer digits, the
+ * primary grouping size, and one used for all others, the
+ * secondary grouping size. In most locales these are the same, but
+ * sometimes they are different. For example, if the primary grouping interval
+ * is 3, and the secondary is 2, then this corresponds to the pattern
+ * "#,##,##0", and the number 123456789 is formatted as "12,34,56,789". If a
+ * pattern contains multiple grouping separators, the interval between the last
+ * one and the end of the integer defines the primary grouping size, and the
+ * interval between the last two defines the secondary grouping size. All others
+ * are ignored, so "#,##,###,####" == "###,###,####" == "##,#,###,####".
+ *
+ * Illegal patterns, such as "#.#.#" or "#.###,###", will cause
+ * DecimalFormat to set a failing UErrorCode.
+ *
+ * Pattern BNF
+ *
+ * Not indicated in the BNF syntax above:
+ *
+ * Parsing
+ *
+ * DecimalFormat parses all Unicode characters that represent
+ * decimal digits, as defined by u_charDigitValue(). In addition,
+ * DecimalFormat also recognizes as digits the ten consecutive
+ * characters starting with the localized zero digit defined in the
+ * DecimalFormatSymbols object. During formatting, the
+ * DecimalFormatSymbols-based digits are output.
+ *
+ * During parsing, grouping separators are ignored if in lenient mode;
+ * otherwise, if present, they must be in appropriate positions.
+ *
+ * For currency parsing, the formatter is able to parse every currency
+ * style formats no matter which style the formatter is constructed with.
+ * For example, a formatter instance gotten from
+ * NumberFormat.getInstance(ULocale, NumberFormat.CURRENCYSTYLE) can parse
+ * formats such as "USD1.00" and "3.00 US dollars".
+ *
+ * If parse(UnicodeString&,Formattable&,ParsePosition&)
+ * fails to parse a string, it leaves the parse position unchanged.
+ * The convenience method parse(UnicodeString&,Formattable&,UErrorCode&)
+ * indicates parse failure by setting a failing
+ * UErrorCode.
+ *
+ * Formatting
+ *
+ * Formatting is guided by several parameters, all of which can be
+ * specified either using a pattern or using the API. The following
+ * description applies to formats that do not use scientific
+ * notation or significant digits.
+ *
+ * Special Values
+ *
+ * Infinity is represented as a single character, typically
+ * Numbers in scientific notation are expressed as the product of a mantissa
+ * and a power of ten, for example, 1234 can be expressed as 1.234 x 103. The
+ * mantissa is typically in the half-open interval [1.0, 10.0) or sometimes [0.0, 1.0),
+ * but it need not be. DecimalFormat supports arbitrary mantissas.
+ * DecimalFormat can be instructed to use scientific
+ * notation through the API or through the pattern. In a pattern, the exponent
+ * character immediately followed by one or more digit characters indicates
+ * scientific notation. Example: "0.###E0" formats the number 1234 as
+ * "1.234E3".
+ *
+ * Padding
+ *
+ * DecimalFormat supports padding the result of
+ * format() to a specific width. Padding may be specified either
+ * through the API or through the pattern syntax. In a pattern the pad escape
+ * character, followed by a single pad character, causes padding to be parsed
+ * and formatted. The pad escape character is '*' in unlocalized patterns, and
+ * can be localized using DecimalFormatSymbols::setSymbol() with a
+ * DecimalFormatSymbols::kPadEscapeSymbol
+ * selector. For example, Rounding
+ *
+ * DecimalFormat supports rounding to a specific increment. For
+ * example, 1230 rounded to the nearest 50 is 1250. 1.234 rounded to the
+ * nearest 0.65 is 1.3. The rounding increment may be specified through the API
+ * or in a pattern. To specify a rounding increment in a pattern, include the
+ * increment in the pattern itself. "#,#50" specifies a rounding increment of
+ * 50. "#,##0.05" specifies a rounding increment of 0.05.
+ *
+ * In the absence of an explicit rounding increment numbers are
+ * rounded to their formatted width.
+ *
+ * Synchronization
+ *
+ * DecimalFormat objects are not synchronized. Multiple
+ * threads should not access one formatter concurrently.
+ *
+ * Subclassing
+ *
+ * User subclasses are not supported. While clients may write
+ * subclasses, such code will not necessarily work and will not be
+ * guaranteed to work stably from release to release.
+ */
+class U_I18N_API DecimalFormat : public NumberFormat {
+ public:
+ /**
+ * Pad position.
+ * @stable ICU 2.4
+ */
+ enum EPadPosition {
+ kPadBeforePrefix, kPadAfterPrefix, kPadBeforeSuffix, kPadAfterSuffix
+ };
+
+ /**
+ * Create a DecimalFormat using the default pattern and symbols
+ * for the default locale. This is a convenient way to obtain a
+ * DecimalFormat when internationalization is not the main concern.
+ *
+ * To obtain standard formats for a given locale, use the factory methods
+ * on NumberFormat such as createInstance. These factories will
+ * return the most appropriate sub-class of NumberFormat for a given
+ * locale.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * #icu::number::NumberFormatter instead of DecimalFormat.
+ * @param status Output param set to success/failure code. If the
+ * pattern is invalid this will be set to a failure code.
+ * @stable ICU 2.0
+ */
+ DecimalFormat(UErrorCode& status);
+
+ /**
+ * Create a DecimalFormat from the given pattern and the symbols
+ * for the default locale. This is a convenient way to obtain a
+ * DecimalFormat when internationalization is not the main concern.
+ *
+ * To obtain standard formats for a given locale, use the factory methods
+ * on NumberFormat such as createInstance. These factories will
+ * return the most appropriate sub-class of NumberFormat for a given
+ * locale.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * #icu::number::NumberFormatter instead of DecimalFormat.
+ * @param pattern A non-localized pattern string.
+ * @param status Output param set to success/failure code. If the
+ * pattern is invalid this will be set to a failure code.
+ * @stable ICU 2.0
+ */
+ DecimalFormat(const UnicodeString& pattern, UErrorCode& status);
+
+ /**
+ * Create a DecimalFormat from the given pattern and symbols.
+ * Use this constructor when you need to completely customize the
+ * behavior of the format.
+ *
+ * To obtain standard formats for a given
+ * locale, use the factory methods on NumberFormat such as
+ * createInstance or createCurrencyInstance. If you need only minor adjustments
+ * to a standard format, you can modify the format returned by
+ * a NumberFormat factory method.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * #icu::number::NumberFormatter instead of DecimalFormat.
+ *
+ * @param pattern a non-localized pattern string
+ * @param symbolsToAdopt the set of symbols to be used. The caller should not
+ * delete this object after making this call.
+ * @param status Output param set to success/failure code. If the
+ * pattern is invalid this will be set to a failure code.
+ * @stable ICU 2.0
+ */
+ DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt, UErrorCode& status);
+
+#ifndef U_HIDE_INTERNAL_API
+
+ /**
+ * This API is for ICU use only.
+ * Create a DecimalFormat from the given pattern, symbols, and style.
+ *
+ * @param pattern a non-localized pattern string
+ * @param symbolsToAdopt the set of symbols to be used. The caller should not
+ * delete this object after making this call.
+ * @param style style of decimal format
+ * @param status Output param set to success/failure code. If the
+ * pattern is invalid this will be set to a failure code.
+ * @internal
+ */
+ DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt,
+ UNumberFormatStyle style, UErrorCode& status);
+
+#if UCONFIG_HAVE_PARSEALLINPUT
+
+ /**
+ * @internal
+ */
+ void setParseAllInput(UNumberFormatAttributeValue value);
+
+#endif
+
+#endif /* U_HIDE_INTERNAL_API */
+
+ private:
+
+ /**
+ * Internal constructor for DecimalFormat; sets up internal fields. All public constructors should
+ * call this constructor.
+ */
+ DecimalFormat(const DecimalFormatSymbols* symbolsToAdopt, UErrorCode& status);
+
+ public:
+
+ /**
+ * Set an integer attribute on this DecimalFormat.
+ * May return U_UNSUPPORTED_ERROR if this instance does not support
+ * the specified attribute.
+ * @param attr the attribute to set
+ * @param newValue new value
+ * @param status the error type
+ * @return *this - for chaining (example: format.setAttribute(...).setAttribute(...) )
+ * @stable ICU 51
+ */
+ virtual DecimalFormat& setAttribute(UNumberFormatAttribute attr, int32_t newValue, UErrorCode& status);
+
+ /**
+ * Get an integer
+ * May return U_UNSUPPORTED_ERROR if this instance does not support
+ * the specified attribute.
+ * @param attr the attribute to set
+ * @param status the error type
+ * @return the attribute value. Undefined if there is an error.
+ * @stable ICU 51
+ */
+ virtual int32_t getAttribute(UNumberFormatAttribute attr, UErrorCode& status) const;
+
+
+ /**
+ * Set whether or not grouping will be used in this format.
+ * @param newValue True, grouping will be used in this format.
+ * @see getGroupingUsed
+ * @stable ICU 53
+ */
+ void setGroupingUsed(UBool newValue) override;
+
+ /**
+ * Sets whether or not numbers should be parsed as integers only.
+ * @param value set True, this format will parse numbers as integers
+ * only.
+ * @see isParseIntegerOnly
+ * @stable ICU 53
+ */
+ void setParseIntegerOnly(UBool value) override;
+
+ /**
+ * Sets whether lenient parsing should be enabled (it is off by default).
+ *
+ * @param enable \c true if lenient parsing should be used,
+ * \c false otherwise.
+ * @stable ICU 4.8
+ */
+ void setLenient(UBool enable) override;
+
+ /**
+ * Create a DecimalFormat from the given pattern and symbols.
+ * Use this constructor when you need to completely customize the
+ * behavior of the format.
+ *
+ * To obtain standard formats for a given
+ * locale, use the factory methods on NumberFormat such as
+ * createInstance or createCurrencyInstance. If you need only minor adjustments
+ * to a standard format, you can modify the format returned by
+ * a NumberFormat factory method.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * #icu::number::NumberFormatter instead of DecimalFormat.
+ *
+ * @param pattern a non-localized pattern string
+ * @param symbolsToAdopt the set of symbols to be used. The caller should not
+ * delete this object after making this call.
+ * @param parseError Output param to receive errors occurred during parsing
+ * @param status Output param set to success/failure code. If the
+ * pattern is invalid this will be set to a failure code.
+ * @stable ICU 2.0
+ */
+ DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt,
+ UParseError& parseError, UErrorCode& status);
+
+ /**
+ * Create a DecimalFormat from the given pattern and symbols.
+ * Use this constructor when you need to completely customize the
+ * behavior of the format.
+ *
+ * To obtain standard formats for a given
+ * locale, use the factory methods on NumberFormat such as
+ * createInstance or createCurrencyInstance. If you need only minor adjustments
+ * to a standard format, you can modify the format returned by
+ * a NumberFormat factory method.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * #icu::number::NumberFormatter instead of DecimalFormat.
+ *
+ * @param pattern a non-localized pattern string
+ * @param symbols the set of symbols to be used
+ * @param status Output param set to success/failure code. If the
+ * pattern is invalid this will be set to a failure code.
+ * @stable ICU 2.0
+ */
+ DecimalFormat(const UnicodeString& pattern, const DecimalFormatSymbols& symbols, UErrorCode& status);
+
+ /**
+ * Copy constructor.
+ *
+ * @param source the DecimalFormat object to be copied from.
+ * @stable ICU 2.0
+ */
+ DecimalFormat(const DecimalFormat& source);
+
+ /**
+ * Assignment operator.
+ *
+ * @param rhs the DecimalFormat object to be copied.
+ * @stable ICU 2.0
+ */
+ DecimalFormat& operator=(const DecimalFormat& rhs);
+
+ /**
+ * Destructor.
+ * @stable ICU 2.0
+ */
+ ~DecimalFormat() override;
+
+ /**
+ * Clone this Format object polymorphically. The caller owns the
+ * result and should delete it when done.
+ *
+ * @return a polymorphic copy of this DecimalFormat.
+ * @stable ICU 2.0
+ */
+ DecimalFormat* clone() const override;
+
+ /**
+ * Return true if the given Format objects are semantically equal.
+ * Objects of different subclasses are considered unequal.
+ *
+ * @param other the object to be compared with.
+ * @return true if the given Format objects are semantically equal.
+ * @stable ICU 2.0
+ */
+ bool operator==(const Format& other) const override;
+
+
+ using NumberFormat::format;
+
+ /**
+ * Format a double or long number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.0
+ */
+ UnicodeString& format(double number, UnicodeString& appendTo, FieldPosition& pos) const override;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Format a double or long number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param status
+ * @return Reference to 'appendTo' parameter.
+ * @internal
+ */
+ UnicodeString& format(double number, UnicodeString& appendTo, FieldPosition& pos,
+ UErrorCode& status) const override;
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Format a double or long number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call.
+ * Can be nullptr.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ UnicodeString& format(double number, UnicodeString& appendTo, FieldPositionIterator* posIter,
+ UErrorCode& status) const override;
+
+ /**
+ * Format a long number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.0
+ */
+ UnicodeString& format(int32_t number, UnicodeString& appendTo, FieldPosition& pos) const override;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Format a long number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @internal
+ */
+ UnicodeString& format(int32_t number, UnicodeString& appendTo, FieldPosition& pos,
+ UErrorCode& status) const override;
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Format a long number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call.
+ * Can be nullptr.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ UnicodeString& format(int32_t number, UnicodeString& appendTo, FieldPositionIterator* posIter,
+ UErrorCode& status) const override;
+
+ /**
+ * Format an int64 number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.8
+ */
+ UnicodeString& format(int64_t number, UnicodeString& appendTo, FieldPosition& pos) const override;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Format an int64 number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @internal
+ */
+ UnicodeString& format(int64_t number, UnicodeString& appendTo, FieldPosition& pos,
+ UErrorCode& status) const override;
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Format an int64 number using base-10 representation.
+ *
+ * @param number The value to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call.
+ * Can be nullptr.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ UnicodeString& format(int64_t number, UnicodeString& appendTo, FieldPositionIterator* posIter,
+ UErrorCode& status) const override;
+
+ /**
+ * Format a decimal number.
+ * The syntax of the unformatted number is a "numeric string"
+ * as defined in the Decimal Arithmetic Specification, available at
+ * http://speleotrove.com/decimal
+ *
+ * @param number The unformatted number, as a string.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call.
+ * Can be nullptr.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ UnicodeString& format(StringPiece number, UnicodeString& appendTo, FieldPositionIterator* posIter,
+ UErrorCode& status) const override;
+
+#ifndef U_HIDE_INTERNAL_API
+
+ /**
+ * Format a decimal number.
+ * The number is a DecimalQuantity wrapper onto a floating point decimal number.
+ * The default implementation in NumberFormat converts the decimal number
+ * to a double and formats that.
+ *
+ * @param number The number, a DecimalQuantity format Decimal Floating Point.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @internal
+ */
+ UnicodeString& format(const number::impl::DecimalQuantity& number, UnicodeString& appendTo,
+ FieldPositionIterator* posIter, UErrorCode& status) const override;
+
+ /**
+ * Format a decimal number.
+ * The number is a DecimalQuantity wrapper onto a floating point decimal number.
+ * The default implementation in NumberFormat converts the decimal number
+ * to a double and formats that.
+ *
+ * @param number The number, a DecimalQuantity format Decimal Floating Point.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @internal
+ */
+ UnicodeString& format(const number::impl::DecimalQuantity& number, UnicodeString& appendTo,
+ FieldPosition& pos, UErrorCode& status) const override;
+
+#endif // U_HIDE_INTERNAL_API
+
+ using NumberFormat::parse;
+
+ /**
+ * Parse the given string using this object's choices. The method
+ * does string comparisons to try to find an optimal match.
+ * If no object can be parsed, index is unchanged, and nullptr is
+ * returned. The result is returned as the most parsimonious
+ * type of Formattable that will accommodate all of the
+ * necessary precision. For example, if the result is exactly 12,
+ * it will be returned as a long. However, if it is 1.5, it will
+ * be returned as a double.
+ *
+ * @param text The text to be parsed.
+ * @param result Formattable to be set to the parse result.
+ * If parse fails, return contents are undefined.
+ * @param parsePosition The position to start parsing at on input.
+ * On output, moved to after the last successfully
+ * parse character. On parse failure, does not change.
+ * @see Formattable
+ * @stable ICU 2.0
+ */
+ void parse(const UnicodeString& text, Formattable& result,
+ ParsePosition& parsePosition) const override;
+
+ /**
+ * Parses text from the given string as a currency amount. Unlike
+ * the parse() method, this method will attempt to parse a generic
+ * currency name, searching for a match of this object's locale's
+ * currency display names, or for a 3-letter ISO currency code.
+ * This method will fail if this format is not a currency format,
+ * that is, if it does not contain the currency pattern symbol
+ * (U+00A4) in its prefix or suffix.
+ *
+ * @param text the string to parse
+ * @param pos input-output position; on input, the position within text
+ * to match; must have 0 <= pos.getIndex() < text.length();
+ * on output, the position after the last matched character.
+ * If the parse fails, the position in unchanged upon output.
+ * @return if parse succeeds, a pointer to a newly-created CurrencyAmount
+ * object (owned by the caller) containing information about
+ * the parsed currency; if parse fails, this is nullptr.
+ * @stable ICU 49
+ */
+ CurrencyAmount* parseCurrency(const UnicodeString& text, ParsePosition& pos) const override;
+
+ /**
+ * Returns the decimal format symbols, which is generally not changed
+ * by the programmer or user.
+ * @return desired DecimalFormatSymbols
+ * @see DecimalFormatSymbols
+ * @stable ICU 2.0
+ */
+ virtual const DecimalFormatSymbols* getDecimalFormatSymbols() const;
+
+ /**
+ * Sets the decimal format symbols, which is generally not changed
+ * by the programmer or user.
+ * @param symbolsToAdopt DecimalFormatSymbols to be adopted.
+ * @stable ICU 2.0
+ */
+ virtual void adoptDecimalFormatSymbols(DecimalFormatSymbols* symbolsToAdopt);
+
+ /**
+ * Sets the decimal format symbols, which is generally not changed
+ * by the programmer or user.
+ * @param symbols DecimalFormatSymbols.
+ * @stable ICU 2.0
+ */
+ virtual void setDecimalFormatSymbols(const DecimalFormatSymbols& symbols);
+
+
+ /**
+ * Returns the currency plural format information,
+ * which is generally not changed by the programmer or user.
+ * @return desired CurrencyPluralInfo
+ * @stable ICU 4.2
+ */
+ virtual const CurrencyPluralInfo* getCurrencyPluralInfo() const;
+
+ /**
+ * Sets the currency plural format information,
+ * which is generally not changed by the programmer or user.
+ * @param toAdopt CurrencyPluralInfo to be adopted.
+ * @stable ICU 4.2
+ */
+ virtual void adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt);
+
+ /**
+ * Sets the currency plural format information,
+ * which is generally not changed by the programmer or user.
+ * @param info Currency Plural Info.
+ * @stable ICU 4.2
+ */
+ virtual void setCurrencyPluralInfo(const CurrencyPluralInfo& info);
+
+
+ /**
+ * Get the positive prefix.
+ *
+ * @param result Output param which will receive the positive prefix.
+ * @return A reference to 'result'.
+ * Examples: +123, $123, sFr123
+ * @stable ICU 2.0
+ */
+ UnicodeString& getPositivePrefix(UnicodeString& result) const;
+
+ /**
+ * Set the positive prefix.
+ *
+ * @param newValue the new value of the the positive prefix to be set.
+ * Examples: +123, $123, sFr123
+ * @stable ICU 2.0
+ */
+ virtual void setPositivePrefix(const UnicodeString& newValue);
+
+ /**
+ * Get the negative prefix.
+ *
+ * @param result Output param which will receive the negative prefix.
+ * @return A reference to 'result'.
+ * Examples: -123, ($123) (with negative suffix), sFr-123
+ * @stable ICU 2.0
+ */
+ UnicodeString& getNegativePrefix(UnicodeString& result) const;
+
+ /**
+ * Set the negative prefix.
+ *
+ * @param newValue the new value of the the negative prefix to be set.
+ * Examples: -123, ($123) (with negative suffix), sFr-123
+ * @stable ICU 2.0
+ */
+ virtual void setNegativePrefix(const UnicodeString& newValue);
+
+ /**
+ * Get the positive suffix.
+ *
+ * @param result Output param which will receive the positive suffix.
+ * @return A reference to 'result'.
+ * Example: 123%
+ * @stable ICU 2.0
+ */
+ UnicodeString& getPositiveSuffix(UnicodeString& result) const;
+
+ /**
+ * Set the positive suffix.
+ *
+ * @param newValue the new value of the positive suffix to be set.
+ * Example: 123%
+ * @stable ICU 2.0
+ */
+ virtual void setPositiveSuffix(const UnicodeString& newValue);
+
+ /**
+ * Get the negative suffix.
+ *
+ * @param result Output param which will receive the negative suffix.
+ * @return A reference to 'result'.
+ * Examples: -123%, ($123) (with positive suffixes)
+ * @stable ICU 2.0
+ */
+ UnicodeString& getNegativeSuffix(UnicodeString& result) const;
+
+ /**
+ * Set the negative suffix.
+ *
+ * @param newValue the new value of the negative suffix to be set.
+ * Examples: 123%
+ * @stable ICU 2.0
+ */
+ virtual void setNegativeSuffix(const UnicodeString& newValue);
+
+ /**
+ * Whether to show the plus sign on positive (non-negative) numbers; for example, "+12"
+ *
+ * For more control over sign display, use NumberFormatter.
+ *
+ * @return Whether the sign is shown on positive numbers and zero.
+ * @stable ICU 64
+ */
+ UBool isSignAlwaysShown() const;
+
+ /**
+ * Set whether to show the plus sign on positive (non-negative) numbers; for example, "+12".
+ *
+ * For more control over sign display, use NumberFormatter.
+ *
+ * @param value true to always show a sign; false to hide the sign on positive numbers and zero.
+ * @stable ICU 64
+ */
+ void setSignAlwaysShown(UBool value);
+
+ /**
+ * Get the multiplier for use in percent, permill, etc.
+ * For a percentage, set the suffixes to have "%" and the multiplier to be 100.
+ * (For Arabic, use arabic percent symbol).
+ * For a permill, set the suffixes to have "\\u2031" and the multiplier to be 1000.
+ *
+ * The number may also be multiplied by a power of ten; see getMultiplierScale().
+ *
+ * @return the multiplier for use in percent, permill, etc.
+ * Examples: with 100, 1.23 -> "123", and "123" -> 1.23
+ * @stable ICU 2.0
+ */
+ int32_t getMultiplier() const;
+
+ /**
+ * Set the multiplier for use in percent, permill, etc.
+ * For a percentage, set the suffixes to have "%" and the multiplier to be 100.
+ * (For Arabic, use arabic percent symbol).
+ * For a permill, set the suffixes to have "\\u2031" and the multiplier to be 1000.
+ *
+ * This method only supports integer multipliers. To multiply by a non-integer, pair this
+ * method with setMultiplierScale().
+ *
+ * @param newValue the new value of the multiplier for use in percent, permill, etc.
+ * Examples: with 100, 1.23 -> "123", and "123" -> 1.23
+ * @stable ICU 2.0
+ */
+ virtual void setMultiplier(int32_t newValue);
+
+ /**
+ * Gets the power of ten by which number should be multiplied before formatting, which
+ * can be combined with setMultiplier() to multiply by any arbitrary decimal value.
+ *
+ * A multiplier scale of 2 corresponds to multiplication by 100, and a multiplier scale
+ * of -2 corresponds to multiplication by 0.01.
+ *
+ * This method is analogous to UNUM_SCALE in getAttribute.
+ *
+ * @return the current value of the power-of-ten multiplier.
+ * @stable ICU 62
+ */
+ int32_t getMultiplierScale() const;
+
+ /**
+ * Sets a power of ten by which number should be multiplied before formatting, which
+ * can be combined with setMultiplier() to multiply by any arbitrary decimal value.
+ *
+ * A multiplier scale of 2 corresponds to multiplication by 100, and a multiplier scale
+ * of -2 corresponds to multiplication by 0.01.
+ *
+ * For example, to multiply numbers by 0.5 before formatting, you can do:
+ *
+ *
+ * There is no limit to integer digits are set
+ * by this routine, since that is the typical end-user desire;
+ * use setMaximumInteger if you want to set a real value.
+ * For negative numbers, use a second pattern, separated by a semicolon
+ *
+ * There is no limit to integer digits are set
+ * by this routine, since that is the typical end-user desire;
+ * use setMaximumInteger if you want to set a real value.
+ * For negative numbers, use a second pattern, separated by a semicolon
+ * Use Class Hierarchy or Alphabetical List
+ * or Compound List
+ * to find the class you are interested in. For example, to find BreakIterator,
+ * you can go to the Alphabetical List, then click on
+ * "BreakIterator". Once you are at the class, you will find an inheritance
+ * chart, a list of the public members, a detailed description of the class,
+ * then detailed member descriptions. Use Module List or File Members
+ * to find a list of all the functions and constants.
+ * For example, to find BreakIterator functions you would click on
+ * File List,
+ * then find "ubrk.h" and click on it. You will find descriptions of Defines,
+ * Typedefs, Enumerations, and Functions, with detailed descriptions below.
+ * If you want to find a specific function, such as ubrk_next(), then click
+ * first on File Members, then use your browser
+ * Find dialog to search for "ubrk_next()". The API References for each release of ICU are also available as
+ * a zip file from the ICU
+ * download page.
+ * Rather than first creating a DateFormatSymbols to get a date-time formatter
+ * by using a SimpleDateFormat constructor, clients are encouraged to create a
+ * date-time formatter using the getTimeInstance(), getDateInstance(), or
+ * getDateTimeInstance() method in DateFormat. Each of these methods can return a
+ * date/time formatter initialized with a default format pattern along with the
+ * date-time formatting data for a given or default locale. After a formatter is
+ * created, clients may modify the format pattern using the setPattern function
+ * as so desired. For more information on using these formatter factory
+ * functions, see DateFormat.
+ *
+ * If clients decide to create a date-time formatter with a particular format
+ * pattern and locale, they can do so with new SimpleDateFormat(aPattern,
+ * new DateFormatSymbols(aLocale)). This will load the appropriate date-time
+ * formatting data from the locale.
+ *
+ * DateFormatSymbols objects are clonable. When clients obtain a
+ * DateFormatSymbols object, they can feel free to modify the date-time
+ * formatting data as necessary. For instance, clients can
+ * replace the localized date-time format pattern characters with the ones that
+ * they feel easy to remember. Or they can change the representative cities
+ * originally picked by default to using their favorite ones.
+ *
+ * DateFormatSymbols are not expected to be subclassed. Data for a calendar is
+ * loaded out of resource bundles. The 'type' parameter indicates the type of
+ * calendar, for example, "gregorian" or "japanese". If the type is not gregorian
+ * (or nullptr, or an empty string) then the type is appended to the resource name,
+ * for example, 'Eras_japanese' instead of 'Eras'. If the resource 'Eras_japanese' did
+ * not exist (even in root), then this class will fall back to just 'Eras', that is,
+ * Gregorian data. Therefore, the calendar implementor MUST ensure that the root
+ * locale at least contains any resources that are to be particularized for the
+ * calendar type.
+ */
+class U_I18N_API DateFormatSymbols final : public UObject {
+public:
+ /**
+ * Construct a DateFormatSymbols object by loading format data from
+ * resources for the default locale, in the default calendar (Gregorian).
+ *
+ * NOTE: This constructor will never fail; if it cannot get resource
+ * data for the default locale, it will return a last-resort object
+ * based on hard-coded strings.
+ *
+ * @param status Status code. Failure
+ * results if the resources for the default cannot be
+ * found or cannot be loaded
+ * @stable ICU 2.0
+ */
+ DateFormatSymbols(UErrorCode& status);
+
+ /**
+ * Construct a DateFormatSymbols object by loading format data from
+ * resources for the given locale, in the default calendar (Gregorian).
+ *
+ * @param locale Locale to load format data from.
+ * @param status Status code. Failure
+ * results if the resources for the locale cannot be
+ * found or cannot be loaded
+ * @stable ICU 2.0
+ */
+ DateFormatSymbols(const Locale& locale,
+ UErrorCode& status);
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Construct a DateFormatSymbols object by loading format data from
+ * resources for the default locale, in the default calendar (Gregorian).
+ *
+ * NOTE: This constructor will never fail; if it cannot get resource
+ * data for the default locale, it will return a last-resort object
+ * based on hard-coded strings.
+ *
+ * @param type Type of calendar (as returned by Calendar::getType).
+ * Will be used to access the correct set of strings.
+ * (nullptr or empty string defaults to "gregorian".)
+ * @param status Status code. Failure
+ * results if the resources for the default cannot be
+ * found or cannot be loaded
+ * @internal
+ */
+ DateFormatSymbols(const char *type, UErrorCode& status);
+
+ /**
+ * Construct a DateFormatSymbols object by loading format data from
+ * resources for the given locale, in the default calendar (Gregorian).
+ *
+ * @param locale Locale to load format data from.
+ * @param type Type of calendar (as returned by Calendar::getType).
+ * Will be used to access the correct set of strings.
+ * (nullptr or empty string defaults to "gregorian".)
+ * @param status Status code. Failure
+ * results if the resources for the locale cannot be
+ * found or cannot be loaded
+ * @internal
+ */
+ DateFormatSymbols(const Locale& locale,
+ const char *type,
+ UErrorCode& status);
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Copy constructor.
+ * @stable ICU 2.0
+ */
+ DateFormatSymbols(const DateFormatSymbols&);
+
+ /**
+ * Assignment operator.
+ * @stable ICU 2.0
+ */
+ DateFormatSymbols& operator=(const DateFormatSymbols&);
+
+ /**
+ * Destructor. This is nonvirtual because this class is not designed to be
+ * subclassed.
+ * @stable ICU 2.0
+ */
+ virtual ~DateFormatSymbols();
+
+ /**
+ * Return true if another object is semantically equal to this one.
+ *
+ * @param other the DateFormatSymbols object to be compared with.
+ * @return true if other is semantically equal to this.
+ * @stable ICU 2.0
+ */
+ bool operator==(const DateFormatSymbols& other) const;
+
+ /**
+ * Return true if another object is semantically unequal to this one.
+ *
+ * @param other the DateFormatSymbols object to be compared with.
+ * @return true if other is semantically unequal to this.
+ * @stable ICU 2.0
+ */
+ bool operator!=(const DateFormatSymbols& other) const { return !operator==(other); }
+
+ /**
+ * Gets abbreviated era strings. For example: "AD" and "BC".
+ *
+ * @param count Filled in with length of the array.
+ * @return the era strings.
+ * @stable ICU 2.0
+ */
+ const UnicodeString* getEras(int32_t& count) const;
+
+ /**
+ * Sets abbreviated era strings. For example: "AD" and "BC".
+ * @param eras Array of era strings (DateFormatSymbols retains ownership.)
+ * @param count Filled in with length of the array.
+ * @stable ICU 2.0
+ */
+ void setEras(const UnicodeString* eras, int32_t count);
+
+ /**
+ * Gets era name strings. For example: "Anno Domini" and "Before Christ".
+ *
+ * @param count Filled in with length of the array.
+ * @return the era name strings.
+ * @stable ICU 3.4
+ */
+ const UnicodeString* getEraNames(int32_t& count) const;
+
+ /**
+ * Sets era name strings. For example: "Anno Domini" and "Before Christ".
+ * @param eraNames Array of era name strings (DateFormatSymbols retains ownership.)
+ * @param count Filled in with length of the array.
+ * @stable ICU 3.6
+ */
+ void setEraNames(const UnicodeString* eraNames, int32_t count);
+
+ /**
+ * Gets narrow era strings. For example: "A" and "B".
+ *
+ * @param count Filled in with length of the array.
+ * @return the narrow era strings.
+ * @stable ICU 4.2
+ */
+ const UnicodeString* getNarrowEras(int32_t& count) const;
+
+ /**
+ * Sets narrow era strings. For example: "A" and "B".
+ * @param narrowEras Array of narrow era strings (DateFormatSymbols retains ownership.)
+ * @param count Filled in with length of the array.
+ * @stable ICU 4.2
+ */
+ void setNarrowEras(const UnicodeString* narrowEras, int32_t count);
+
+ /**
+ * Gets month strings. For example: "January", "February", etc.
+ * @param count Filled in with length of the array.
+ * @return the month strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 2.0
+ */
+ const UnicodeString* getMonths(int32_t& count) const;
+
+ /**
+ * Sets month strings. For example: "January", "February", etc.
+ *
+ * @param months the new month strings. (not adopted; caller retains ownership)
+ * @param count Filled in with length of the array.
+ * @stable ICU 2.0
+ */
+ void setMonths(const UnicodeString* months, int32_t count);
+
+ /**
+ * Gets short month strings. For example: "Jan", "Feb", etc.
+ *
+ * @param count Filled in with length of the array.
+ * @return the short month strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 2.0
+ */
+ const UnicodeString* getShortMonths(int32_t& count) const;
+
+ /**
+ * Sets short month strings. For example: "Jan", "Feb", etc.
+ * @param count Filled in with length of the array.
+ * @param shortMonths the new short month strings. (not adopted; caller retains ownership)
+ * @stable ICU 2.0
+ */
+ void setShortMonths(const UnicodeString* shortMonths, int32_t count);
+
+ /**
+ * Selector for date formatting context
+ * @stable ICU 3.6
+ */
+ enum DtContextType {
+ FORMAT,
+ STANDALONE,
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * One more than the highest normal DtContextType value.
+ * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
+ */
+ DT_CONTEXT_COUNT
+#endif // U_HIDE_DEPRECATED_API
+ };
+
+ /**
+ * Selector for date formatting width
+ * @stable ICU 3.6
+ */
+ enum DtWidthType {
+ ABBREVIATED,
+ WIDE,
+ NARROW,
+ /**
+ * Short width is currently only supported for weekday names.
+ * @stable ICU 51
+ */
+ SHORT,
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * One more than the highest normal DtWidthType value.
+ * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
+ */
+ DT_WIDTH_COUNT = 4
+#endif // U_HIDE_DEPRECATED_API
+ };
+
+ /**
+ * Gets month strings by width and context. For example: "January", "February", etc.
+ * @param count Filled in with length of the array.
+ * @param context The formatting context, either FORMAT or STANDALONE
+ * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
+ * @return the month strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 3.4
+ */
+ const UnicodeString* getMonths(int32_t& count, DtContextType context, DtWidthType width) const;
+
+ /**
+ * Sets month strings by width and context. For example: "January", "February", etc.
+ *
+ * @param months The new month strings. (not adopted; caller retains ownership)
+ * @param count Filled in with length of the array.
+ * @param context The formatting context, either FORMAT or STANDALONE
+ * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
+ * @stable ICU 3.6
+ */
+ void setMonths(const UnicodeString* months, int32_t count, DtContextType context, DtWidthType width);
+
+ /**
+ * Gets wide weekday strings. For example: "Sunday", "Monday", etc.
+ * @param count Filled in with length of the array.
+ * @return the weekday strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 2.0
+ */
+ const UnicodeString* getWeekdays(int32_t& count) const;
+
+
+ /**
+ * Sets wide weekday strings. For example: "Sunday", "Monday", etc.
+ * @param weekdays the new weekday strings. (not adopted; caller retains ownership)
+ * @param count Filled in with length of the array.
+ * @stable ICU 2.0
+ */
+ void setWeekdays(const UnicodeString* weekdays, int32_t count);
+
+ /**
+ * Gets abbreviated weekday strings. For example: "Sun", "Mon", etc. (Note: The method name is
+ * misleading; it does not get the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)
+ * @param count Filled in with length of the array.
+ * @return the abbreviated weekday strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 2.0
+ */
+ const UnicodeString* getShortWeekdays(int32_t& count) const;
+
+ /**
+ * Sets abbreviated weekday strings. For example: "Sun", "Mon", etc. (Note: The method name is
+ * misleading; it does not set the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)
+ * @param abbrevWeekdays the new abbreviated weekday strings. (not adopted; caller retains ownership)
+ * @param count Filled in with length of the array.
+ * @stable ICU 2.0
+ */
+ void setShortWeekdays(const UnicodeString* abbrevWeekdays, int32_t count);
+
+ /**
+ * Gets weekday strings by width and context. For example: "Sunday", "Monday", etc.
+ * @param count Filled in with length of the array.
+ * @param context The formatting context, either FORMAT or STANDALONE
+ * @param width The width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW
+ * @return the month strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 3.4
+ */
+ const UnicodeString* getWeekdays(int32_t& count, DtContextType context, DtWidthType width) const;
+
+ /**
+ * Sets weekday strings by width and context. For example: "Sunday", "Monday", etc.
+ * @param weekdays The new weekday strings. (not adopted; caller retains ownership)
+ * @param count Filled in with length of the array.
+ * @param context The formatting context, either FORMAT or STANDALONE
+ * @param width The width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW
+ * @stable ICU 3.6
+ */
+ void setWeekdays(const UnicodeString* weekdays, int32_t count, DtContextType context, DtWidthType width);
+
+ /**
+ * Gets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
+ * @param count Filled in with length of the array.
+ * @param context The formatting context, either FORMAT or STANDALONE
+ * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
+ * @return the quarter strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 3.6
+ */
+ const UnicodeString* getQuarters(int32_t& count, DtContextType context, DtWidthType width) const;
+
+ /**
+ * Sets quarter strings by width and context. For example: "1st Quarter", "2nd Quarter", etc.
+ *
+ * @param quarters The new quarter strings. (not adopted; caller retains ownership)
+ * @param count Filled in with length of the array.
+ * @param context The formatting context, either FORMAT or STANDALONE
+ * @param width The width of returned strings, either WIDE, ABBREVIATED, or NARROW.
+ * @stable ICU 3.6
+ */
+ void setQuarters(const UnicodeString* quarters, int32_t count, DtContextType context, DtWidthType width);
+
+ /**
+ * Gets AM/PM strings. For example: "AM" and "PM".
+ * @param count Filled in with length of the array.
+ * @return the weekday strings. (DateFormatSymbols retains ownership.)
+ * @stable ICU 2.0
+ */
+ const UnicodeString* getAmPmStrings(int32_t& count) const;
+
+ /**
+ * Sets ampm strings. For example: "AM" and "PM".
+ * @param ampms the new ampm strings. (not adopted; caller retains ownership)
+ * @param count Filled in with length of the array.
+ * @stable ICU 2.0
+ */
+ void setAmPmStrings(const UnicodeString* ampms, int32_t count);
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * This default time separator is used for formatting when the locale
+ * doesn't specify any time separator, and always recognized when parsing.
+ * @internal
+ */
+ static const char16_t DEFAULT_TIME_SEPARATOR = 0x003a; // ':'
+
+ /**
+ * This alternate time separator is always recognized when parsing.
+ * @internal
+ */
+ static const char16_t ALTERNATE_TIME_SEPARATOR = 0x002e; // '.'
+
+ /**
+ * Gets the time separator string. For example: ":".
+ * @param result Output param which will receive the time separator string.
+ * @return A reference to 'result'.
+ * @internal
+ */
+ UnicodeString& getTimeSeparatorString(UnicodeString& result) const;
+
+ /**
+ * Sets the time separator string. For example: ":".
+ * @param newTimeSeparator the new time separator string.
+ * @internal
+ */
+ void setTimeSeparatorString(const UnicodeString& newTimeSeparator);
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Gets cyclic year name strings if the calendar has them, by width and context.
+ * For example: "jia-zi", "yi-chou", etc.
+ * @param count Filled in with length of the array.
+ * @param context The usage context: FORMAT, STANDALONE.
+ * @param width The requested name width: WIDE, ABBREVIATED, NARROW.
+ * @return The year name strings (DateFormatSymbols retains ownership),
+ * or null if they are not available for this calendar.
+ * @stable ICU 54
+ */
+ const UnicodeString* getYearNames(int32_t& count,
+ DtContextType context, DtWidthType width) const;
+
+ /**
+ * Sets cyclic year name strings by width and context. For example: "jia-zi", "yi-chou", etc.
+ *
+ * @param yearNames The new cyclic year name strings (not adopted; caller retains ownership).
+ * @param count The length of the array.
+ * @param context The usage context: FORMAT, STANDALONE (currently only FORMAT is supported).
+ * @param width The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported).
+ * @stable ICU 54
+ */
+ void setYearNames(const UnicodeString* yearNames, int32_t count,
+ DtContextType context, DtWidthType width);
+
+ /**
+ * Gets calendar zodiac name strings if the calendar has them, by width and context.
+ * For example: "Rat", "Ox", "Tiger", etc.
+ * @param count Filled in with length of the array.
+ * @param context The usage context: FORMAT, STANDALONE.
+ * @param width The requested name width: WIDE, ABBREVIATED, NARROW.
+ * @return The zodiac name strings (DateFormatSymbols retains ownership),
+ * or null if they are not available for this calendar.
+ * @stable ICU 54
+ */
+ const UnicodeString* getZodiacNames(int32_t& count,
+ DtContextType context, DtWidthType width) const;
+
+ /**
+ * Sets calendar zodiac name strings by width and context. For example: "Rat", "Ox", "Tiger", etc.
+ *
+ * @param zodiacNames The new zodiac name strings (not adopted; caller retains ownership).
+ * @param count The length of the array.
+ * @param context The usage context: FORMAT, STANDALONE (currently only FORMAT is supported).
+ * @param width The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported).
+ * @stable ICU 54
+ */
+ void setZodiacNames(const UnicodeString* zodiacNames, int32_t count,
+ DtContextType context, DtWidthType width);
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Somewhat temporary constants for leap month pattern types, adequate for supporting
+ * just leap month patterns as needed for Chinese lunar calendar.
+ * Eventually we will add full support for different month pattern types (needed for
+ * other calendars such as Hindu) at which point this approach will be replaced by a
+ * more complete approach.
+ * @internal
+ */
+ enum EMonthPatternType
+ {
+ kLeapMonthPatternFormatWide,
+ kLeapMonthPatternFormatAbbrev,
+ kLeapMonthPatternFormatNarrow,
+ kLeapMonthPatternStandaloneWide,
+ kLeapMonthPatternStandaloneAbbrev,
+ kLeapMonthPatternStandaloneNarrow,
+ kLeapMonthPatternNumeric,
+ kMonthPatternsCount
+ };
+
+ /**
+ * Somewhat temporary function for getting complete set of leap month patterns for all
+ * contexts & widths, indexed by EMonthPatternType values. Returns nullptr if calendar
+ * does not have leap month patterns. Note, there is currently no setter for this.
+ * Eventually we will add full support for different month pattern types (needed for
+ * other calendars such as Hindu) at which point this approach will be replaced by a
+ * more complete approach.
+ * @param count Filled in with length of the array (may be 0).
+ * @return The leap month patterns (DateFormatSymbols retains ownership).
+ * May be nullptr if there are no leap month patterns for this calendar.
+ * @internal
+ */
+ const UnicodeString* getLeapMonthPatterns(int32_t& count) const;
+
+#endif /* U_HIDE_INTERNAL_API */
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Gets timezone strings. These strings are stored in a 2-dimensional array.
+ * @param rowCount Output param to receive number of rows.
+ * @param columnCount Output param to receive number of columns.
+ * @return The timezone strings as a 2-d array. (DateFormatSymbols retains ownership.)
+ * @deprecated ICU 3.6
+ */
+ const UnicodeString** getZoneStrings(int32_t& rowCount, int32_t& columnCount) const;
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Sets timezone strings. These strings are stored in a 2-dimensional array.
+ * Note: SimpleDateFormat no longer use the zone strings stored in
+ * a DateFormatSymbols. Therefore, the time zone strings set by this method
+ * have no effects in an instance of SimpleDateFormat for formatting time
+ * zones.
+ * @param strings The timezone strings as a 2-d array to be copied. (not adopted; caller retains ownership)
+ * @param rowCount The number of rows (count of first index).
+ * @param columnCount The number of columns (count of second index).
+ * @stable ICU 2.0
+ */
+ void setZoneStrings(const UnicodeString* const* strings, int32_t rowCount, int32_t columnCount);
+
+ /**
+ * Get the non-localized date-time pattern characters.
+ * @return the non-localized date-time pattern characters
+ * @stable ICU 2.0
+ */
+ static const char16_t* U_EXPORT2 getPatternUChars();
+
+ /**
+ * Gets localized date-time pattern characters. For example: 'u', 't', etc.
+ *
+ * Note: ICU no longer provides localized date-time pattern characters for a locale
+ * starting ICU 3.8. This method returns the non-localized date-time pattern
+ * characters unless user defined localized data is set by setLocalPatternChars.
+ * @param result Output param which will receive the localized date-time pattern characters.
+ * @return A reference to 'result'.
+ * @stable ICU 2.0
+ */
+ UnicodeString& getLocalPatternChars(UnicodeString& result) const;
+
+ /**
+ * Sets localized date-time pattern characters. For example: 'u', 't', etc.
+ * @param newLocalPatternChars the new localized date-time
+ * pattern characters.
+ * @stable ICU 2.0
+ */
+ void setLocalPatternChars(const UnicodeString& newLocalPatternChars);
+
+ /**
+ * Returns the locale for this object. Two flavors are available:
+ * valid and actual locale.
+ * @stable ICU 2.8
+ */
+ Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
+
+ /* The following type and kCapContextUsageTypeCount cannot be #ifndef U_HIDE_INTERNAL_API,
+ they are needed for .h file declarations. */
+ /**
+ * Constants for capitalization context usage types.
+ * @internal
+ */
+ enum ECapitalizationContextUsageType
+ {
+#ifndef U_HIDE_INTERNAL_API
+ kCapContextUsageOther = 0,
+ kCapContextUsageMonthFormat, /* except narrow */
+ kCapContextUsageMonthStandalone, /* except narrow */
+ kCapContextUsageMonthNarrow,
+ kCapContextUsageDayFormat, /* except narrow */
+ kCapContextUsageDayStandalone, /* except narrow */
+ kCapContextUsageDayNarrow,
+ kCapContextUsageEraWide,
+ kCapContextUsageEraAbbrev,
+ kCapContextUsageEraNarrow,
+ kCapContextUsageZoneLong,
+ kCapContextUsageZoneShort,
+ kCapContextUsageMetazoneLong,
+ kCapContextUsageMetazoneShort,
+#endif /* U_HIDE_INTERNAL_API */
+ kCapContextUsageTypeCount = 14
+ };
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for the actual class.
+ *
+ * @stable ICU 2.2
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for this class.
+ *
+ * @stable ICU 2.2
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+private:
+
+ friend class SimpleDateFormat;
+ friend class DateFormatSymbolsSingleSetter; // see udat.cpp
+
+ /**
+ * Abbreviated era strings. For example: "AD" and "BC".
+ */
+ UnicodeString* fEras;
+ int32_t fErasCount;
+
+ /**
+ * Era name strings. For example: "Anno Domini" and "Before Christ".
+ */
+ UnicodeString* fEraNames;
+ int32_t fEraNamesCount;
+
+ /**
+ * Narrow era strings. For example: "A" and "B".
+ */
+ UnicodeString* fNarrowEras;
+ int32_t fNarrowErasCount;
+
+ /**
+ * Month strings. For example: "January", "February", etc.
+ */
+ UnicodeString* fMonths;
+ int32_t fMonthsCount;
+
+ /**
+ * Short month strings. For example: "Jan", "Feb", etc.
+ */
+ UnicodeString* fShortMonths;
+ int32_t fShortMonthsCount;
+
+ /**
+ * Narrow month strings. For example: "J", "F", etc.
+ */
+ UnicodeString* fNarrowMonths;
+ int32_t fNarrowMonthsCount;
+
+ /**
+ * Standalone Month strings. For example: "January", "February", etc.
+ */
+ UnicodeString* fStandaloneMonths;
+ int32_t fStandaloneMonthsCount;
+
+ /**
+ * Standalone Short month strings. For example: "Jan", "Feb", etc.
+ */
+ UnicodeString* fStandaloneShortMonths;
+ int32_t fStandaloneShortMonthsCount;
+
+ /**
+ * Standalone Narrow month strings. For example: "J", "F", etc.
+ */
+ UnicodeString* fStandaloneNarrowMonths;
+ int32_t fStandaloneNarrowMonthsCount;
+
+ /**
+ * CLDR-style format wide weekday strings. For example: "Sunday", "Monday", etc.
+ */
+ UnicodeString* fWeekdays;
+ int32_t fWeekdaysCount;
+
+ /**
+ * CLDR-style format abbreviated (not short) weekday strings. For example: "Sun", "Mon", etc.
+ */
+ UnicodeString* fShortWeekdays;
+ int32_t fShortWeekdaysCount;
+
+ /**
+ * CLDR-style format short weekday strings. For example: "Su", "Mo", etc.
+ */
+ UnicodeString* fShorterWeekdays;
+ int32_t fShorterWeekdaysCount;
+
+ /**
+ * CLDR-style format narrow weekday strings. For example: "S", "M", etc.
+ */
+ UnicodeString* fNarrowWeekdays;
+ int32_t fNarrowWeekdaysCount;
+
+ /**
+ * CLDR-style standalone wide weekday strings. For example: "Sunday", "Monday", etc.
+ */
+ UnicodeString* fStandaloneWeekdays;
+ int32_t fStandaloneWeekdaysCount;
+
+ /**
+ * CLDR-style standalone abbreviated (not short) weekday strings. For example: "Sun", "Mon", etc.
+ */
+ UnicodeString* fStandaloneShortWeekdays;
+ int32_t fStandaloneShortWeekdaysCount;
+
+ /**
+ * CLDR-style standalone short weekday strings. For example: "Su", "Mo", etc.
+ */
+ UnicodeString* fStandaloneShorterWeekdays;
+ int32_t fStandaloneShorterWeekdaysCount;
+
+ /**
+ * Standalone Narrow weekday strings. For example: "Sun", "Mon", etc.
+ */
+ UnicodeString* fStandaloneNarrowWeekdays;
+ int32_t fStandaloneNarrowWeekdaysCount;
+
+ /**
+ * Ampm strings. For example: "AM" and "PM".
+ */
+ UnicodeString* fAmPms;
+ int32_t fAmPmsCount;
+
+ /**
+ * Narrow Ampm strings. For example: "a" and "p".
+ */
+ UnicodeString* fNarrowAmPms;
+ int32_t fNarrowAmPmsCount;
+
+ /**
+ * Time separator string. For example: ":".
+ */
+ UnicodeString fTimeSeparator;
+
+ /**
+ * Quarter strings. For example: "1st quarter", "2nd quarter", etc.
+ */
+ UnicodeString *fQuarters;
+ int32_t fQuartersCount;
+
+ /**
+ * Short quarters. For example: "Q1", "Q2", etc.
+ */
+ UnicodeString *fShortQuarters;
+ int32_t fShortQuartersCount;
+
+ /**
+ * Narrow quarters. For example: "1", "2", etc.
+ * (In many, but not all, locales, this is the same as "Q", but there are locales for which this isn't true.)
+ */
+ UnicodeString *fNarrowQuarters;
+ int32_t fNarrowQuartersCount;
+
+ /**
+ * Standalone quarter strings. For example: "1st quarter", "2nd quarter", etc.
+ */
+ UnicodeString *fStandaloneQuarters;
+ int32_t fStandaloneQuartersCount;
+
+ /**
+ * Standalone short quarter strings. For example: "Q1", "Q2", etc.
+ */
+ UnicodeString *fStandaloneShortQuarters;
+ int32_t fStandaloneShortQuartersCount;
+
+ /**
+ * Standalone narrow quarter strings. For example: "1", "2", etc.
+ * (In many, but not all, locales, this is the same as "q", but there are locales for which this isn't true.)
+ */
+ UnicodeString *fStandaloneNarrowQuarters;
+ int32_t fStandaloneNarrowQuartersCount;
+
+ /**
+ * All leap month patterns, for example "{0}bis".
+ */
+ UnicodeString *fLeapMonthPatterns;
+ int32_t fLeapMonthPatternsCount;
+
+ /**
+ * Cyclic year names, for example: "jia-zi", "yi-chou", ... "gui-hai";
+ * currently we only have data for format/abbreviated.
+ * For the others, just get from format/abbreviated, ignore set.
+ */
+ UnicodeString *fShortYearNames;
+ int32_t fShortYearNamesCount;
+
+ /**
+ * Cyclic zodiac names, for example "Rat", "Ox", "Tiger", etc.;
+ * currently we only have data for format/abbreviated.
+ * For the others, just get from format/abbreviated, ignore set.
+ */
+ UnicodeString *fShortZodiacNames;
+ int32_t fShortZodiacNamesCount;
+
+ /**
+ * Localized names of time zones in this locale. This is a
+ * two-dimensional array of strings of size n by m,
+ * where m is at least 5 and up to 7. Each of the n rows is an
+ * entry containing the localized names for a single TimeZone.
+ *
+ * Each such row contains (with i ranging from 0..n-1):
+ *
+ * zoneStrings[i][0] - time zone ID
+ * example: America/Los_Angeles
+ * zoneStrings[i][1] - long name of zone in standard time
+ * example: Pacific Standard Time
+ * zoneStrings[i][2] - short name of zone in standard time
+ * example: PST
+ * zoneStrings[i][3] - long name of zone in daylight savings time
+ * example: Pacific Daylight Time
+ * zoneStrings[i][4] - short name of zone in daylight savings time
+ * example: PDT
+ * zoneStrings[i][5] - location name of zone
+ * example: United States (Los Angeles)
+ * zoneStrings[i][6] - long generic name of zone
+ * example: Pacific Time
+ * zoneStrings[i][7] - short generic of zone
+ * example: PT
+ *
+ * The zone ID is not localized; it corresponds to the ID
+ * value associated with a system time zone object. All other entries
+ * are localized names. If a zone does not implement daylight savings
+ * time, the daylight savings time names are ignored.
+ *
+ * Note:CLDR 1.5 introduced metazone and its historical mappings.
+ * This simple two-dimensional array is no longer sufficient to represent
+ * localized names and its historic changes. Since ICU 3.8.1, localized
+ * zone names extracted from ICU locale data is stored in a ZoneStringFormat
+ * instance. But we still need to support the old way of customizing
+ * localized zone names, so we keep this field for the purpose.
+ */
+ UnicodeString **fZoneStrings; // Zone string array set by setZoneStrings
+ UnicodeString **fLocaleZoneStrings; // Zone string array created by the locale
+ int32_t fZoneStringsRowCount;
+ int32_t fZoneStringsColCount;
+
+ Locale fZSFLocale; // Locale used for getting ZoneStringFormat
+
+ /**
+ * Localized date-time pattern characters. For example: use 'u' as 'y'.
+ */
+ UnicodeString fLocalPatternChars;
+
+ /**
+ * Capitalization transforms. For each usage type, the first array element indicates
+ * whether to titlecase for uiListOrMenu context, the second indicates whether to
+ * titlecase for stand-alone context.
+ */
+ UBool fCapitalization[kCapContextUsageTypeCount][2];
+
+ /**
+ * Abbreviated (== short) day period strings.
+ */
+ UnicodeString *fAbbreviatedDayPeriods;
+ int32_t fAbbreviatedDayPeriodsCount;
+
+ /**
+ * Wide day period strings.
+ */
+ UnicodeString *fWideDayPeriods;
+ int32_t fWideDayPeriodsCount;
+
+ /**
+ * Narrow day period strings.
+ */
+ UnicodeString *fNarrowDayPeriods;
+ int32_t fNarrowDayPeriodsCount;
+
+ /**
+ * Stand-alone abbreviated (== short) day period strings.
+ */
+ UnicodeString *fStandaloneAbbreviatedDayPeriods;
+ int32_t fStandaloneAbbreviatedDayPeriodsCount;
+
+ /**
+ * Stand-alone wide day period strings.
+ */
+ UnicodeString *fStandaloneWideDayPeriods;
+ int32_t fStandaloneWideDayPeriodsCount;
+
+ /**
+ * Stand-alone narrow day period strings.
+ */
+ UnicodeString *fStandaloneNarrowDayPeriods;
+ int32_t fStandaloneNarrowDayPeriodsCount;
+
+private:
+ /** valid/actual locale information
+ * these are always ICU locales, so the length should not be a problem
+ */
+ CharString* validLocale = nullptr;
+ CharString* actualLocale = nullptr;
+
+ DateFormatSymbols() = delete; // default constructor not implemented
+
+ /**
+ * Called by the constructors to actually load data from the resources
+ *
+ * @param locale The locale to get symbols for.
+ * @param type Calendar Type (as from Calendar::getType())
+ * @param status Input/output parameter, set to success or
+ * failure code upon return.
+ * @param useLastResortData determine if use last resort data
+ */
+ void initializeData(const Locale& locale, const char *type,
+ UErrorCode& status, UBool useLastResortData = false);
+
+ /**
+ * Copy or alias an array in another object, as appropriate.
+ *
+ * @param dstArray the copy destination array.
+ * @param dstCount fill in with the length of 'dstArray'.
+ * @param srcArray the source array to be copied.
+ * @param srcCount the length of items to be copied from the 'srcArray'.
+ */
+ static void assignArray(UnicodeString*& dstArray,
+ int32_t& dstCount,
+ const UnicodeString* srcArray,
+ int32_t srcCount);
+
+ /**
+ * Return true if the given arrays' contents are equal, or if the arrays are
+ * identical (pointers are equal).
+ *
+ * @param array1 one array to be compared with.
+ * @param array2 another array to be compared with.
+ * @param count the length of items to be copied.
+ * @return true if the given arrays' contents are equal, or if the arrays are
+ * identical (pointers are equal).
+ */
+ static UBool arrayCompare(const UnicodeString* array1,
+ const UnicodeString* array2,
+ int32_t count);
+
+ /**
+ * Create a copy, in fZoneStrings, of the given zone strings array. The
+ * member variables fZoneStringsRowCount and fZoneStringsColCount should be
+ * set already by the caller.
+ */
+ void createZoneStrings(const UnicodeString *const * otherStrings);
+
+ /**
+ * Delete all the storage owned by this object.
+ */
+ void dispose();
+
+ /**
+ * Copy all of the other's data to this.
+ * @param other the object to be copied.
+ */
+ void copyData(const DateFormatSymbols& other);
+
+ /**
+ * Create zone strings array by locale if not yet available
+ */
+ void initZoneStringsArray();
+
+ /**
+ * Delete just the zone strings.
+ */
+ void disposeZoneStrings();
+
+ /**
+ * Returns the date format field index of the pattern character c,
+ * or UDAT_FIELD_COUNT if c is not a pattern character.
+ */
+ static UDateFormatField U_EXPORT2 getPatternCharIndex(char16_t c);
+
+ /**
+ * Returns true if f (with its pattern character repeated count times) is a numeric field.
+ */
+ static UBool U_EXPORT2 isNumericField(UDateFormatField f, int32_t count);
+
+ /**
+ * Returns true if c (repeated count times) is the pattern character for a numeric field.
+ */
+ static UBool U_EXPORT2 isNumericPatternChar(char16_t c, int32_t count);
+public:
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Gets a DateFormatSymbols by locale.
+ * Unlike the constructors which always use gregorian calendar, this
+ * method uses the calendar in the locale. If the locale contains no
+ * explicit calendar, this method uses the default calendar for that
+ * locale.
+ * @param locale the locale.
+ * @param status error returned here.
+ * @return the new DateFormatSymbols which the caller owns.
+ * @internal For ICU use only.
+ */
+ static DateFormatSymbols * U_EXPORT2 createForLocale(
+ const Locale &locale, UErrorCode &status);
+#endif /* U_HIDE_INTERNAL_API */
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _DTFMTSYM
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtintrv.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtintrv.h
new file mode 100644
index 0000000000..1fd0ba5dee
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtintrv.h
@@ -0,0 +1,163 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+*******************************************************************************
+* Copyright (C) 2008-2009, International Business Machines Corporation and
+* others. All Rights Reserved.
+*******************************************************************************
+*
+* File DTINTRV.H
+*
+*******************************************************************************
+*/
+
+#ifndef __DTINTRV_H__
+#define __DTINTRV_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#include "unicode/uobject.h"
+
+/**
+ * \file
+ * \brief C++ API: Date Interval data type
+ */
+
+U_NAMESPACE_BEGIN
+
+
+/**
+ * This class represents a date interval.
+ * It is a pair of UDate representing from UDate 1 to UDate 2.
+ * @stable ICU 4.0
+**/
+class U_COMMON_API DateInterval : public UObject {
+public:
+
+ /**
+ * Construct a DateInterval given a from date and a to date.
+ * @param fromDate The from date in date interval.
+ * @param toDate The to date in date interval.
+ * @stable ICU 4.0
+ */
+ DateInterval(UDate fromDate, UDate toDate);
+
+ /**
+ * destructor
+ * @stable ICU 4.0
+ */
+ virtual ~DateInterval();
+
+ /**
+ * Get the from date.
+ * @return the from date in dateInterval.
+ * @stable ICU 4.0
+ */
+ inline UDate getFromDate() const;
+
+ /**
+ * Get the to date.
+ * @return the to date in dateInterval.
+ * @stable ICU 4.0
+ */
+ inline UDate getToDate() const;
+
+
+ /**
+ * Return the class ID for this class. This is useful only for comparing to
+ * a return value from getDynamicClassID(). For example:
+ *
+ * Date interval means from one date to another date,
+ * for example, from "Jan 11, 2008" to "Jan 18, 2008".
+ * We introduced class DateInterval to represent it.
+ * DateInterval is a pair of UDate, which is
+ * the standard milliseconds since 24:00 GMT, Jan 1, 1970.
+ *
+ *
+ * DateIntervalFormat formats a DateInterval into
+ * text as compactly as possible.
+ * For example, the date interval format from "Jan 11, 2008" to "Jan 18,. 2008"
+ * is "Jan 11-18, 2008" for English.
+ * And it parses text into DateInterval,
+ * although initially, parsing is not supported.
+ *
+ *
+ * There is no structural information in date time patterns.
+ * For any punctuations and string literals inside a date time pattern,
+ * we do not know whether it is just a separator, or a prefix, or a suffix.
+ * Without such information, so, it is difficult to generate a sub-pattern
+ * (or super-pattern) by algorithm.
+ * So, formatting a DateInterval is pattern-driven. It is very
+ * similar to formatting in SimpleDateFormat.
+ * We introduce class DateIntervalInfo to save date interval
+ * patterns, similar to date time pattern in SimpleDateFormat.
+ *
+ *
+ * Logically, the interval patterns are mappings
+ * from (skeleton, the_largest_different_calendar_field)
+ * to (date_interval_pattern).
+ *
+ *
+ * A skeleton
+ *
+ * The calendar fields we support for interval formatting are:
+ * year, month, date, day-of-week, am-pm, hour, hour-of-day, minute, second,
+ * and millisecond.
+ * (though we do not currently have specific intervalFormat date for skeletons
+ * with seconds and millisecond).
+ * Those calendar fields can be defined in the following order:
+ * year > month > date > hour (in day) > minute > second > millisecond
+ *
+ * The largest different calendar fields between 2 calendars is the
+ * first different calendar field in above order.
+ *
+ * For example: the largest different calendar fields between "Jan 10, 2007"
+ * and "Feb 20, 2008" is year.
+ *
+ *
+ * For other calendar fields, the compact interval formatting is not
+ * supported. And the interval format will be fall back to fall-back
+ * patterns, which is mostly "{date0} - {date1}".
+ *
+ *
+ * There is a set of pre-defined static skeleton strings.
+ * There are pre-defined interval patterns for those pre-defined skeletons
+ * in locales' resource files.
+ * For example, for a skeleton UDAT_YEAR_ABBR_MONTH_DAY, which is "yMMMd",
+ * in en_US, if the largest different calendar field between date1 and date2
+ * is "year", the date interval pattern is "MMM d, yyyy - MMM d, yyyy",
+ * such as "Jan 10, 2007 - Jan 10, 2008".
+ * If the largest different calendar field between date1 and date2 is "month",
+ * the date interval pattern is "MMM d - MMM d, yyyy",
+ * such as "Jan 10 - Feb 10, 2007".
+ * If the largest different calendar field between date1 and date2 is "day",
+ * the date interval pattern is "MMM d-d, yyyy", such as "Jan 10-20, 2007".
+ *
+ * For date skeleton, the interval patterns when year, or month, or date is
+ * different are defined in resource files.
+ * For time skeleton, the interval patterns when am/pm, or hour, or minute is
+ * different are defined in resource files.
+ *
+ *
+ * If a skeleton is not found in a locale's DateIntervalInfo, which means
+ * the interval patterns for the skeleton is not defined in resource file,
+ * the interval pattern will falls back to the interval "fallback" pattern
+ * defined in resource file.
+ * If the interval "fallback" pattern is not defined, the default fall-back
+ * is "{date0} - {data1}".
+ *
+ *
+ * For the combination of date and time,
+ * The rule to generate interval patterns are:
+ *
+ * If two dates are the same, the interval pattern is the single date pattern.
+ * For example, interval pattern from "Jan 10, 2007" to "Jan 10, 2007" is
+ * "Jan 10, 2007".
+ *
+ * Or if the presenting fields between 2 dates have the exact same values,
+ * the interval pattern is the single date pattern.
+ * For example, if user only requests year and month,
+ * the interval pattern from "Jan 10, 2007" to "Jan 20, 2007" is "Jan 2007".
+ *
+ *
+ * DateIntervalFormat needs the following information for correct
+ * formatting: time zone, calendar type, pattern, date format symbols,
+ * and date interval patterns.
+ * It can be instantiated in 2 ways:
+ *
+ * For the calendar field pattern letter, such as G, y, M, d, a, h, H, m, s etc.
+ * DateIntervalFormat uses the same syntax as that of
+ * DateTime format.
+ *
+ *
+ * Code Sample: general usage
+ *
+ * In this factory method,
+ * the date interval pattern information is load from resource files.
+ * Users are encouraged to created date interval formatter this way and
+ * to use the pre-defined skeleton macros.
+ *
+ *
+ * There are pre-defined skeletons (defined in udate.h) having predefined
+ * interval patterns in resource files.
+ * Users are encouraged to use those macros.
+ * For example:
+ * DateIntervalFormat::createInstance(UDAT_MONTH_DAY, status)
+ *
+ * The given Locale provides the interval patterns.
+ * For example, for en_GB, if skeleton is UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY,
+ * which is "yMMMEEEd",
+ * the interval patterns defined in resource file to above skeleton are:
+ * "EEE, d MMM, yyyy - EEE, d MMM, yyyy" for year differs,
+ * "EEE, d MMM - EEE, d MMM, yyyy" for month differs,
+ * "EEE, d - EEE, d MMM, yyyy" for day differs,
+ * @param skeleton the skeleton on which the interval format is based.
+ * @param locale the given locale
+ * @param status output param set to success/failure code on exit
+ * @return a date time interval formatter which the caller owns.
+ * @stable ICU 4.0
+ */
+
+ static DateIntervalFormat* U_EXPORT2 createInstance(
+ const UnicodeString& skeleton,
+ const Locale& locale,
+ UErrorCode& status);
+
+ /**
+ * Construct a DateIntervalFormat from skeleton
+ * DateIntervalInfo, and default locale.
+ *
+ * This is a convenient override of
+ * createInstance(const UnicodeString& skeleton, const Locale& locale,
+ * const DateIntervalInfo& dtitvinf, UErrorCode&)
+ * with the locale value as default locale.
+ *
+ * @param skeleton the skeleton on which interval format based.
+ * @param dtitvinf the DateIntervalInfo object.
+ * @param status output param set to success/failure code on exit
+ * @return a date time interval formatter which the caller owns.
+ * @stable ICU 4.0
+ */
+ static DateIntervalFormat* U_EXPORT2 createInstance(
+ const UnicodeString& skeleton,
+ const DateIntervalInfo& dtitvinf,
+ UErrorCode& status);
+
+ /**
+ * Construct a DateIntervalFormat from skeleton
+ * a DateIntervalInfo, and the given locale.
+ *
+ *
+ * In this factory method, user provides its own date interval pattern
+ * information, instead of using those pre-defined data in resource file.
+ * This factory method is for powerful users who want to provide their own
+ * interval patterns.
+ *
+ * There are pre-defined skeletons (defined in udate.h) having predefined
+ * interval patterns in resource files.
+ * Users are encouraged to use those macros.
+ * For example:
+ * DateIntervalFormat::createInstance(UDAT_MONTH_DAY, status)
+ *
+ * The DateIntervalInfo provides the interval patterns.
+ * and the DateIntervalInfo ownership remains to the caller.
+ *
+ * User are encouraged to set default interval pattern in DateIntervalInfo
+ * as well, if they want to set other interval patterns ( instead of
+ * reading the interval patterns from resource files).
+ * When the corresponding interval pattern for a largest calendar different
+ * field is not found ( if user not set it ), interval format fallback to
+ * the default interval pattern.
+ * If user does not provide default interval pattern, it fallback to
+ * "{date0} - {date1}"
+ *
+ * @param skeleton the skeleton on which interval format based.
+ * @param locale the given locale
+ * @param dtitvinf the DateIntervalInfo object.
+ * @param status output param set to success/failure code on exit
+ * @return a date time interval formatter which the caller owns.
+ * @stable ICU 4.0
+ */
+ static DateIntervalFormat* U_EXPORT2 createInstance(
+ const UnicodeString& skeleton,
+ const Locale& locale,
+ const DateIntervalInfo& dtitvinf,
+ UErrorCode& status);
+
+ /**
+ * Destructor.
+ * @stable ICU 4.0
+ */
+ virtual ~DateIntervalFormat();
+
+ /**
+ * Clone this Format object polymorphically. The caller owns the result and
+ * should delete it when done.
+ * @return A copy of the object.
+ * @stable ICU 4.0
+ */
+ virtual DateIntervalFormat* clone() const override;
+
+ /**
+ * Return true if the given Format objects are semantically equal. Objects
+ * of different subclasses are considered unequal.
+ * @param other the object to be compared with.
+ * @return true if the given Format objects are semantically equal.
+ * @stable ICU 4.0
+ */
+ virtual bool operator==(const Format& other) const override;
+
+ /**
+ * Return true if the given Format objects are not semantically equal.
+ * Objects of different subclasses are considered unequal.
+ * @param other the object to be compared with.
+ * @return true if the given Format objects are not semantically equal.
+ * @stable ICU 4.0
+ */
+ bool operator!=(const Format& other) const;
+
+
+ using Format::format;
+
+ /**
+ * Format an object to produce a string. This method handles Formattable
+ * objects with a DateInterval type.
+ * If a the Formattable object type is not a DateInterval,
+ * then it returns a failing UErrorCode.
+ *
+ * @param obj The object to format.
+ * Must be a DateInterval.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param fieldPosition On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * There may be multiple instances of a given field type
+ * in an interval format; in this case the fieldPosition
+ * offsets refer to the first instance.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.0
+ */
+ virtual UnicodeString& format(const Formattable& obj,
+ UnicodeString& appendTo,
+ FieldPosition& fieldPosition,
+ UErrorCode& status) const override;
+
+
+
+ /**
+ * Format a DateInterval to produce a string.
+ *
+ * @param dtInterval DateInterval to be formatted.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param fieldPosition On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * There may be multiple instances of a given field type
+ * in an interval format; in this case the fieldPosition
+ * offsets refer to the first instance.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.0
+ */
+ UnicodeString& format(const DateInterval* dtInterval,
+ UnicodeString& appendTo,
+ FieldPosition& fieldPosition,
+ UErrorCode& status) const ;
+
+ /**
+ * Format a DateInterval to produce a FormattedDateInterval.
+ *
+ * The FormattedDateInterval exposes field information about the formatted string.
+ *
+ * @param dtInterval DateInterval to be formatted.
+ * @param status Set if an error occurs.
+ * @return A FormattedDateInterval containing the format result.
+ * @stable ICU 64
+ */
+ FormattedDateInterval formatToValue(
+ const DateInterval& dtInterval,
+ UErrorCode& status) const;
+
+ /**
+ * Format 2 Calendars to produce a string.
+ *
+ * Note: "fromCalendar" and "toCalendar" are not const,
+ * since calendar is not const in SimpleDateFormat::format(Calendar&),
+ *
+ * @param fromCalendar calendar set to the from date in date interval
+ * to be formatted into date interval string
+ * @param toCalendar calendar set to the to date in date interval
+ * to be formatted into date interval string
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param fieldPosition On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * There may be multiple instances of a given field type
+ * in an interval format; in this case the fieldPosition
+ * offsets refer to the first instance.
+ * @param status Output param filled with success/failure status.
+ * Caller needs to make sure it is SUCCESS
+ * at the function entrance
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.0
+ */
+ UnicodeString& format(Calendar& fromCalendar,
+ Calendar& toCalendar,
+ UnicodeString& appendTo,
+ FieldPosition& fieldPosition,
+ UErrorCode& status) const ;
+
+ /**
+ * Format 2 Calendars to produce a FormattedDateInterval.
+ *
+ * The FormattedDateInterval exposes field information about the formatted string.
+ *
+ * Note: "fromCalendar" and "toCalendar" are not const,
+ * since calendar is not const in SimpleDateFormat::format(Calendar&),
+ *
+ * @param fromCalendar calendar set to the from date in date interval
+ * to be formatted into date interval string
+ * @param toCalendar calendar set to the to date in date interval
+ * to be formatted into date interval string
+ * @param status Set if an error occurs.
+ * @return A FormattedDateInterval containing the format result.
+ * @stable ICU 64
+ */
+ FormattedDateInterval formatToValue(
+ Calendar& fromCalendar,
+ Calendar& toCalendar,
+ UErrorCode& status) const;
+
+ /**
+ * Date interval parsing is not supported. Please do not use.
+ *
+ * This method should handle parsing of
+ * date time interval strings into Formattable objects with
+ * DateInterval type, which is a pair of UDate.
+ *
+ * Before calling, set parse_pos.index to the offset you want to start
+ * parsing at in the source. After calling, parse_pos.index is the end of
+ * the text you parsed. If error occurs, index is unchanged.
+ *
+ * When parsing, leading whitespace is discarded (with a successful parse),
+ * while trailing whitespace is left as is.
+ *
+ * See Format::parseObject() for more.
+ *
+ * @param source The string to be parsed into an object.
+ * @param result Formattable to be set to the parse result.
+ * If parse fails, return contents are undefined.
+ * @param parse_pos The position to start parsing at. Since no parsing
+ * is supported, upon return this param is unchanged.
+ * @return A newly created Formattable* object, or nullptr
+ * on failure. The caller owns this and should
+ * delete it when done.
+ * @internal ICU 4.0
+ */
+ virtual void parseObject(const UnicodeString& source,
+ Formattable& result,
+ ParsePosition& parse_pos) const override;
+
+
+ /**
+ * Gets the date time interval patterns.
+ * @return the date time interval patterns associated with
+ * this date interval formatter.
+ * @stable ICU 4.0
+ */
+ const DateIntervalInfo* getDateIntervalInfo() const;
+
+ /**
+ * Set the date time interval patterns.
+ * @param newIntervalPatterns the given interval patterns to copy.
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.0
+ */
+ void setDateIntervalInfo(const DateIntervalInfo& newIntervalPatterns,
+ UErrorCode& status);
+
+
+ /**
+ * Gets the date formatter. The DateIntervalFormat instance continues to own
+ * the returned DateFormatter object, and will use and possibly modify it
+ * during format operations. In a multi-threaded environment, the returned
+ * DateFormat can only be used if it is certain that no other threads are
+ * concurrently using this DateIntervalFormatter, even for nominally const
+ * functions.
+ *
+ * @return the date formatter associated with this date interval formatter.
+ * @stable ICU 4.0
+ */
+ const DateFormat* getDateFormat() const;
+
+ /**
+ * Returns a reference to the TimeZone used by this DateIntervalFormat's calendar.
+ * @return the time zone associated with the calendar of DateIntervalFormat.
+ * @stable ICU 4.8
+ */
+ virtual const TimeZone& getTimeZone() const;
+
+ /**
+ * Sets the time zone for the calendar used by this DateIntervalFormat object. The
+ * caller no longer owns the TimeZone object and should not delete it after this call.
+ * @param zoneToAdopt the TimeZone to be adopted.
+ * @stable ICU 4.8
+ */
+ virtual void adoptTimeZone(TimeZone* zoneToAdopt);
+
+ /**
+ * Sets the time zone for the calendar used by this DateIntervalFormat object.
+ * @param zone the new time zone.
+ * @stable ICU 4.8
+ */
+ virtual void setTimeZone(const TimeZone& zone);
+
+ /**
+ * Set a particular UDisplayContext value in the formatter, such as
+ * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. This causes the formatted
+ * result to be capitalized appropriately for the context in which
+ * it is intended to be used, considering both the locale and the
+ * type of field at the beginning of the formatted result.
+ * @param value The UDisplayContext value to set.
+ * @param status Input/output status. If at entry this indicates a failure
+ * status, the function will do nothing; otherwise this will be
+ * updated with any new status from the function.
+ * @stable ICU 68
+ */
+ virtual void setContext(UDisplayContext value, UErrorCode& status);
+
+ /**
+ * Get the formatter's UDisplayContext value for the specified UDisplayContextType,
+ * such as UDISPCTX_TYPE_CAPITALIZATION.
+ * @param type The UDisplayContextType whose value to return
+ * @param status Input/output status. If at entry this indicates a failure
+ * status, the function will do nothing; otherwise this will be
+ * updated with any new status from the function.
+ * @return The UDisplayContextValue for the specified type.
+ * @stable ICU 68
+ */
+ virtual UDisplayContext getContext(UDisplayContextType type, UErrorCode& status) const;
+
+ /**
+ * Return the class ID for this class. This is useful only for comparing to
+ * a return value from getDynamicClassID(). For example:
+ *
+ * For most users, ordinary use of DateIntervalFormat does not need to create
+ * DateIntervalInfo object directly.
+ * DateIntervalFormat will take care of it when creating a date interval
+ * formatter when user pass in skeleton and locale.
+ *
+ *
+ * For power users, who want to create their own date interval patterns,
+ * or want to re-set date interval patterns, they could do so by
+ * directly creating DateIntervalInfo and manipulating it.
+ *
+ *
+ * Logically, the interval patterns are mappings
+ * from (skeleton, the_largest_different_calendar_field)
+ * to (date_interval_pattern).
+ *
+ *
+ * A skeleton
+ *
+ * The calendar fields we support for interval formatting are:
+ * year, month, date, day-of-week, am-pm, hour, hour-of-day, and minute.
+ * Those calendar fields can be defined in the following order:
+ * year > month > date > am-pm > hour > minute
+ *
+ * The largest different calendar fields between 2 calendars is the
+ * first different calendar field in above order.
+ *
+ * For example: the largest different calendar fields between "Jan 10, 2007"
+ * and "Feb 20, 2008" is year.
+ *
+ *
+ * There is a set of pre-defined static skeleton strings.
+ * There are pre-defined interval patterns for those pre-defined skeletons
+ * in locales' resource files.
+ * For example, for a skeleton UDAT_YEAR_ABBR_MONTH_DAY, which is "yMMMd",
+ * in en_US, if the largest different calendar field between date1 and date2
+ * is "year", the date interval pattern is "MMM d, yyyy - MMM d, yyyy",
+ * such as "Jan 10, 2007 - Jan 10, 2008".
+ * If the largest different calendar field between date1 and date2 is "month",
+ * the date interval pattern is "MMM d - MMM d, yyyy",
+ * such as "Jan 10 - Feb 10, 2007".
+ * If the largest different calendar field between date1 and date2 is "day",
+ * the date interval pattern is "MMM d-d, yyyy", such as "Jan 10-20, 2007".
+ *
+ * For date skeleton, the interval patterns when year, or month, or date is
+ * different are defined in resource files.
+ * For time skeleton, the interval patterns when am/pm, or hour, or minute is
+ * different are defined in resource files.
+ *
+ *
+ *
+ * There are 2 dates in interval pattern. For most locales, the first date
+ * in an interval pattern is the earlier date. There might be a locale in which
+ * the first date in an interval pattern is the later date.
+ * We use fallback format for the default order for the locale.
+ * For example, if the fallback format is "{0} - {1}", it means
+ * the first date in the interval pattern for this locale is earlier date.
+ * If the fallback format is "{1} - {0}", it means the first date is the
+ * later date.
+ * For a particular interval pattern, the default order can be overridden
+ * by prefixing "latestFirst:" or "earliestFirst:" to the interval pattern.
+ * For example, if the fallback format is "{0}-{1}",
+ * but for skeleton "yMMMd", the interval pattern when day is different is
+ * "latestFirst:d-d MMM yy", it means by default, the first date in interval
+ * pattern is the earlier date. But for skeleton "yMMMd", when day is different,
+ * the first date in "d-d MMM yy" is the later date.
+ *
+ *
+ * The recommended way to create a DateIntervalFormat object is to pass in
+ * the locale.
+ * By using a Locale parameter, the DateIntervalFormat object is
+ * initialized with the pre-defined interval patterns for a given or
+ * default locale.
+ *
+ * Users can also create DateIntervalFormat object
+ * by supplying their own interval patterns.
+ * It provides flexibility for power users.
+ *
+ *
+ * After a DateIntervalInfo object is created, clients may modify
+ * the interval patterns using setIntervalPattern function as so desired.
+ * Currently, users can only set interval patterns when the following
+ * calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH,
+ * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND.
+ * Interval patterns when other calendar fields are different is not supported.
+ *
+ * DateIntervalInfo objects are cloneable.
+ * When clients obtain a DateIntervalInfo object,
+ * they can feel free to modify it as necessary.
+ *
+ * DateIntervalInfo are not expected to be subclassed.
+ * Data for a calendar is loaded out of resource bundles.
+ * Through ICU 4.4, date interval patterns are only supported in the Gregorian
+ * calendar; non-Gregorian calendars are supported from ICU 4.4.1.
+ * @stable ICU 4.0
+**/
+class U_I18N_API DateIntervalInfo final : public UObject {
+public:
+ /**
+ * Default constructor.
+ * It does not initialize any interval patterns except
+ * that it initialize default fall-back pattern as "{0} - {1}",
+ * which can be reset by setFallbackIntervalPattern().
+ * It should be followed by setFallbackIntervalPattern() and
+ * setIntervalPattern(),
+ * and is recommended to be used only for power users who
+ * wants to create their own interval patterns and use them to create
+ * date interval formatter.
+ * @param status output param set to success/failure code on exit
+ * @internal ICU 4.0
+ */
+ DateIntervalInfo(UErrorCode& status);
+
+
+ /**
+ * Construct DateIntervalInfo for the given locale,
+ * @param locale the interval patterns are loaded from the appropriate calendar
+ * data (specified calendar or default calendar) in this locale.
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.0
+ */
+ DateIntervalInfo(const Locale& locale, UErrorCode& status);
+
+
+ /**
+ * Copy constructor.
+ * @stable ICU 4.0
+ */
+ DateIntervalInfo(const DateIntervalInfo&);
+
+ /**
+ * Assignment operator
+ * @stable ICU 4.0
+ */
+ DateIntervalInfo& operator=(const DateIntervalInfo&);
+
+ /**
+ * Clone this object polymorphically.
+ * The caller owns the result and should delete it when done.
+ * @return a copy of the object
+ * @stable ICU 4.0
+ */
+ virtual DateIntervalInfo* clone() const;
+
+ /**
+ * Destructor.
+ * It is virtual to be safe, but it is not designed to be subclassed.
+ * @stable ICU 4.0
+ */
+ virtual ~DateIntervalInfo();
+
+
+ /**
+ * Return true if another object is semantically equal to this one.
+ *
+ * @param other the DateIntervalInfo object to be compared with.
+ * @return true if other is semantically equal to this.
+ * @stable ICU 4.0
+ */
+ virtual bool operator==(const DateIntervalInfo& other) const;
+
+ /**
+ * Return true if another object is semantically unequal to this one.
+ *
+ * @param other the DateIntervalInfo object to be compared with.
+ * @return true if other is semantically unequal to this.
+ * @stable ICU 4.0
+ */
+ bool operator!=(const DateIntervalInfo& other) const;
+
+
+
+ /**
+ * Provides a way for client to build interval patterns.
+ * User could construct DateIntervalInfo by providing a list of skeletons
+ * and their patterns.
+ *
+ * For example:
+ * The main method people will use is getBestPattern(String skeleton),
+ * since normally this class is pre-built with data from a particular locale.
+ * However, generators can be built directly from other data as well.
+ * Issue: may be useful to also have a function that returns the list of
+ * fields in a pattern, in order, since we have that internally.
+ * That would be useful for getting the UI order of field elements.
+ * @stable ICU 3.8
+**/
+class U_I18N_API DateTimePatternGenerator : public UObject {
+public:
+ /**
+ * Construct a flexible generator according to default locale.
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @stable ICU 3.8
+ */
+ static DateTimePatternGenerator* U_EXPORT2 createInstance(UErrorCode& status);
+
+ /**
+ * Construct a flexible generator according to data for a given locale.
+ * @param uLocale
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @stable ICU 3.8
+ */
+ static DateTimePatternGenerator* U_EXPORT2 createInstance(const Locale& uLocale, UErrorCode& status);
+
+#ifndef U_HIDE_INTERNAL_API
+
+ /**
+ * For ICU use only. Skips loading the standard date/time patterns (which is done via DateFormat).
+ *
+ * @internal
+ */
+ static DateTimePatternGenerator* U_EXPORT2 createInstanceNoStdPat(const Locale& uLocale, UErrorCode& status);
+
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Create an empty generator, to be constructed with addPattern(...) etc.
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @stable ICU 3.8
+ */
+ static DateTimePatternGenerator* U_EXPORT2 createEmptyInstance(UErrorCode& status);
+
+ /**
+ * Destructor.
+ * @stable ICU 3.8
+ */
+ virtual ~DateTimePatternGenerator();
+
+ /**
+ * Clone DateTimePatternGenerator object. Clients are responsible for
+ * deleting the DateTimePatternGenerator object cloned.
+ * @stable ICU 3.8
+ */
+ DateTimePatternGenerator* clone() const;
+
+ /**
+ * Return true if another object is semantically equal to this one.
+ *
+ * @param other the DateTimePatternGenerator object to be compared with.
+ * @return true if other is semantically equal to this.
+ * @stable ICU 3.8
+ */
+ bool operator==(const DateTimePatternGenerator& other) const;
+
+ /**
+ * Return true if another object is semantically unequal to this one.
+ *
+ * @param other the DateTimePatternGenerator object to be compared with.
+ * @return true if other is semantically unequal to this.
+ * @stable ICU 3.8
+ */
+ bool operator!=(const DateTimePatternGenerator& other) const;
+
+ /**
+ * Utility to return a unique skeleton from a given pattern. For example,
+ * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd".
+ *
+ * @param pattern Input pattern, such as "dd/MMM"
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return skeleton such as "MMMdd"
+ * @stable ICU 56
+ */
+ static UnicodeString staticGetSkeleton(const UnicodeString& pattern, UErrorCode& status);
+
+ /**
+ * Utility to return a unique skeleton from a given pattern. For example,
+ * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd".
+ * getSkeleton() works exactly like staticGetSkeleton().
+ * Use staticGetSkeleton() instead of getSkeleton().
+ *
+ * @param pattern Input pattern, such as "dd/MMM"
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return skeleton such as "MMMdd"
+ * @stable ICU 3.8
+ */
+ UnicodeString getSkeleton(const UnicodeString& pattern, UErrorCode& status); /* {
+ The function is commented out because it is a stable API calling a draft API.
+ After staticGetSkeleton becomes stable, staticGetSkeleton can be used and
+ these comments and the definition of getSkeleton in dtptngen.cpp should be removed.
+ return staticGetSkeleton(pattern, status);
+ }*/
+
+ /**
+ * Utility to return a unique base skeleton from a given pattern. This is
+ * the same as the skeleton, except that differences in length are minimized
+ * so as to only preserve the difference between string and numeric form. So
+ * for example, both "MMM-dd" and "d/MMM" produce the skeleton "MMMd"
+ * (notice the single d).
+ *
+ * @param pattern Input pattern, such as "dd/MMM"
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return base skeleton, such as "MMMd"
+ * @stable ICU 56
+ */
+ static UnicodeString staticGetBaseSkeleton(const UnicodeString& pattern, UErrorCode& status);
+
+ /**
+ * Utility to return a unique base skeleton from a given pattern. This is
+ * the same as the skeleton, except that differences in length are minimized
+ * so as to only preserve the difference between string and numeric form. So
+ * for example, both "MMM-dd" and "d/MMM" produce the skeleton "MMMd"
+ * (notice the single d).
+ * getBaseSkeleton() works exactly like staticGetBaseSkeleton().
+ * Use staticGetBaseSkeleton() instead of getBaseSkeleton().
+ *
+ * @param pattern Input pattern, such as "dd/MMM"
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return base skeleton, such as "MMMd"
+ * @stable ICU 3.8
+ */
+ UnicodeString getBaseSkeleton(const UnicodeString& pattern, UErrorCode& status); /* {
+ The function is commented out because it is a stable API calling a draft API.
+ After staticGetBaseSkeleton becomes stable, staticGetBaseSkeleton can be used and
+ these comments and the definition of getBaseSkeleton in dtptngen.cpp should be removed.
+ return staticGetBaseSkeleton(pattern, status);
+ }*/
+
+ /**
+ * Adds a pattern to the generator. If the pattern has the same skeleton as
+ * an existing pattern, and the override parameter is set, then the previous
+ * value is overridden. Otherwise, the previous value is retained. In either
+ * case, the conflicting status is set and previous vale is stored in
+ * conflicting pattern.
+ *
+ * Note that single-field patterns (like "MMM") are automatically added, and
+ * don't need to be added explicitly!
+ *
+ * @param pattern Input pattern, such as "dd/MMM"
+ * @param override When existing values are to be overridden use true,
+ * otherwise use false.
+ * @param conflictingPattern Previous pattern with the same skeleton.
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return conflicting status. The value could be UDATPG_NO_CONFLICT,
+ * UDATPG_BASE_CONFLICT or UDATPG_CONFLICT.
+ * @stable ICU 3.8
+ */
+ UDateTimePatternConflict addPattern(const UnicodeString& pattern,
+ UBool override,
+ UnicodeString& conflictingPattern,
+ UErrorCode& status);
+
+ /**
+ * An AppendItem format is a pattern used to append a field if there is no
+ * good match. For example, suppose that the input skeleton is "GyyyyMMMd",
+ * and there is no matching pattern internally, but there is a pattern
+ * matching "yyyyMMMd", say "d-MM-yyyy". Then that pattern is used, plus the
+ * G. The way these two are conjoined is by using the AppendItemFormat for G
+ * (era). So if that value is, say "{0}, {1}" then the final resulting
+ * pattern is "d-MM-yyyy, G".
+ *
+ * There are actually three available variables: {0} is the pattern so far,
+ * {1} is the element we are adding, and {2} is the name of the element.
+ *
+ * This reflects the way that the CLDR data is organized.
+ *
+ * @param field such as UDATPG_ERA_FIELD.
+ * @param value pattern, such as "{0}, {1}"
+ * @stable ICU 3.8
+ */
+ void setAppendItemFormat(UDateTimePatternField field, const UnicodeString& value);
+
+ /**
+ * Getter corresponding to setAppendItemFormat. Values below 0 or at or
+ * above UDATPG_FIELD_COUNT are illegal arguments.
+ *
+ * @param field such as UDATPG_ERA_FIELD.
+ * @return append pattern for field
+ * @stable ICU 3.8
+ */
+ const UnicodeString& getAppendItemFormat(UDateTimePatternField field) const;
+
+ /**
+ * Sets the names of field, eg "era" in English for ERA. These are only
+ * used if the corresponding AppendItemFormat is used, and if it contains a
+ * {2} variable.
+ *
+ * This reflects the way that the CLDR data is organized.
+ *
+ * @param field such as UDATPG_ERA_FIELD.
+ * @param value name of the field
+ * @stable ICU 3.8
+ */
+ void setAppendItemName(UDateTimePatternField field, const UnicodeString& value);
+
+ /**
+ * Getter corresponding to setAppendItemNames. Values below 0 or at or above
+ * UDATPG_FIELD_COUNT are illegal arguments. Note: The more general method
+ * for getting date/time field display names is getFieldDisplayName.
+ *
+ * @param field such as UDATPG_ERA_FIELD.
+ * @return name for field
+ * @see getFieldDisplayName
+ * @stable ICU 3.8
+ */
+ const UnicodeString& getAppendItemName(UDateTimePatternField field) const;
+
+ /**
+ * The general interface to get a display name for a particular date/time field,
+ * in one of several possible display widths.
+ *
+ * @param field The desired UDateTimePatternField, such as UDATPG_ERA_FIELD.
+ * @param width The desired UDateTimePGDisplayWidth, such as UDATPG_ABBREVIATED.
+ * @return The display name for field
+ * @stable ICU 61
+ */
+ UnicodeString getFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width) const;
+
+ /**
+ * The DateTimeFormat is a message format pattern used to compose date and
+ * time patterns. The default pattern in the root locale is "{1} {0}", where
+ * {1} will be replaced by the date pattern and {0} will be replaced by the
+ * time pattern; however, other locales may specify patterns such as
+ * "{1}, {0}" or "{1} 'at' {0}", etc.
+ *
+ * This is used when the input skeleton contains both date and time fields,
+ * but there is not a close match among the added patterns. For example,
+ * suppose that this object was created by adding "dd-MMM" and "hh:mm", and
+ * its datetimeFormat is the default "{1} {0}". Then if the input skeleton
+ * is "MMMdhmm", there is not an exact match, so the input skeleton is
+ * broken up into two components "MMMd" and "hmm". There are close matches
+ * for those two skeletons, so the result is put together with this pattern,
+ * resulting in "d-MMM h:mm".
+ *
+ * There are four DateTimeFormats in a DateTimePatternGenerator object,
+ * corresponding to date styles UDAT_FULL..UDAT_SHORT. This method sets
+ * all of them to the specified pattern. To set them individually, see
+ * setDateTimeFormat(UDateFormatStyle style, ...).
+ *
+ * @param dateTimeFormat
+ * message format pattern, here {1} will be replaced by the date
+ * pattern and {0} will be replaced by the time pattern.
+ * @stable ICU 3.8
+ */
+ void setDateTimeFormat(const UnicodeString& dateTimeFormat);
+
+ /**
+ * Getter corresponding to setDateTimeFormat.
+ *
+ * There are four DateTimeFormats in a DateTimePatternGenerator object,
+ * corresponding to date styles UDAT_FULL..UDAT_SHORT. This method gets
+ * the style for UDAT_MEDIUM (the default). To get them individually, see
+ * getDateTimeFormat(UDateFormatStyle style).
+ *
+ * @return DateTimeFormat.
+ * @stable ICU 3.8
+ */
+ const UnicodeString& getDateTimeFormat() const;
+
+#if !UCONFIG_NO_FORMATTING
+ /**
+ * dateTimeFormats are message patterns used to compose combinations of date
+ * and time patterns. There are four length styles, corresponding to the
+ * inferred style of the date pattern; these are UDateFormatStyle values:
+ * - UDAT_FULL (for date pattern with weekday and long month), else
+ * - UDAT_LONG (for a date pattern with long month), else
+ * - UDAT_MEDIUM (for a date pattern with abbreviated month), else
+ * - UDAT_SHORT (for any other date pattern).
+ * For details on dateTimeFormats, see
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#dateTimeFormats.
+ * The default pattern in the root locale for all styles is "{1} {0}".
+ *
+ * @param style
+ * one of DateFormat.FULL..DateFormat.SHORT. Error if out of range.
+ * @param dateTimeFormat
+ * the new dateTimeFormat to set for the the specified style
+ * @param status
+ * in/out parameter; if no failure status is already set,
+ * it will be set according to result of the function (e.g.
+ * U_ILLEGAL_ARGUMENT_ERROR for style out of range).
+ * @stable ICU 71
+ */
+ void setDateTimeFormat(UDateFormatStyle style, const UnicodeString& dateTimeFormat,
+ UErrorCode& status);
+
+ /**
+ * Getter corresponding to setDateTimeFormat.
+ *
+ * @param style
+ * one of UDAT_FULL..UDAT_SHORT. Error if out of range.
+ * @param status
+ * in/out parameter; if no failure status is already set,
+ * it will be set according to result of the function (e.g.
+ * U_ILLEGAL_ARGUMENT_ERROR for style out of range).
+ * @return
+ * the current dateTimeFormat for the the specified style, or
+ * empty string in case of error. The UnicodeString reference,
+ * or the contents of the string, may no longer be valid if
+ * setDateTimeFormat is called, or the DateTimePatternGenerator
+ * object is deleted.
+ * @stable ICU 71
+ */
+ const UnicodeString& getDateTimeFormat(UDateFormatStyle style,
+ UErrorCode& status) const;
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+ /**
+ * Return the best pattern matching the input skeleton. It is guaranteed to
+ * have all of the fields in the skeleton.
+ *
+ * @param skeleton
+ * The skeleton is a pattern containing only the variable fields.
+ * For example, "MMMdd" and "mmhh" are skeletons.
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return bestPattern
+ * The best pattern found from the given skeleton.
+ * @stable ICU 3.8
+ */
+ UnicodeString getBestPattern(const UnicodeString& skeleton, UErrorCode& status);
+
+
+ /**
+ * Return the best pattern matching the input skeleton. It is guaranteed to
+ * have all of the fields in the skeleton.
+ *
+ * @param skeleton
+ * The skeleton is a pattern containing only the variable fields.
+ * For example, "MMMdd" and "mmhh" are skeletons.
+ * @param options
+ * Options for forcing the length of specified fields in the
+ * returned pattern to match those in the skeleton (when this
+ * would not happen otherwise). For default behavior, use
+ * UDATPG_MATCH_NO_OPTIONS.
+ * @param status
+ * Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return bestPattern
+ * The best pattern found from the given skeleton.
+ * @stable ICU 4.4
+ */
+ UnicodeString getBestPattern(const UnicodeString& skeleton,
+ UDateTimePatternMatchOptions options,
+ UErrorCode& status);
+
+
+ /**
+ * Adjusts the field types (width and subtype) of a pattern to match what is
+ * in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
+ * skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
+ * "dd-MMMM hh:mm". This is used internally to get the best match for the
+ * input skeleton, but can also be used externally.
+ *
+ * @param pattern Input pattern
+ * @param skeleton
+ * The skeleton is a pattern containing only the variable fields.
+ * For example, "MMMdd" and "mmhh" are skeletons.
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return pattern adjusted to match the skeleton fields widths and subtypes.
+ * @stable ICU 3.8
+ */
+ UnicodeString replaceFieldTypes(const UnicodeString& pattern,
+ const UnicodeString& skeleton,
+ UErrorCode& status);
+
+ /**
+ * Adjusts the field types (width and subtype) of a pattern to match what is
+ * in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
+ * skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
+ * "dd-MMMM hh:mm". This is used internally to get the best match for the
+ * input skeleton, but can also be used externally.
+ *
+ * @param pattern Input pattern
+ * @param skeleton
+ * The skeleton is a pattern containing only the variable fields.
+ * For example, "MMMdd" and "mmhh" are skeletons.
+ * @param options
+ * Options controlling whether the length of specified fields in the
+ * pattern are adjusted to match those in the skeleton (when this
+ * would not happen otherwise). For default behavior, use
+ * UDATPG_MATCH_NO_OPTIONS.
+ * @param status
+ * Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return pattern adjusted to match the skeleton fields widths and subtypes.
+ * @stable ICU 4.4
+ */
+ UnicodeString replaceFieldTypes(const UnicodeString& pattern,
+ const UnicodeString& skeleton,
+ UDateTimePatternMatchOptions options,
+ UErrorCode& status);
+
+ /**
+ * Return a list of all the skeletons (in canonical form) from this class.
+ *
+ * Call getPatternForSkeleton() to get the corresponding pattern.
+ *
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return StringEnumeration with the skeletons.
+ * The caller must delete the object.
+ * @stable ICU 3.8
+ */
+ StringEnumeration* getSkeletons(UErrorCode& status) const;
+
+ /**
+ * Get the pattern corresponding to a given skeleton.
+ * @param skeleton
+ * @return pattern corresponding to a given skeleton.
+ * @stable ICU 3.8
+ */
+ const UnicodeString& getPatternForSkeleton(const UnicodeString& skeleton) const;
+
+ /**
+ * Return a list of all the base skeletons (in canonical form) from this class.
+ *
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return a StringEnumeration with the base skeletons.
+ * The caller must delete the object.
+ * @stable ICU 3.8
+ */
+ StringEnumeration* getBaseSkeletons(UErrorCode& status) const;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Return a list of redundant patterns are those which if removed, make no
+ * difference in the resulting getBestPattern values. This method returns a
+ * list of them, to help check the consistency of the patterns used to build
+ * this generator.
+ *
+ * @param status Output param set to success/failure code on exit,
+ * which must not indicate a failure before the function call.
+ * @return a StringEnumeration with the redundant pattern.
+ * The caller must delete the object.
+ * @internal ICU 3.8
+ */
+ StringEnumeration* getRedundants(UErrorCode& status);
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * The decimal value is used in formatting fractions of seconds. If the
+ * skeleton contains fractional seconds, then this is used with the
+ * fractional seconds. For example, suppose that the input pattern is
+ * "hhmmssSSSS", and the best matching pattern internally is "H:mm:ss", and
+ * the decimal string is ",". Then the resulting pattern is modified to be
+ * "H:mm:ss,SSSS"
+ *
+ * @param decimal
+ * @stable ICU 3.8
+ */
+ void setDecimal(const UnicodeString& decimal);
+
+ /**
+ * Getter corresponding to setDecimal.
+ * @return UnicodeString corresponding to the decimal point
+ * @stable ICU 3.8
+ */
+ const UnicodeString& getDecimal() const;
+
+#if !UCONFIG_NO_FORMATTING
+
+ /**
+ * Get the default hour cycle for a locale. Uses the locale that the
+ * DateTimePatternGenerator was initially created with.
+ *
+ * Cannot be used on an empty DateTimePatternGenerator instance.
+ *
+ * @param status Output param set to success/failure code on exit, which
+ * which must not indicate a failure before the function call.
+ * Set to U_UNSUPPORTED_ERROR if used on an empty instance.
+ * @return the default hour cycle.
+ * @stable ICU 67
+ */
+ UDateFormatHourCycle getDefaultHourCycle(UErrorCode& status) const;
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for the actual class.
+ *
+ * @stable ICU 3.8
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for this class.
+ *
+ * @stable ICU 3.8
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+private:
+ /**
+ * Constructor.
+ */
+ DateTimePatternGenerator(UErrorCode & status);
+
+ /**
+ * Constructor.
+ */
+ DateTimePatternGenerator(const Locale& locale, UErrorCode & status, UBool skipStdPatterns = false);
+
+ /**
+ * Copy constructor.
+ * @param other DateTimePatternGenerator to copy
+ */
+ DateTimePatternGenerator(const DateTimePatternGenerator& other);
+
+ /**
+ * Default assignment operator.
+ * @param other DateTimePatternGenerator to copy
+ */
+ DateTimePatternGenerator& operator=(const DateTimePatternGenerator& other);
+
+ static const int32_t UDATPG_WIDTH_COUNT = UDATPG_NARROW + 1;
+
+ Locale pLocale; // pattern locale
+ FormatParser *fp;
+ DateTimeMatcher* dtMatcher;
+ DistanceInfo *distanceInfo;
+ PatternMap *patternMap;
+ UnicodeString appendItemFormats[UDATPG_FIELD_COUNT];
+ UnicodeString fieldDisplayNames[UDATPG_FIELD_COUNT][UDATPG_WIDTH_COUNT];
+ UnicodeString dateTimeFormat[4];
+ UnicodeString decimal;
+ DateTimeMatcher *skipMatcher;
+ Hashtable *fAvailableFormatKeyHash;
+ UnicodeString emptyString;
+ char16_t fDefaultHourFormatChar;
+
+ int32_t fAllowedHourFormats[7]; // Actually an array of AllowedHourFormat enum type, ending with UNKNOWN.
+
+ // Internal error code used for recording/reporting errors that occur during methods that do not
+ // have a UErrorCode parameter. For example: the Copy Constructor, or the ::clone() method.
+ // When this is set to an error the object is in an invalid state.
+ UErrorCode internalErrorCode;
+
+ /* internal flags masks for adjustFieldTypes etc. */
+ enum {
+ kDTPGNoFlags = 0,
+ kDTPGFixFractionalSeconds = 1,
+ kDTPGSkeletonUsesCapJ = 2
+ // with #13183, no longer need flags for b, B
+ };
+
+ void initData(const Locale &locale, UErrorCode &status, UBool skipStdPatterns = false);
+ void addCanonicalItems(UErrorCode &status);
+ void addICUPatterns(const Locale& locale, UErrorCode& status);
+ void hackTimes(const UnicodeString& hackPattern, UErrorCode& status);
+ void getCalendarTypeToUse(const Locale& locale, CharString& destination, UErrorCode& err);
+ void consumeShortTimePattern(const UnicodeString& shortTimePattern, UErrorCode& status);
+ void addCLDRData(const Locale& locale, UErrorCode& status);
+ UDateTimePatternConflict addPatternWithSkeleton(const UnicodeString& pattern, const UnicodeString * skeletonToUse, UBool override, UnicodeString& conflictingPattern, UErrorCode& status);
+ void initHashtable(UErrorCode& status);
+ void setDateTimeFromCalendar(const Locale& locale, UErrorCode& status);
+ void setDecimalSymbols(const Locale& locale, UErrorCode& status);
+ UDateTimePatternField getAppendFormatNumber(const char* field) const;
+ // Note for the next 3: UDateTimePGDisplayWidth is now stable ICU 61
+ UDateTimePatternField getFieldAndWidthIndices(const char* key, UDateTimePGDisplayWidth* widthP) const;
+ void setFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width, const UnicodeString& value);
+ UnicodeString& getMutableFieldDisplayName(UDateTimePatternField field, UDateTimePGDisplayWidth width);
+ void getAppendName(UDateTimePatternField field, UnicodeString& value);
+ UnicodeString mapSkeletonMetacharacters(const UnicodeString& patternForm, int32_t* flags, UErrorCode& status);
+ const UnicodeString* getBestRaw(DateTimeMatcher& source, int32_t includeMask, DistanceInfo* missingFields, UErrorCode& status, const PtnSkeleton** specifiedSkeletonPtr = nullptr);
+ UnicodeString adjustFieldTypes(const UnicodeString& pattern, const PtnSkeleton* specifiedSkeleton, int32_t flags, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS);
+ UnicodeString getBestAppending(int32_t missingFields, int32_t flags, UErrorCode& status, UDateTimePatternMatchOptions options = UDATPG_MATCH_NO_OPTIONS);
+ int32_t getTopBitNumber(int32_t foundMask) const;
+ void setAvailableFormat(const UnicodeString &key, UErrorCode& status);
+ UBool isAvailableFormatSet(const UnicodeString &key) const;
+ void copyHashtable(Hashtable *other, UErrorCode &status);
+ UBool isCanonicalItem(const UnicodeString& item) const;
+ static void U_CALLCONV loadAllowedHourFormatsData(UErrorCode &status);
+ void getAllowedHourFormats(const Locale &locale, UErrorCode &status);
+
+ struct U_HIDDEN AppendItemFormatsSink;
+ struct U_HIDDEN AppendItemNamesSink;
+ struct U_HIDDEN AvailableFormatsSink;
+} ;// end class DateTimePatternGenerator
+
+U_NAMESPACE_END
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtrule.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtrule.h
new file mode 100644
index 0000000000..6e10bfcb04
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtrule.h
@@ -0,0 +1,256 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+*******************************************************************************
+* Copyright (C) 2007-2008, International Business Machines Corporation and *
+* others. All Rights Reserved. *
+*******************************************************************************
+*/
+#ifndef DTRULE_H
+#define DTRULE_H
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+/**
+ * \file
+ * \brief C++ API: Rule for specifying date and time in an year
+ */
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/uobject.h"
+
+U_NAMESPACE_BEGIN
+/**
+ *
+ *
+ * One version of the
+ * Below is an example of using
+ * The code will generate the following output:
+ * Internally, a Formattable object is a union of primitive types.
+ * As such, it can only store one flavor of data at a time. To
+ * determine what flavor of data it contains, use the getType method.
+ *
+ * As of ICU 3.0, Formattable may also wrap a UObject pointer,
+ * which it owns. This allows an instance of any ICU class to be
+ * encapsulated in a Formattable. For legacy reasons and for
+ * efficiency, primitive numeric types are still stored directly
+ * within a Formattable.
+ *
+ * The Formattable class is not suitable for subclassing.
+ *
+ * See UFormattable for a C wrapper.
+ */
+class U_I18N_API Formattable : public UObject {
+public:
+ /**
+ * This enum is only used to let callers distinguish between
+ * the Formattable(UDate) constructor and the Formattable(double)
+ * constructor; the compiler cannot distinguish the signatures,
+ * since UDate is currently typedefed to be either double or long.
+ * If UDate is changed later to be a bonafide class
+ * or struct, then we no longer need this enum.
+ * @stable ICU 2.4
+ */
+ enum ISDATE { kIsDate };
+
+ /**
+ * Default constructor
+ * @stable ICU 2.4
+ */
+ Formattable(); // Type kLong, value 0
+
+ /**
+ * Creates a Formattable object with a UDate instance.
+ * @param d the UDate instance.
+ * @param flag the flag to indicate this is a date. Always set it to kIsDate
+ * @stable ICU 2.0
+ */
+ Formattable(UDate d, ISDATE flag);
+
+ /**
+ * Creates a Formattable object with a double number.
+ * @param d the double number.
+ * @stable ICU 2.0
+ */
+ Formattable(double d);
+
+ /**
+ * Creates a Formattable object with a long number.
+ * @param l the long number.
+ * @stable ICU 2.0
+ */
+ Formattable(int32_t l);
+
+ /**
+ * Creates a Formattable object with an int64_t number
+ * @param ll the int64_t number.
+ * @stable ICU 2.8
+ */
+ Formattable(int64_t ll);
+
+#if !UCONFIG_NO_CONVERSION
+ /**
+ * Creates a Formattable object with a char string pointer.
+ * Assumes that the char string is null terminated.
+ * @param strToCopy the char string.
+ * @stable ICU 2.0
+ */
+ Formattable(const char* strToCopy);
+#endif
+
+ /**
+ * Creates a Formattable object of an appropriate numeric type from a
+ * a decimal number in string form. The Formattable will retain the
+ * full precision of the input in decimal format, even when it exceeds
+ * what can be represented by a double or int64_t.
+ *
+ * @param number the unformatted (not localized) string representation
+ * of the Decimal number.
+ * @param status the error code. Possible errors include U_INVALID_FORMAT_ERROR
+ * if the format of the string does not conform to that of a
+ * decimal number.
+ * @stable ICU 4.4
+ */
+ Formattable(StringPiece number, UErrorCode &status);
+
+ /**
+ * Creates a Formattable object with a UnicodeString object to copy from.
+ * @param strToCopy the UnicodeString string.
+ * @stable ICU 2.0
+ */
+ Formattable(const UnicodeString& strToCopy);
+
+ /**
+ * Creates a Formattable object with a UnicodeString object to adopt from.
+ * @param strToAdopt the UnicodeString string.
+ * @stable ICU 2.0
+ */
+ Formattable(UnicodeString* strToAdopt);
+
+ /**
+ * Creates a Formattable object with an array of Formattable objects.
+ * @param arrayToCopy the Formattable object array.
+ * @param count the array count.
+ * @stable ICU 2.0
+ */
+ Formattable(const Formattable* arrayToCopy, int32_t count);
+
+ /**
+ * Creates a Formattable object that adopts the given UObject.
+ * @param objectToAdopt the UObject to set this object to
+ * @stable ICU 3.0
+ */
+ Formattable(UObject* objectToAdopt);
+
+ /**
+ * Copy constructor.
+ * @stable ICU 2.0
+ */
+ Formattable(const Formattable&);
+
+ /**
+ * Assignment operator.
+ * @param rhs The Formattable object to copy into this object.
+ * @stable ICU 2.0
+ */
+ Formattable& operator=(const Formattable &rhs);
+
+ /**
+ * Equality comparison.
+ * @param other the object to be compared with.
+ * @return true if other are equal to this, false otherwise.
+ * @stable ICU 2.0
+ */
+ bool operator==(const Formattable &other) const;
+
+ /**
+ * Equality operator.
+ * @param other the object to be compared with.
+ * @return true if other are unequal to this, false otherwise.
+ * @stable ICU 2.0
+ */
+ bool operator!=(const Formattable& other) const
+ { return !operator==(other); }
+
+ /**
+ * Destructor.
+ * @stable ICU 2.0
+ */
+ virtual ~Formattable();
+
+ /**
+ * Clone this object.
+ * Clones can be used concurrently in multiple threads.
+ * If an error occurs, then nullptr is returned.
+ * The caller must delete the clone.
+ *
+ * @return a clone of this object
+ *
+ * @see getDynamicClassID
+ * @stable ICU 2.8
+ */
+ Formattable *clone() const;
+
+ /**
+ * Selector for flavor of data type contained within a
+ * Formattable object. Formattable is a union of several
+ * different types, and at any time contains exactly one type.
+ * @stable ICU 2.4
+ */
+ enum Type {
+ /**
+ * Selector indicating a UDate value. Use getDate to retrieve
+ * the value.
+ * @stable ICU 2.4
+ */
+ kDate,
+
+ /**
+ * Selector indicating a double value. Use getDouble to
+ * retrieve the value.
+ * @stable ICU 2.4
+ */
+ kDouble,
+
+ /**
+ * Selector indicating a 32-bit integer value. Use getLong to
+ * retrieve the value.
+ * @stable ICU 2.4
+ */
+ kLong,
+
+ /**
+ * Selector indicating a UnicodeString value. Use getString
+ * to retrieve the value.
+ * @stable ICU 2.4
+ */
+ kString,
+
+ /**
+ * Selector indicating an array of Formattables. Use getArray
+ * to retrieve the value.
+ * @stable ICU 2.4
+ */
+ kArray,
+
+ /**
+ * Selector indicating a 64-bit integer value. Use getInt64
+ * to retrieve the value.
+ * @stable ICU 2.8
+ */
+ kInt64,
+
+ /**
+ * Selector indicating a UObject value. Use getObject to
+ * retrieve the value.
+ * @stable ICU 3.0
+ */
+ kObject
+ };
+
+ /**
+ * Gets the data type of this Formattable object.
+ * @return the data type of this Formattable object.
+ * @stable ICU 2.0
+ */
+ Type getType() const;
+
+ /**
+ * Returns true if the data type of this Formattable object
+ * is kDouble, kLong, or kInt64
+ * @return true if this is a pure numeric object
+ * @stable ICU 3.0
+ */
+ UBool isNumeric() const;
+
+ /**
+ * Gets the double value of this object. If this object is not of type
+ * kDouble then the result is undefined.
+ * @return the double value of this object.
+ * @stable ICU 2.0
+ */
+ double getDouble() const { return fValue.fDouble; }
+
+ /**
+ * Gets the double value of this object. If this object is of type
+ * long, int64 or Decimal Number then a conversion is performed, with
+ * possible loss of precision. If the type is kObject and the
+ * object is a Measure, then the result of
+ * getNumber().getDouble(status) is returned. If this object is
+ * neither a numeric type nor a Measure, then 0 is returned and
+ * the status is set to U_INVALID_FORMAT_ERROR.
+ * @param status the error code
+ * @return the double value of this object.
+ * @stable ICU 3.0
+ */
+ double getDouble(UErrorCode& status) const;
+
+ /**
+ * Gets the long value of this object. If this object is not of type
+ * kLong then the result is undefined.
+ * @return the long value of this object.
+ * @stable ICU 2.0
+ */
+ int32_t getLong() const { return static_cast
+ * Many of the concrete subclasses of Format employ the notion of
+ * a pattern. A pattern is a string representation of the rules which
+ * govern the interconversion between values and strings. For example,
+ * a DecimalFormat object may be associated with the pattern
+ * "$#,##0.00;($#,##0.00)", which is a common US English format for
+ * currency values, yielding strings such as "$1,234.45" for 1234.45,
+ * and "($987.65)" for 987.6543. The specific syntax of a pattern
+ * is defined by each subclass.
+ *
+ * Even though many subclasses use patterns, the notion of a pattern
+ * is not inherent to Format classes in general, and is not part of
+ * the explicit base class protocol.
+ *
+ * Two complex formatting classes bear mentioning. These are
+ * MessageFormat and ChoiceFormat. ChoiceFormat is a subclass of
+ * NumberFormat which allows the user to format different number ranges
+ * as strings. For instance, 0 may be represented as "no files", 1 as
+ * "one file", and any number greater than 1 as "many files".
+ * MessageFormat is a formatter which utilizes other Format objects to
+ * format a string containing with multiple values. For instance,
+ * A MessageFormat object might produce the string "There are no files
+ * on the disk MyDisk on February 27, 1997." given the arguments 0,
+ * "MyDisk", and the date value of 2/27/97. See the ChoiceFormat
+ * and MessageFormat headers for further information.
+ *
+ * If formatting is unsuccessful, a failing UErrorCode is returned when
+ * the Format cannot format the type of object, otherwise if there is
+ * something illformed about the the Unicode replacement character
+ * 0xFFFD is returned.
+ *
+ * If there is no match when parsing, a parse failure UErrorCode is
+ * returned for methods which take no ParsePosition. For the method
+ * that takes a ParsePosition, the index parameter is left unchanged.
+ *
+ * User subclasses are not supported. While clients may write
+ * subclasses, such code will not necessarily work and will not be
+ * guaranteed to work stably from release to release.
+ */
+class U_I18N_API Format : public UObject {
+public:
+
+ /** Destructor
+ * @stable ICU 2.4
+ */
+ virtual ~Format();
+
+ /**
+ * Return true if the given Format objects are semantically equal.
+ * Objects of different subclasses are considered unequal.
+ * @param other the object to be compared with.
+ * @return Return true if the given Format objects are semantically equal.
+ * Objects of different subclasses are considered unequal.
+ * @stable ICU 2.0
+ */
+ virtual bool operator==(const Format& other) const = 0;
+
+ /**
+ * Return true if the given Format objects are not semantically
+ * equal.
+ * @param other the object to be compared with.
+ * @return Return true if the given Format objects are not semantically.
+ * @stable ICU 2.0
+ */
+ bool operator!=(const Format& other) const { return !operator==(other); }
+
+ /**
+ * Clone this object polymorphically. The caller is responsible
+ * for deleting the result when done.
+ * @return A copy of the object
+ * @stable ICU 2.0
+ */
+ virtual Format* clone() const = 0;
+
+ /**
+ * Formats an object to produce a string.
+ *
+ * @param obj The object to format.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param status Output parameter filled in with success or failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.0
+ */
+ UnicodeString& format(const Formattable& obj,
+ UnicodeString& appendTo,
+ UErrorCode& status) const;
+
+ /**
+ * Format an object to produce a string. This is a pure virtual method which
+ * subclasses must implement. This method allows polymorphic formatting
+ * of Formattable objects. If a subclass of Format receives a Formattable
+ * object type it doesn't handle (e.g., if a numeric Formattable is passed
+ * to a DateFormat object) then it returns a failing UErrorCode.
+ *
+ * @param obj The object to format.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 2.0
+ */
+ virtual UnicodeString& format(const Formattable& obj,
+ UnicodeString& appendTo,
+ FieldPosition& pos,
+ UErrorCode& status) const = 0;
+ /**
+ * Format an object to produce a string. Subclasses should override this
+ * method. This method allows polymorphic formatting of Formattable objects.
+ * If a subclass of Format receives a Formattable object type it doesn't
+ * handle (e.g., if a numeric Formattable is passed to a DateFormat object)
+ * then it returns a failing UErrorCode.
+ *
+ * @param obj The object to format.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @stable ICU 4.4
+ */
+ virtual UnicodeString& format(const Formattable& obj,
+ UnicodeString& appendTo,
+ FieldPositionIterator* posIter,
+ UErrorCode& status) const;
+
+ /**
+ * Parse a string to produce an object. This is a pure virtual
+ * method which subclasses must implement. This method allows
+ * polymorphic parsing of strings into Formattable objects.
+ *
+ * Before calling, set parse_pos.index to the offset you want to
+ * start parsing at in the source. After calling, parse_pos.index
+ * is the end of the text you parsed. If error occurs, index is
+ * unchanged.
+ *
+ * When parsing, leading whitespace is discarded (with successful
+ * parse), while trailing whitespace is left as is.
+ *
+ * Example:
+ *
+ * Parsing "_12_xy" (where _ represents a space) for a number,
+ * with index == 0 will result in the number 12, with
+ * parse_pos.index updated to 3 (just before the second space).
+ * Parsing a second time will result in a failing UErrorCode since
+ * "xy" is not a number, and leave index at 3.
+ *
+ * Subclasses will typically supply specific parse methods that
+ * return different types of values. Since methods can't overload
+ * on return types, these will typically be named "parse", while
+ * this polymorphic method will always be called parseObject. Any
+ * parse method that does not take a parse_pos should set status
+ * to an error value when no text in the required format is at the
+ * start position.
+ *
+ * @param source The string to be parsed into an object.
+ * @param result Formattable to be set to the parse result.
+ * If parse fails, return contents are undefined.
+ * @param parse_pos The position to start parsing at. Upon return
+ * this param is set to the position after the
+ * last character successfully parsed. If the
+ * source is not parsed successfully, this param
+ * will remain unchanged.
+ * @stable ICU 2.0
+ */
+ virtual void parseObject(const UnicodeString& source,
+ Formattable& result,
+ ParsePosition& parse_pos) const = 0;
+
+ /**
+ * Parses a string to produce an object. This is a convenience method
+ * which calls the pure virtual parseObject() method, and returns a
+ * failure UErrorCode if the ParsePosition indicates failure.
+ *
+ * @param source The string to be parsed into an object.
+ * @param result Formattable to be set to the parse result.
+ * If parse fails, return contents are undefined.
+ * @param status Output param to be filled with success/failure
+ * result code.
+ * @stable ICU 2.0
+ */
+ void parseObject(const UnicodeString& source,
+ Formattable& result,
+ UErrorCode& status) const;
+
+ /** Get the locale for this format object. You can choose between valid and actual locale.
+ * @param type type of the locale we're looking for (valid or actual)
+ * @param status error code for the operation
+ * @return the locale
+ * @stable ICU 2.8
+ */
+ Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
+
+#ifndef U_HIDE_INTERNAL_API
+ /** Get the locale for this format object. You can choose between valid and actual locale.
+ * @param type type of the locale we're looking for (valid or actual)
+ * @param status error code for the operation
+ * @return the locale
+ * @internal
+ */
+ const char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
+#endif /* U_HIDE_INTERNAL_API */
+
+ protected:
+ /** @stable ICU 2.8 */
+ void setLocaleIDs(const char* valid, const char* actual);
+
+protected:
+ /**
+ * Default constructor for subclass use only. Does nothing.
+ * @stable ICU 2.0
+ */
+ Format();
+
+ /**
+ * @stable ICU 2.0
+ */
+ Format(const Format&); // Does nothing; for subclasses only
+
+ /**
+ * @stable ICU 2.0
+ */
+ Format& operator=(const Format&); // Does nothing; for subclasses
+
+
+ /**
+ * Simple function for initializing a UParseError from a UnicodeString.
+ *
+ * @param pattern The pattern to copy into the parseError
+ * @param pos The position in pattern where the error occurred
+ * @param parseError The UParseError object to fill in
+ * @stable ICU 2.4
+ */
+ static void syntaxError(const UnicodeString& pattern,
+ int32_t pos,
+ UParseError& parseError);
+
+ private:
+ CharString* actualLocale = nullptr;
+ CharString* validLocale = nullptr;
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _FORMAT
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/formattednumber.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/formattednumber.h
new file mode 100644
index 0000000000..6b212d7c82
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/formattednumber.h
@@ -0,0 +1,215 @@
+// © 2022 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+#ifndef __FORMATTEDNUMBER_H__
+#define __FORMATTEDNUMBER_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/uobject.h"
+#include "unicode/formattedvalue.h"
+#include "unicode/measunit.h"
+#include "unicode/udisplayoptions.h"
+
+/**
+ * \file
+ * \brief C API: Formatted number result from various number formatting functions.
+ *
+ * See also {@link icu::FormattedValue} for additional things you can do with a FormattedNumber.
+ */
+
+U_NAMESPACE_BEGIN
+
+class FieldPositionIteratorHandler;
+class SimpleDateFormat;
+
+namespace number { // icu::number
+
+namespace impl {
+class DecimalQuantity;
+class UFormattedNumberData;
+struct UFormattedNumberImpl;
+} // icu::number::impl
+
+
+
+/**
+ * The result of a number formatting operation. This class allows the result to be exported in several data types,
+ * including a UnicodeString and a FieldPositionIterator.
+ *
+ * Instances of this class are immutable and thread-safe.
+ *
+ * @stable ICU 60
+ */
+class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
+ public:
+
+ /**
+ * Default constructor; makes an empty FormattedNumber.
+ * @stable ICU 64
+ */
+ FormattedNumber()
+ : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
+
+ /**
+ * Move constructor: Leaves the source FormattedNumber in an undefined state.
+ * @stable ICU 62
+ */
+ FormattedNumber(FormattedNumber&& src) noexcept;
+
+ /**
+ * Destruct an instance of FormattedNumber.
+ * @stable ICU 60
+ */
+ virtual ~FormattedNumber() override;
+
+ /** Copying not supported; use move constructor instead. */
+ FormattedNumber(const FormattedNumber&) = delete;
+
+ /** Copying not supported; use move assignment instead. */
+ FormattedNumber& operator=(const FormattedNumber&) = delete;
+
+ /**
+ * Move assignment: Leaves the source FormattedNumber in an undefined state.
+ * @stable ICU 62
+ */
+ FormattedNumber& operator=(FormattedNumber&& src) noexcept;
+
+ // Copybrief: this method is older than the parent method
+ /**
+ * @copybrief FormattedValue::toString()
+ *
+ * For more information, see FormattedValue::toString()
+ *
+ * @stable ICU 62
+ */
+ UnicodeString toString(UErrorCode& status) const override;
+
+ // Copydoc: this method is new in ICU 64
+ /** @copydoc FormattedValue::toTempString() */
+ UnicodeString toTempString(UErrorCode& status) const override;
+
+ // Copybrief: this method is older than the parent method
+ /**
+ * @copybrief FormattedValue::appendTo()
+ *
+ * For more information, see FormattedValue::appendTo()
+ *
+ * @stable ICU 62
+ */
+ Appendable &appendTo(Appendable& appendable, UErrorCode& status) const override;
+
+ // Copydoc: this method is new in ICU 64
+ /** @copydoc FormattedValue::nextPosition() */
+ UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const override;
+
+ /**
+ * Export the formatted number as a "numeric string" conforming to the
+ * syntax defined in the Decimal Arithmetic Specification, available at
+ * http://speleotrove.com/decimal
+ *
+ * This endpoint is useful for obtaining the exact number being printed
+ * after scaling and rounding have been applied by the number formatter.
+ *
+ * Example call site:
+ *
+ * auto decimalNumber = fn.toDecimalNumber
+ * Return true if this FieldPositionIterator is at the same position in an
+ * equal array of run values.
+ * @stable ICU 4.4
+ */
+ bool operator==(const FieldPositionIterator&) const;
+
+ /**
+ * Returns the complement of the result of operator==
+ * @param rhs The FieldPositionIterator to be compared for inequality
+ * @return the complement of the result of operator==
+ * @stable ICU 4.4
+ */
+ bool operator!=(const FieldPositionIterator& rhs) const { return !operator==(rhs); }
+
+ /**
+ * If the current position is valid, updates the FieldPosition values, advances the iterator,
+ * and returns true, otherwise returns false.
+ * @stable ICU 4.4
+ */
+ UBool next(FieldPosition& fp);
+
+private:
+ /**
+ * Sets the data used by the iterator, and resets the position.
+ * Returns U_ILLEGAL_ARGUMENT_ERROR in status if the data is not valid
+ * (length is not a multiple of 3, or start >= limit for any run).
+ */
+ void setData(UVector32 *adopt, UErrorCode& status);
+
+ friend class FieldPositionIteratorHandler;
+
+ UVector32 *data;
+ int32_t pos;
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // FPOSITER_H
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/gender.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/gender.h
new file mode 100644
index 0000000000..c81f7c88cc
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/gender.h
@@ -0,0 +1,122 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+*******************************************************************************
+* Copyright (C) 2008-2013, International Business Machines Corporation and
+* others. All Rights Reserved.
+*******************************************************************************
+*
+*
+* File GENDER.H
+*
+* Modification History:*
+* Date Name Description
+*
+********************************************************************************
+*/
+
+#ifndef _GENDER
+#define _GENDER
+
+/**
+ * \file
+ * \brief C++ API: GenderInfo computes the gender of a list.
+ */
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/locid.h"
+#include "unicode/ugender.h"
+#include "unicode/uobject.h"
+
+class GenderInfoTest;
+
+U_NAMESPACE_BEGIN
+
+/** \internal Forward Declaration */
+void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
+
+/**
+ * GenderInfo computes the gender of a list as a whole given the gender of
+ * each element.
+ * @stable ICU 50
+ */
+class U_I18N_API GenderInfo : public UObject {
+public:
+
+ /**
+ * Provides access to the predefined GenderInfo object for a given
+ * locale.
+ *
+ * @param locale The locale for which a
+ * The standard (Gregorian) calendar has 2 eras, BC and AD.
+ *
+ * This implementation handles a single discontinuity, which corresponds by default to
+ * the date the Gregorian calendar was originally instituted (October 15, 1582). Not all
+ * countries adopted the Gregorian calendar then, so this cutover date may be changed by
+ * the caller.
+ *
+ * Prior to the institution of the Gregorian Calendar, New Year's Day was March 25. To
+ * avoid confusion, this Calendar always uses January 1. A manual adjustment may be made
+ * if desired for dates that are prior to the Gregorian changeover and which fall
+ * between January 1 and March 24.
+ *
+ * Values calculated for the For example, January 1, 1998 was a Thursday. If
+ * Example for using GregorianCalendar:
+ * The GregorianCalendar implementation implements
+ * a calendar with the specified Julian/Gregorian cutover date.
+ * @internal
+ */
+ virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * The year in this calendar is counting from 1 backward if the era is 0.
+ * @return The year in era 0 of this calendar is counting backward from 1.
+ * @internal
+ */
+ virtual bool isEra0CountingBackward() const override { return true; }
+#endif // U_HIDE_INTERNAL_API
+
+ private:
+ /**
+ * Compute the julian day number of the given year.
+ * @param isGregorian if true, using Gregorian calendar, otherwise using Julian calendar
+ * @param year the given year.
+ * @param isLeap true if the year is a leap year.
+ * @return
+ */
+ static double computeJulianDayOfYear(UBool isGregorian, int32_t year,
+ UBool& isLeap);
+
+ /**
+ * Validates the values of the set time fields. True if they're all valid.
+ * @return True if the set time fields are all valid.
+ */
+ UBool validateFields() const;
+
+ /**
+ * Validates the value of the given time field. True if it's valid.
+ */
+ UBool boundsCheck(int32_t value, UCalendarDateFields field) const;
+
+ /**
+ * Return the pseudo-time-stamp for two fields, given their
+ * individual pseudo-time-stamps. If either of the fields
+ * is unset, then the aggregate is unset. Otherwise, the
+ * aggregate is the later of the two stamps.
+ * @param stamp_a One given field.
+ * @param stamp_b Another given field.
+ * @return the pseudo-time-stamp for two fields
+ */
+ int32_t aggregateStamp(int32_t stamp_a, int32_t stamp_b);
+
+ /**
+ * The point at which the Gregorian calendar rules are used, measured in
+ * milliseconds from the standard epoch. Default is October 15, 1582
+ * (Gregorian) 00:00:00 UTC, that is, October 4, 1582 (Julian) is followed
+ * by October 15, 1582 (Gregorian). This corresponds to Julian day number
+ * 2299161. This is measured from the standard epoch, not in Julian Days.
+ */
+ UDate fGregorianCutover;
+
+ /**
+ * Julian day number of the Gregorian cutover
+ */
+ int32_t fCutoverJulianDay;
+
+ /**
+ * Midnight, local time (using this Calendar's TimeZone) at or before the
+ * gregorianCutover. This is a pure date value with no time of day or
+ * timezone component.
+ */
+ UDate fNormalizedGregorianCutover;// = gregorianCutover;
+
+ /**
+ * The year of the gregorianCutover, with 0 representing
+ * 1 BC, -1 representing 2 BC, etc.
+ */
+ int32_t fGregorianCutoverYear;// = 1582;
+
+ /**
+ * Converts time as milliseconds to Julian date. The Julian date used here is not a
+ * true Julian date, since it is measured from midnight, not noon.
+ *
+ * @param millis The given milliseconds.
+ * @return The Julian date number.
+ */
+ static double millisToJulianDay(UDate millis);
+
+ /**
+ * Converts Julian date to time as milliseconds. The Julian date used here is not a
+ * true Julian date, since it is measured from midnight, not noon.
+ *
+ * @param julian The given Julian date number.
+ * @return Time as milliseconds.
+ */
+ static UDate julianDayToMillis(double julian);
+
+ /**
+ * Used by handleComputeJulianDay() and handleComputeMonthStart().
+ * Temporary field indicating whether the calendar is currently Gregorian as opposed to Julian.
+ */
+ UBool fIsGregorian;
+
+ /**
+ * Used by handleComputeJulianDay() and handleComputeMonthStart().
+ * Temporary field indicating that the sense of the gregorian cutover should be inverted
+ * to handle certain calculations on and around the cutover date.
+ */
+ UBool fInvertGregorian;
+
+
+ public: // internal implementation
+
+ DECLARE_OVERRIDE_SYSTEM_DEFAULT_CENTURY
+
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _GREGOCAL
+//eof
+
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/icudataver.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/icudataver.h
new file mode 100644
index 0000000000..f218ed8ebc
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/icudataver.h
@@ -0,0 +1,43 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+******************************************************************************
+*
+* Copyright (C) 2009-2013, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+******************************************************************************
+*/
+
+
+/**
+ * \file
+ * \brief C API: access to ICU Data Version number
+ */
+
+#ifndef __ICU_DATA_VER_H__
+#define __ICU_DATA_VER_H__
+
+#include "unicode/utypes.h"
+
+/**
+ * @stable ICU 49
+ */
+#define U_ICU_VERSION_BUNDLE "icuver"
+
+/**
+ * @stable ICU 49
+ */
+#define U_ICU_DATA_KEY "DataVersion"
+
+/**
+ * Retrieves the data version from icuver and stores it in dataVersionFillin.
+ *
+ * @param dataVersionFillin icuver data version information to be filled in if not-null
+ * @param status stores the error code from the calls to resource bundle
+ *
+ * @stable ICU 49
+ */
+U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status);
+
+#endif
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/icuplug.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/icuplug.h
new file mode 100644
index 0000000000..c787fcd426
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/icuplug.h
@@ -0,0 +1,391 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+******************************************************************************
+*
+* Copyright (C) 2009-2015, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+******************************************************************************
+*
+* FILE NAME : icuplug.h
+*
+* Date Name Description
+* 10/29/2009 sl New.
+******************************************************************************
+*/
+
+/**
+ * \file
+ * \brief C API: ICU Plugin API
+ *
+ * C API allowing run-time loadable modules that extend or modify ICU functionality. At ICU startup time, the environment variable "ICU_PLUGINS" will be
+ * queried for a directory name. If it is not set, the preprocessor symbol
+ * "DEFAULT_ICU_PLUGINS" will be checked for a default value. Within the above-named directory, the file "icuplugins##.txt" will be
+ * opened, if present, where ## is the major+minor number of the currently
+ * running ICU (such as, 44 for ICU 4.4, thus icuplugins44.txt) The configuration file has this format: An example configuration file is, in its entirety: Plugins are categorized as "high" or "low" level. Low level are those
+ * which must be run BEFORE high level plugins, and before any operations
+ * which cause ICU to be 'initialized'. If a plugin is low level but
+ * causes ICU to allocate memory or become initialized, that plugin is said
+ * to cause a 'level change'. At load time, ICU first queries all plugins to determine their level,
+ * then loads all 'low' plugins first, and then loads all 'high' plugins.
+ * Plugins are otherwise loaded in the order listed in the configuration file. The UPlugData* is an opaque pointer to the plugin-specific data, and is
+ * used in all other API calls. The API contract is: The following example shows how to create a LocaleBuilders can be reused; LocaleBuilder tracks errors in an internal UErrorCode. For all setters,
+ * except setLanguageTag and setLocale, LocaleBuilder will return immediately
+ * if the internal UErrorCode is in error state.
+ * To reset internal state and error code, call clear method.
+ * The setLanguageTag and setLocale method will first clear the internal
+ * UErrorCode, then track the error of the validation of the input parameter
+ * into the internal UErrorCode.
+ *
+ * @stable ICU 64
+ */
+class U_COMMON_API LocaleBuilder : public UObject {
+public:
+ /**
+ * Constructs an empty LocaleBuilder. The default value of all
+ * fields, extensions, and private use information is the
+ * empty string.
+ *
+ * @stable ICU 64
+ */
+ LocaleBuilder();
+
+ /**
+ * Destructor
+ * @stable ICU 64
+ */
+ virtual ~LocaleBuilder();
+
+ /**
+ * Resets the All fields of the locale must be well-formed.
+ * This method clears the internal UErrorCode.
+ *
+ * @param locale the locale
+ * @return This builder.
+ *
+ * @stable ICU 64
+ */
+ LocaleBuilder& setLocale(const Locale& locale);
+
+ /**
+ * Resets the LocaleBuilder to match the provided IETF BCP 47 language tag.
+ * Discards the existing state.
+ * The empty string causes the builder to be reset, like {@link #clear}.
+ * Legacy language tags (marked as “Type: grandfathered” in BCP 47)
+ * are converted to their canonical form before being processed.
+ * Otherwise, the This method clears the internal UErrorCode.
+ *
+ * @param tag the language tag, defined as IETF BCP 47 language tag.
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& setLanguageTag(StringPiece tag);
+
+ /**
+ * Sets the language. If The syntax of language value is defined as
+ * [unicode_language_subtag](http://www.unicode.org/reports/tr35/tr35.html#unicode_language_subtag).
+ *
+ * @param language the language
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& setLanguage(StringPiece language);
+
+ /**
+ * Sets the script. If The script value is a four-letter script code as
+ * [unicode_script_subtag](http://www.unicode.org/reports/tr35/tr35.html#unicode_script_subtag)
+ * defined by ISO 15924
+ *
+ * @param script the script
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& setScript(StringPiece script);
+
+ /**
+ * Sets the region. If region is the empty string, the region in this
+ * The region value is defined by
+ * [unicode_region_subtag](http://www.unicode.org/reports/tr35/tr35.html#unicode_region_subtag)
+ * as a two-letter ISO 3166 code or a three-digit UN M.49 area code.
+ *
+ * The region value in the Note: This method checks if Note: The key ('u') is used for the Unicode locale extension.
+ * Setting a value for this key replaces any existing Unicode locale key/type
+ * pairs with those defined in the extension.
+ *
+ * Note: The key ('x') is used for the private use code. To be
+ * well-formed, the value for this key needs only to have subtags of one to
+ * eight alphanumeric characters, not two to eight as in the general case.
+ *
+ * @param key the extension key
+ * @param value the extension value
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& setExtension(char key, StringPiece value);
+
+ /**
+ * Sets the Unicode locale keyword type for the given key. If the type
+ * StringPiece is constructed with a nullptr, the keyword is removed.
+ * If the type is the empty string, the keyword is set without type subtags.
+ * Otherwise, the key and type must be well-formed, or else the build()
+ * method will later report an U_ILLEGAL_ARGUMENT_ERROR.
+ *
+ * Keys and types are converted to lower case.
+ *
+ * Note:Setting the 'u' extension via {@link #setExtension}
+ * replaces all Unicode locale keywords with those defined in the
+ * extension.
+ *
+ * @param key the Unicode locale key
+ * @param type the Unicode locale type
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& setUnicodeLocaleKeyword(
+ StringPiece key, StringPiece type);
+
+ /**
+ * Adds a unicode locale attribute, if not already present, otherwise
+ * has no effect. The attribute must not be empty string and must be
+ * well-formed or U_ILLEGAL_ARGUMENT_ERROR will be set to status
+ * during the build() call.
+ *
+ * @param attribute the attribute
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& addUnicodeLocaleAttribute(StringPiece attribute);
+
+ /**
+ * Removes a unicode locale attribute, if present, otherwise has no
+ * effect. The attribute must not be empty string and must be well-formed
+ * or U_ILLEGAL_ARGUMENT_ERROR will be set to status during the build() call.
+ *
+ * Attribute comparison for removal is case-insensitive.
+ *
+ * @param attribute the attribute
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& removeUnicodeLocaleAttribute(StringPiece attribute);
+
+ /**
+ * Resets the builder to its initial, empty state.
+ * This method clears the internal UErrorCode.
+ *
+ * @return this builder
+ * @stable ICU 64
+ */
+ LocaleBuilder& clear();
+
+ /**
+ * Resets the extensions to their initial, empty state.
+ * Language, script, region and variant are unchanged.
+ *
+ * @return this builder
+ * @stable ICU 64
+ */
+ LocaleBuilder& clearExtensions();
+
+ /**
+ * Returns an instance of From each desired locale to the next,
+ * the distance to any supported locale is increased by an additional amount
+ * which is at least as large as most region mismatches.
+ * A later desired locale has to have a better match with some supported locale
+ * due to more than merely having the same region subtag.
+ *
+ * For example: Notes:
+ * For example, consider a web application with the UI in a given language,
+ * with a link to another, related web app.
+ * The link should include the UI language, and the target server may also use
+ * the client’s Accept-Language header data.
+ * The target server has its own list of supported languages.
+ * One may want to favor UI language consistency, that is,
+ * if there is a decent match for the original UI language, we want to use it,
+ * but not if it is merely a fallback.
+ *
+ * @see LocaleMatcher::Builder#setDirection(ULocMatchDirection)
+ * @stable ICU 67
+ */
+enum ULocMatchDirection {
+ /**
+ * Locale matching includes one-way matches such as Breton→French. (default)
+ *
+ * @stable ICU 67
+ */
+ ULOCMATCH_DIRECTION_WITH_ONE_WAY,
+ /**
+ * Locale matching limited to two-way matches including e.g. Danish↔Norwegian
+ * but ignoring one-way matches.
+ *
+ * @stable ICU 67
+ */
+ ULOCMATCH_DIRECTION_ONLY_TWO_WAY
+};
+#ifndef U_IN_DOXYGEN
+typedef enum ULocMatchDirection ULocMatchDirection;
+#endif
+
+struct UHashtable;
+
+U_NAMESPACE_BEGIN
+
+struct LSR;
+
+class LikelySubtags;
+class LocaleDistance;
+class LocaleLsrIterator;
+class UVector;
+
+/**
+ * Immutable class that picks the best match between a user's desired locales and
+ * an application's supported locales.
+ * Movable but not copyable.
+ *
+ * Example:
+ * A matcher takes into account when languages are close to one another,
+ * such as Danish and Norwegian,
+ * and when regional variants are close, like en-GB and en-AU as opposed to en-US.
+ *
+ * If there are multiple supported locales with the same (language, script, region)
+ * likely subtags, then the current implementation returns the first of those locales.
+ * It ignores variant subtags (except for pseudolocale variants) and extensions.
+ * This may change in future versions.
+ *
+ * For example, the current implementation does not distinguish between
+ * de, de-DE, de-Latn, de-1901, de-u-co-phonebk.
+ *
+ * If you prefer one equivalent locale over another, then provide only the preferred one,
+ * or place it earlier in the list of supported locales.
+ *
+ * Otherwise, the order of supported locales may have no effect on the best-match results.
+ * The current implementation compares each desired locale with supported locales
+ * in the following order:
+ * 1. Default locale, if supported;
+ * 2. CLDR "paradigm locales" like en-GB and es-419;
+ * 3. other supported locales.
+ * This may change in future versions.
+ *
+ * Often a product will just need one matcher instance, built with the languages
+ * that it supports. However, it may want multiple instances with different
+ * default languages based on additional information, such as the domain.
+ *
+ * This class is not intended for public subclassing.
+ *
+ * @stable ICU 65
+ */
+class U_COMMON_API LocaleMatcher : public UMemory {
+public:
+ /**
+ * Data for the best-matching pair of a desired and a supported locale.
+ * Movable but not copyable.
+ *
+ * @stable ICU 65
+ */
+ class U_COMMON_API Result : public UMemory {
+ public:
+ /**
+ * Move constructor; might modify the source.
+ * This object will have the same contents that the source object had.
+ *
+ * @param src Result to move contents from.
+ * @stable ICU 65
+ */
+ Result(Result &&src) noexcept;
+
+ /**
+ * Destructor.
+ *
+ * @stable ICU 65
+ */
+ ~Result();
+
+ /**
+ * Move assignment; might modify the source.
+ * This object will have the same contents that the source object had.
+ *
+ * @param src Result to move contents from.
+ * @stable ICU 65
+ */
+ Result &operator=(Result &&src) noexcept;
+
+ /**
+ * Returns the best-matching desired locale.
+ * nullptr if the list of desired locales is empty or if none matched well enough.
+ *
+ * @return the best-matching desired locale, or nullptr.
+ * @stable ICU 65
+ */
+ inline const Locale *getDesiredLocale() const { return desiredLocale; }
+
+ /**
+ * Returns the best-matching supported locale.
+ * If none matched well enough, this is the default locale.
+ * The default locale is nullptr if Builder::setNoDefaultLocale() was called,
+ * or if the list of supported locales is empty and no explicit default locale is set.
+ *
+ * @return the best-matching supported locale, or nullptr.
+ * @stable ICU 65
+ */
+ inline const Locale *getSupportedLocale() const { return supportedLocale; }
+
+ /**
+ * Returns the index of the best-matching desired locale in the input Iterable order.
+ * -1 if the list of desired locales is empty or if none matched well enough.
+ *
+ * @return the index of the best-matching desired locale, or -1.
+ * @stable ICU 65
+ */
+ inline int32_t getDesiredIndex() const { return desiredIndex; }
+
+ /**
+ * Returns the index of the best-matching supported locale in the
+ * constructor’s or builder’s input order (“set” Collection plus “added” locales).
+ * If the matcher was built from a locale list string, then the iteration order is that
+ * of a LocalePriorityList built from the same string.
+ * -1 if the list of supported locales is empty or if none matched well enough.
+ *
+ * @return the index of the best-matching supported locale, or -1.
+ * @stable ICU 65
+ */
+ inline int32_t getSupportedIndex() const { return supportedIndex; }
+
+ /**
+ * Takes the best-matching supported locale and adds relevant fields of the
+ * best-matching desired locale, such as the -t- and -u- extensions.
+ * May replace some fields of the supported locale.
+ * The result is the locale that should be used for date and number formatting, collation, etc.
+ * Returns the root locale if getSupportedLocale() returns nullptr.
+ *
+ * Example: desired=ar-SA-u-nu-latn, supported=ar-EG, resolved locale=ar-SA-u-nu-latn
+ *
+ * @return a locale combining the best-matching desired and supported locales.
+ * @stable ICU 65
+ */
+ Locale makeResolvedLocale(UErrorCode &errorCode) const;
+
+ private:
+ Result(const Locale *desired, const Locale *supported,
+ int32_t desIndex, int32_t suppIndex, UBool owned) :
+ desiredLocale(desired), supportedLocale(supported),
+ desiredIndex(desIndex), supportedIndex(suppIndex),
+ desiredIsOwned(owned) {}
+
+ Result(const Result &other) = delete;
+ Result &operator=(const Result &other) = delete;
+
+ const Locale *desiredLocale;
+ const Locale *supportedLocale;
+ int32_t desiredIndex;
+ int32_t supportedIndex;
+ UBool desiredIsOwned;
+
+ friend class LocaleMatcher;
+ };
+
+ /**
+ * LocaleMatcher builder.
+ * Movable but not copyable.
+ *
+ * @stable ICU 65
+ */
+ class U_COMMON_API Builder : public UMemory {
+ public:
+ /**
+ * Constructs a builder used in chaining parameters for building a LocaleMatcher.
+ *
+ * @return a new Builder object
+ * @stable ICU 65
+ */
+ Builder() {}
+
+ /**
+ * Move constructor; might modify the source.
+ * This builder will have the same contents that the source builder had.
+ *
+ * @param src Builder to move contents from.
+ * @stable ICU 65
+ */
+ Builder(Builder &&src) noexcept;
+
+ /**
+ * Destructor.
+ *
+ * @stable ICU 65
+ */
+ ~Builder();
+
+ /**
+ * Move assignment; might modify the source.
+ * This builder will have the same contents that the source builder had.
+ *
+ * @param src Builder to move contents from.
+ * @stable ICU 65
+ */
+ Builder &operator=(Builder &&src) noexcept;
+
+ /**
+ * Parses an Accept-Language string
+ * (RFC 2616 Section 14.4),
+ * such as "af, en, fr;q=0.9", and sets the supported locales accordingly.
+ * Allows whitespace in more places but does not allow "*".
+ * Clears any previously set/added supported locales first.
+ *
+ * @param locales the Accept-Language string of locales to set
+ * @return this Builder object
+ * @stable ICU 65
+ */
+ Builder &setSupportedLocalesFromListString(StringPiece locales);
+
+ /**
+ * Copies the supported locales, preserving iteration order.
+ * Clears any previously set/added supported locales first.
+ * Duplicates are allowed, and are not removed.
+ *
+ * @param locales the list of locale
+ * @return this Builder object
+ * @stable ICU 65
+ */
+ Builder &setSupportedLocales(Locale::Iterator &locales);
+
+ /**
+ * Copies the supported locales from the begin/end range, preserving iteration order.
+ * Clears any previously set/added supported locales first.
+ * Duplicates are allowed, and are not removed.
+ *
+ * Each of the iterator parameter values must be an
+ * input iterator whose value is convertible to const Locale &.
+ *
+ * @param begin Start of range.
+ * @param end Exclusive end of range.
+ * @return this Builder object
+ * @stable ICU 65
+ */
+ template This is mostly an implementation detail, and the precise values may change over time.
+ * The implementation may use either the maximized forms or the others ones, or both.
+ * The implementation may or may not rely on the forms to be consistent with each other.
+ *
+ * Callers should construct and use a matcher rather than match pairs of locales directly.
+ *
+ * @param desired Desired locale.
+ * @param supported Supported locale.
+ * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test,
+ * or else the function returns immediately. Check for U_FAILURE()
+ * on output or use with function chaining. (See User Guide for details.)
+ * @return value between 0 and 1, inclusive.
+ * @internal (has a known user)
+ */
+ double internalMatch(const Locale &desired, const Locale &supported, UErrorCode &errorCode) const;
+#endif // U_HIDE_INTERNAL_API
+
+private:
+ LocaleMatcher(const Builder &builder, UErrorCode &errorCode);
+ LocaleMatcher(const LocaleMatcher &other) = delete;
+ LocaleMatcher &operator=(const LocaleMatcher &other) = delete;
+
+ int32_t putIfAbsent(const LSR &lsr, int32_t i, int32_t suppLength, UErrorCode &errorCode);
+
+ std::optional
+ * You can create a
+ * The second argument to the constructors is a valid ISO Country
+ * Code. These codes are the upper-case two-letter codes
+ * as defined by ISO-3166.
+ * You can find a full list of these codes at a number of sites, such as:
+ *
+ * The third constructor requires a third argument--the Variant.
+ * The Variant codes are vendor and browser-specific.
+ * For example, use REVISED for a language's revised script orthography, and POSIX for POSIX.
+ * Where there are two variants, separate them with an underscore, and
+ * put the most important one first. For
+ * example, a Traditional Spanish collation might be referenced, with
+ * "ES", "ES", "Traditional_POSIX".
+ *
+ *
+ * Because a
+ * The
+ * Once you've created a
+ * ICU provides a number of classes that perform locale-sensitive
+ * operations. For example, the
+ * Each class that performs locale-sensitive operations allows you
+ * to get all the available objects of that type. You can sift
+ * through these objects by language, country, or variant,
+ * and use the display names to present a menu to the user.
+ * For example, you can create a menu of all the collation objects
+ * suitable for a given language. Such classes implement these
+ * three class methods:
+ * \htmlonly
+ * This implements the 'Language-Tag' production of BCP 47, and so
+ * supports legacy language tags (marked as “Type: grandfathered” in BCP 47)
+ * (regular and irregular) as well as private use language tags.
+ *
+ * Private use tags are represented as 'x-whatever',
+ * and legacy tags are converted to their canonical replacements where they exist.
+ *
+ * Note that a few legacy tags have no modern replacement;
+ * these will be converted using the fallback described in
+ * the first paragraph, so some information might be lost.
+ *
+ * @param tag the input BCP47 language tag.
+ * @param status error information if creating the Locale failed.
+ * @return the Locale for the specified BCP47 language tag.
+ * @stable ICU 63
+ */
+ static Locale U_EXPORT2 forLanguageTag(StringPiece tag, UErrorCode& status);
+
+ /**
+ * Returns a well-formed language tag for this Locale.
+ *
+ * Note: Any locale fields which do not satisfy the BCP47 syntax
+ * requirement will be silently omitted from the result.
+ *
+ * If this function fails, partial output may have been written to the sink.
+ *
+ * @param sink the output sink receiving the BCP47 language
+ * tag for this Locale.
+ * @param status error information if creating the language tag failed.
+ * @stable ICU 63
+ */
+ void toLanguageTag(ByteSink& sink, UErrorCode& status) const;
+
+ /**
+ * Returns a well-formed language tag for this Locale.
+ *
+ * Note: Any locale fields which do not satisfy the BCP47 syntax
+ * requirement will be silently omitted from the result.
+ *
+ * @param status error information if creating the language tag failed.
+ * @return the BCP47 language tag for this Locale.
+ * @stable ICU 63
+ */
+ template IMPORTANT: New users are strongly encouraged to see if
+ * numberformatter.h fits their use case. Although not deprecated, this header
+ * is provided for backwards compatibility only, and has much more limited
+ * capabilities.
+ *
+ * @see Format
+ * @author Alan Liu
+ * @stable ICU 3.0
+ */
+class U_I18N_API MeasureFormat : public Format {
+ public:
+ using Format::parseObject;
+ using Format::format;
+
+ /**
+ * Constructor.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * {@link icu::number::NumberFormatter} instead of NumberFormat.
+ * @stable ICU 53
+ */
+ MeasureFormat(
+ const Locale &locale, UMeasureFormatWidth width, UErrorCode &status);
+
+ /**
+ * Constructor.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * {@link icu::number::NumberFormatter} instead of NumberFormat.
+ * @stable ICU 53
+ */
+ MeasureFormat(
+ const Locale &locale,
+ UMeasureFormatWidth width,
+ NumberFormat *nfToAdopt,
+ UErrorCode &status);
+
+ /**
+ * Copy constructor.
+ * @stable ICU 3.0
+ */
+ MeasureFormat(const MeasureFormat &other);
+
+ /**
+ * Assignment operator.
+ * @stable ICU 3.0
+ */
+ MeasureFormat &operator=(const MeasureFormat &rhs);
+
+ /**
+ * Destructor.
+ * @stable ICU 3.0
+ */
+ virtual ~MeasureFormat();
+
+ /**
+ * Return true if given Format objects are semantically equal.
+ * @stable ICU 53
+ */
+ virtual bool operator==(const Format &other) const override;
+
+ /**
+ * Clones this object polymorphically.
+ * @stable ICU 53
+ */
+ virtual MeasureFormat *clone() const override;
+
+ /**
+ * Formats object to produce a string.
+ * @stable ICU 53
+ */
+ virtual UnicodeString &format(
+ const Formattable &obj,
+ UnicodeString &appendTo,
+ FieldPosition &pos,
+ UErrorCode &status) const override;
+
+#ifndef U_FORCE_HIDE_DRAFT_API
+ /**
+ * Parse a string to produce an object. This implementation sets
+ * status to U_UNSUPPORTED_ERROR.
+ *
+ * @draft ICU 53
+ */
+ virtual void parseObject(
+ const UnicodeString &source,
+ Formattable &reslt,
+ ParsePosition &pos) const override;
+#endif // U_FORCE_HIDE_DRAFT_API
+
+ /**
+ * Formats measure objects to produce a string. An example of such a
+ * formatted string is 3 meters, 3.5 centimeters. Measure objects appear
+ * in the formatted string in the same order they appear in the "measures"
+ * array. The NumberFormat of this object is used only to format the amount
+ * of the very last measure. The other amounts are formatted with zero
+ * decimal places while rounding toward zero.
+ * @param measures array of measure objects.
+ * @param measureCount the number of measure objects.
+ * @param appendTo formatted string appended here.
+ * @param pos the field position.
+ * @param status the error.
+ * @return appendTo reference
+ *
+ * @stable ICU 53
+ */
+ UnicodeString &formatMeasures(
+ const Measure *measures,
+ int32_t measureCount,
+ UnicodeString &appendTo,
+ FieldPosition &pos,
+ UErrorCode &status) const;
+
+ /**
+ * Formats a single measure per unit. An example of such a
+ * formatted string is 3.5 meters per second.
+ * @param measure The measure object. In above example, 3.5 meters.
+ * @param perUnit The per unit. In above example, it is
+ * `*%MeasureUnit::createSecond(status)`.
+ * @param appendTo formatted string appended here.
+ * @param pos the field position.
+ * @param status the error.
+ * @return appendTo reference
+ *
+ * @stable ICU 55
+ */
+ UnicodeString &formatMeasurePerUnit(
+ const Measure &measure,
+ const MeasureUnit &perUnit,
+ UnicodeString &appendTo,
+ FieldPosition &pos,
+ UErrorCode &status) const;
+
+ /**
+ * Gets the display name of the specified {@link MeasureUnit} corresponding to the current
+ * locale and format width.
+ * @param unit The unit for which to get a display name.
+ * @param status the error.
+ * @return The display name in the locale and width specified in
+ * the MeasureFormat constructor, or null if there is no display name available
+ * for the specified unit.
+ *
+ * @stable ICU 58
+ */
+ UnicodeString getUnitDisplayName(const MeasureUnit& unit, UErrorCode &status) const;
+
+
+ /**
+ * Return a formatter for CurrencyAmount objects in the given
+ * locale.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * {@link icu::number::NumberFormatter} instead of NumberFormat.
+ * @param locale desired locale
+ * @param ec input-output error code
+ * @return a formatter object, or nullptr upon error
+ * @stable ICU 3.0
+ */
+ static MeasureFormat* U_EXPORT2 createCurrencyFormat(const Locale& locale,
+ UErrorCode& ec);
+
+ /**
+ * Return a formatter for CurrencyAmount objects in the default
+ * locale.
+ *
+ * NOTE: New users are strongly encouraged to use
+ * {@link icu::number::NumberFormatter} instead of NumberFormat.
+ * @param ec input-output error code
+ * @return a formatter object, or nullptr upon error
+ * @stable ICU 3.0
+ */
+ static MeasureFormat* U_EXPORT2 createCurrencyFormat(UErrorCode& ec);
+
+ /**
+ * Return the class ID for this class. This is useful only for comparing to
+ * a return value from getDynamicClassID(). For example:
+ * Measure objects are formatted by MeasureFormat.
+ *
+ * Measure objects are immutable.
+ *
+ * @author Alan Liu
+ * @stable ICU 3.0
+ */
+class U_I18N_API Measure: public UObject {
+ public:
+ /**
+ * Construct an object with the given numeric amount and the given
+ * unit. After this call, the caller must not delete the given
+ * unit object.
+ * @param number a numeric object; amount.isNumeric() must be true
+ * @param adoptedUnit the unit object, which must not be nullptr
+ * @param ec input-output error code. If the amount or the unit
+ * is invalid, then this will be set to a failing value.
+ * @stable ICU 3.0
+ */
+ Measure(const Formattable& number, MeasureUnit* adoptedUnit,
+ UErrorCode& ec);
+
+ /**
+ * Copy constructor
+ * @stable ICU 3.0
+ */
+ Measure(const Measure& other);
+
+ /**
+ * Assignment operator
+ * @stable ICU 3.0
+ */
+ Measure& operator=(const Measure& other);
+
+ /**
+ * Return a polymorphic clone of this object. The result will
+ * have the same class as returned by getDynamicClassID().
+ * @stable ICU 3.0
+ */
+ virtual Measure* clone() const;
+
+ /**
+ * Destructor
+ * @stable ICU 3.0
+ */
+ virtual ~Measure();
+
+ /**
+ * Equality operator. Return true if this object is equal
+ * to the given object.
+ * @stable ICU 3.0
+ */
+ bool operator==(const UObject& other) const;
+
+ /**
+ * Inequality operator. Returns true if this object is not equal to the other object.
+ * @param other the object to compare with
+ * @return true if the objects are not equal
+ * @stable ICU 74
+ */
+ inline bool operator!=(const UObject& other) const { return !operator==(other); }
+
+ /**
+ * Return a reference to the numeric value of this object. The
+ * numeric value may be of any numeric type supported by
+ * Formattable.
+ * @stable ICU 3.0
+ */
+ inline const Formattable& getNumber() const;
+
+ /**
+ * Return a reference to the unit of this object.
+ * @stable ICU 3.0
+ */
+ inline const MeasureUnit& getUnit() const;
+
+ /**
+ * Return the class ID for this class. This is useful only for comparing to
+ * a return value from getDynamicClassID(). For example:
+ * MessageFormatter is a Technical Preview API implementing MessageFormat 2.0.
+ *
+ * See the
+ * description of the syntax with examples and use cases and the corresponding
+ * ABNF grammar.std::equal_to
but uses the collator instead of operator==
.
+ * @draft ICU 76
+ */
+ inline auto equal_to() const { return Predicatestd::greater
but uses the collator instead of operator>
.
+ * @draft ICU 76
+ */
+ inline auto greater() const { return Predicatestd::less
but uses the collator instead of operator<
.
+ * @draft ICU 76
+ */
+ inline auto less() const { return Predicatestd::not_equal_to
but uses the collator instead of operator!=
.
+ * @draft ICU 76
+ */
+ inline auto not_equal_to() const { return Predicatestd::greater_equal
but uses the collator instead of operator>=
.
+ * @draft ICU 76
+ */
+ inline auto greater_equal() const { return Predicatestd::less_equal
but uses the collator instead of operator<=
.
+ * @draft ICU 76
+ */
+ inline auto less_equal() const { return Predicate
+ * \code
+ * UErrorCode status = U_ZERO_ERROR;
+ * Collator*myCollation = Collator::createInstance(Locale::getUS(), status);
+ * if (U_FAILURE(status)) return;
+ * myCollation->setStrength(Collator::PRIMARY);
+ * // result will be "abc" == "ABC"
+ * // tertiary differences will be ignored
+ * Collator::ComparisonResult result = myCollation->compare("abc", "ABC");
+ * \endcode
+ *
+ * @see Collator#getStrength
+ * @param newStrength the new comparison level.
+ * @deprecated ICU 2.6 Use setAttribute(UCOL_STRENGTH...) instead
+ */
+ virtual void setStrength(ECollationStrength newStrength);
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Retrieves the reordering codes for this collator.
+ * @param dest The array to fill with the script ordering.
+ * @param destCapacity The length of dest. If it is 0, then dest may be nullptr and the function
+ * will only return the length of the result without writing any codes (pre-flighting).
+ * @param status A reference to an error code value, which must not indicate
+ * a failure before the function call.
+ * @return The length of the script ordering array.
+ * @see ucol_setReorderCodes
+ * @see Collator#getEquivalentReorderCodes
+ * @see Collator#setReorderCodes
+ * @see UScriptCode
+ * @see UColReorderCode
+ * @stable ICU 4.8
+ */
+ virtual int32_t getReorderCodes(int32_t *dest,
+ int32_t destCapacity,
+ UErrorCode& status) const;
+
+ /**
+ * Sets the ordering of scripts for this collator.
+ *
+ *
+ * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
+ * U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
+ * the last reordering group supported by setMaxVariable()
+ * @return variable top primary weight
+ * @deprecated ICU 53 Call setMaxVariable() instead.
+ */
+ virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status) = 0;
+
+ /**
+ * Sets the variable top to the primary weight of the specified string.
+ *
+ * Beginning with ICU 53, the variable top is pinned to
+ * the top of one of the supported reordering groups,
+ * and it must not be beyond the last of those groups.
+ * See setMaxVariable().
+ * @param varTop a UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set
+ * @param status error code. If error code is set, the return value is undefined. Errors set by this function are:
+ * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
+ * U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
+ * the last reordering group supported by setMaxVariable()
+ * @return variable top primary weight
+ * @deprecated ICU 53 Call setMaxVariable() instead.
+ */
+ virtual uint32_t setVariableTop(const UnicodeString &varTop, UErrorCode &status) = 0;
+
+ /**
+ * Sets the variable top to the specified primary weight.
+ *
+ * Beginning with ICU 53, the variable top is pinned to
+ * the top of one of the supported reordering groups,
+ * and it must not be beyond the last of those groups.
+ * See setMaxVariable().
+ * @param varTop primary weight, as returned by setVariableTop or ucol_getVariableTop
+ * @param status error code
+ * @deprecated ICU 53 Call setMaxVariable() instead.
+ */
+ virtual void setVariableTop(uint32_t varTop, UErrorCode &status) = 0;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Gets the variable top value of a Collator.
+ * @param status error code (not changed by function). If error code is set, the return value is undefined.
+ * @return the variable top primary weight
+ * @see getMaxVariable
+ * @stable ICU 2.0
+ */
+ virtual uint32_t getVariableTop(UErrorCode &status) const = 0;
+
+ /**
+ * Get a UnicodeSet that contains all the characters and sequences
+ * tailored in this collator.
+ * @param status error code of the operation
+ * @return a pointer to a UnicodeSet object containing all the
+ * code points and sequences that may sort differently than
+ * in the root collator. The object must be disposed of by using delete
+ * @stable ICU 2.4
+ */
+ virtual UnicodeSet *getTailoredSet(UErrorCode &status) const;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Same as clone().
+ * The base class implementation simply calls clone().
+ * @return a copy of this object, owned by the caller
+ * @see clone()
+ * @deprecated ICU 50 no need to have two methods for cloning
+ */
+ virtual Collator* safeClone() const;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Get the sort key as an array of bytes from a UnicodeString.
+ * Sort key byte arrays are zero-terminated and can be compared using
+ * strcmp().
+ *
+ * Note that sort keys are often less efficient than simply doing comparison.
+ * For more details, see the ICU User Guide.
+ *
+ * @param source string to be processed.
+ * @param result buffer to store result in. If nullptr, number of bytes needed
+ * will be returned.
+ * @param resultLength length of the result buffer. If if not enough the
+ * buffer will be filled to capacity.
+ * @return Number of bytes needed for storing the sort key
+ * @stable ICU 2.2
+ */
+ virtual int32_t getSortKey(const UnicodeString& source,
+ uint8_t* result,
+ int32_t resultLength) const = 0;
+
+ /**
+ * Get the sort key as an array of bytes from a char16_t buffer.
+ * Sort key byte arrays are zero-terminated and can be compared using
+ * strcmp().
+ *
+ * Note that sort keys are often less efficient than simply doing comparison.
+ * For more details, see the ICU User Guide.
+ *
+ * @param source string to be processed.
+ * @param sourceLength length of string to be processed.
+ * If -1, the string is 0 terminated and length will be decided by the
+ * function.
+ * @param result buffer to store result in. If nullptr, number of bytes needed
+ * will be returned.
+ * @param resultLength length of the result buffer. If if not enough the
+ * buffer will be filled to capacity.
+ * @return Number of bytes needed for storing the sort key
+ * @stable ICU 2.2
+ */
+ virtual int32_t getSortKey(const char16_t*source, int32_t sourceLength,
+ uint8_t*result, int32_t resultLength) const = 0;
+
+ /**
+ * Produce a bound for a given sortkey and a number of levels.
+ * Return value is always the number of bytes needed, regardless of
+ * whether the result buffer was big enough or even valid.
+ * Resulting bounds can be used to produce a range of strings that are
+ * between upper and lower bounds. For example, if bounds are produced
+ * for a sortkey of string "smith", strings between upper and lower
+ * bounds with one level would include "Smith", "SMITH", "sMiTh".
+ * There are two upper bounds that can be produced. If UCOL_BOUND_UPPER
+ * is produced, strings matched would be as above. However, if bound
+ * produced using UCOL_BOUND_UPPER_LONG is used, the above example will
+ * also match "Smithsonian" and similar.
+ * For more on usage, see example in cintltst/capitst.c in procedure
+ * TestBounds.
+ * Sort keys may be compared using strcmp.
+ * @param source The source sortkey.
+ * @param sourceLength The length of source, or -1 if null-terminated.
+ * (If an unmodified sortkey is passed, it is always null
+ * terminated).
+ * @param boundType Type of bound required. It can be UCOL_BOUND_LOWER, which
+ * produces a lower inclusive bound, UCOL_BOUND_UPPER, that
+ * produces upper bound that matches strings of the same length
+ * or UCOL_BOUND_UPPER_LONG that matches strings that have the
+ * same starting substring as the source string.
+ * @param noOfLevels Number of levels required in the resulting bound (for most
+ * uses, the recommended value is 1). See users guide for
+ * explanation on number of levels a sortkey can have.
+ * @param result A pointer to a buffer to receive the resulting sortkey.
+ * @param resultLength The maximum size of result.
+ * @param status Used for returning error code if something went wrong. If the
+ * number of levels requested is higher than the number of levels
+ * in the source key, a warning (U_SORT_KEY_TOO_SHORT_WARNING) is
+ * issued.
+ * @return The size needed to fully store the bound.
+ * @see ucol_keyHashCode
+ * @stable ICU 2.1
+ */
+ static int32_t U_EXPORT2 getBound(const uint8_t *source,
+ int32_t sourceLength,
+ UColBoundMode boundType,
+ uint32_t noOfLevels,
+ uint8_t *result,
+ int32_t resultLength,
+ UErrorCode &status);
+
+
+protected:
+
+ // Collator protected constructors -------------------------------------
+
+ /**
+ * Default constructor.
+ * Constructor is different from the old default Collator constructor.
+ * The task for determining the default collation strength and normalization
+ * mode is left to the child class.
+ * @stable ICU 2.0
+ */
+ Collator();
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Constructor.
+ * Empty constructor, does not handle the arguments.
+ * This constructor is done for backward compatibility with 1.7 and 1.8.
+ * The task for handling the argument collation strength and normalization
+ * mode is left to the child class.
+ * @param collationStrength collation strength
+ * @param decompositionMode
+ * @deprecated ICU 2.4. Subclasses should use the default constructor
+ * instead and handle the strength and normalization mode themselves.
+ */
+ Collator(UCollationStrength collationStrength,
+ UNormalizationMode decompositionMode);
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Copy constructor.
+ * @param other Collator object to be copied from
+ * @stable ICU 2.0
+ */
+ Collator(const Collator& other);
+
+public:
+ /**
+ * Used internally by registration to define the requested and valid locales.
+ * @param requestedLocale the requested locale
+ * @param validLocale the valid locale
+ * @param actualLocale the actual locale
+ * @internal
+ */
+ virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale);
+
+ /** Get the short definition string for a collator. This internal API harvests the collator's
+ * locale and the attribute set and produces a string that can be used for opening
+ * a collator with the same attributes using the ucol_openFromShortString API.
+ * This string will be normalized.
+ * The structure and the syntax of the string is defined in the "Naming collators"
+ * section of the users guide:
+ * https://unicode-org.github.io/icu/userguide/collation/concepts#collator-naming-scheme
+ * This function supports preflighting.
+ *
+ * This is internal, and intended to be used with delegate converters.
+ *
+ * @param locale a locale that will appear as a collators locale in the resulting
+ * short string definition. If nullptr, the locale will be harvested
+ * from the collator.
+ * @param buffer space to hold the resulting string
+ * @param capacity capacity of the buffer
+ * @param status for returning errors. All the preflighting errors are featured
+ * @return length of the resulting string
+ * @see ucol_openFromShortString
+ * @see ucol_normalizeShortDefinitionString
+ * @see ucol_getShortDefinitionString
+ * @internal
+ */
+ virtual int32_t internalGetShortDefinitionString(const char *locale,
+ char *buffer,
+ int32_t capacity,
+ UErrorCode &status) const;
+
+ /**
+ * Implements ucol_strcollUTF8().
+ * @internal
+ */
+ virtual UCollationResult internalCompareUTF8(
+ const char *left, int32_t leftLength,
+ const char *right, int32_t rightLength,
+ UErrorCode &errorCode) const;
+
+ /**
+ * Implements ucol_nextSortKeyPart().
+ * @internal
+ */
+ virtual int32_t
+ internalNextSortKeyPart(
+ UCharIterator *iter, uint32_t state[2],
+ uint8_t *dest, int32_t count, UErrorCode &errorCode) const;
+
+#ifndef U_HIDE_INTERNAL_API
+ /** @internal */
+ static inline Collator *fromUCollator(UCollator *uc) {
+ return reinterpret_cast
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . Derived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 51
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override.
+ * This method is to implement a simple version of RTTI, since not all
+ * C++ compilers support genuine RTTI. Polymorphic operator==() and
+ * clone() methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 51
+ */
+ UClassID getDynamicClassID() const override;
+
+ private:
+ CompactDecimalFormat(const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __COMPACT_DECIMAL_FORMAT_H__
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/curramt.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/curramt.h
new file mode 100644
index 0000000000..e0f6aa13dd
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/curramt.h
@@ -0,0 +1,133 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+**********************************************************************
+* Copyright (c) 2004-2006, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+* Author: Alan Liu
+* Created: April 26, 2004
+* Since: ICU 3.0
+**********************************************************************
+*/
+#ifndef __CURRENCYAMOUNT_H__
+#define __CURRENCYAMOUNT_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/measure.h"
+#include "unicode/currunit.h"
+
+/**
+ * \file
+ * \brief C++ API: Currency Amount Object.
+ */
+
+U_NAMESPACE_BEGIN
+
+/**
+ *
+ * A currency together with a numeric amount, such as 200 USD.
+ *
+ * @author Alan Liu
+ * @stable ICU 3.0
+ */
+class U_I18N_API CurrencyAmount: public Measure {
+ public:
+ /**
+ * Construct an object with the given numeric amount and the given
+ * ISO currency code.
+ * @param amount a numeric object; amount.isNumeric() must be true
+ * @param isoCode the 3-letter ISO 4217 currency code; must not be
+ * nullptr and must have length 3
+ * @param ec input-output error code. If the amount or the isoCode
+ * is invalid, then this will be set to a failing value.
+ * @stable ICU 3.0
+ */
+ CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode,
+ UErrorCode &ec);
+
+ /**
+ * Construct an object with the given numeric amount and the given
+ * ISO currency code.
+ * @param amount the amount of the given currency
+ * @param isoCode the 3-letter ISO 4217 currency code; must not be
+ * nullptr and must have length 3
+ * @param ec input-output error code. If the isoCode is invalid,
+ * then this will be set to a failing value.
+ * @stable ICU 3.0
+ */
+ CurrencyAmount(double amount, ConstChar16Ptr isoCode,
+ UErrorCode &ec);
+
+ /**
+ * Copy constructor
+ * @stable ICU 3.0
+ */
+ CurrencyAmount(const CurrencyAmount& other);
+
+ /**
+ * Assignment operator
+ * @stable ICU 3.0
+ */
+ CurrencyAmount& operator=(const CurrencyAmount& other);
+
+ /**
+ * Return a polymorphic clone of this object. The result will
+ * have the same class as returned by getDynamicClassID().
+ * @stable ICU 3.0
+ */
+ virtual CurrencyAmount* clone() const override;
+
+ /**
+ * Destructor
+ * @stable ICU 3.0
+ */
+ virtual ~CurrencyAmount();
+
+ /**
+ * Returns a unique class ID for this object POLYMORPHICALLY.
+ * This method implements a simple form of RTTI used by ICU.
+ * @return The class ID for this object. All objects of a given
+ * class have the same class ID. Objects of other classes have
+ * different class IDs.
+ * @stable ICU 3.0
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * Returns the class ID for this class. This is used to compare to
+ * the return value of getDynamicClassID().
+ * @return The class ID for all objects of this class.
+ * @stable ICU 3.0
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Return the currency unit object of this object.
+ * @stable ICU 3.0
+ */
+ const CurrencyUnit& getCurrency() const;
+
+ /**
+ * Return the ISO currency code of this object.
+ * @stable ICU 3.0
+ */
+ inline const char16_t* getISOCurrency() const;
+};
+
+inline const char16_t* CurrencyAmount::getISOCurrency() const {
+ return getCurrency().getISOCurrency();
+}
+
+U_NAMESPACE_END
+
+#endif // !UCONFIG_NO_FORMATTING
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __CURRENCYAMOUNT_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/currpinf.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/currpinf.h
new file mode 100644
index 0000000000..e3ca34b26f
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/currpinf.h
@@ -0,0 +1,274 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+ *******************************************************************************
+ * Copyright (C) 2009-2015, International Business Machines Corporation and *
+ * others. All Rights Reserved. *
+ *******************************************************************************
+ */
+#ifndef CURRPINF_H
+#define CURRPINF_H
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+/**
+ * \file
+ * \brief C++ API: Currency Plural Information used by Decimal Format
+ */
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/unistr.h"
+
+U_NAMESPACE_BEGIN
+
+class Locale;
+class PluralRules;
+class Hashtable;
+
+/**
+ * This class represents the information needed by
+ * DecimalFormat to format currency plural,
+ * such as "3.00 US dollars" or "1.00 US dollar".
+ * DecimalFormat creates for itself an instance of
+ * CurrencyPluralInfo from its locale data.
+ * If you need to change any of these symbols, you can get the
+ * CurrencyPluralInfo object from your
+ * DecimalFormat and modify it.
+ *
+ * Following are the information needed for currency plural format and parse:
+ * locale information,
+ * plural rule of the locale,
+ * currency plural pattern of the locale.
+ *
+ * @stable ICU 4.2
+ */
+class U_I18N_API CurrencyPluralInfo : public UObject {
+public:
+
+ /**
+ * Create a CurrencyPluralInfo object for the default locale.
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.2
+ */
+ CurrencyPluralInfo(UErrorCode& status);
+
+ /**
+ * Create a CurrencyPluralInfo object for the given locale.
+ * @param locale the locale
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.2
+ */
+ CurrencyPluralInfo(const Locale& locale, UErrorCode& status);
+
+ /**
+ * Copy constructor
+ *
+ * @stable ICU 4.2
+ */
+ CurrencyPluralInfo(const CurrencyPluralInfo& info);
+
+
+ /**
+ * Assignment operator
+ *
+ * @stable ICU 4.2
+ */
+ CurrencyPluralInfo& operator=(const CurrencyPluralInfo& info);
+
+
+ /**
+ * Destructor
+ *
+ * @stable ICU 4.2
+ */
+ virtual ~CurrencyPluralInfo();
+
+
+ /**
+ * Equal operator.
+ *
+ * @stable ICU 4.2
+ */
+ bool operator==(const CurrencyPluralInfo& info) const;
+
+
+ /**
+ * Not equal operator
+ *
+ * @stable ICU 4.2
+ */
+ bool operator!=(const CurrencyPluralInfo& info) const;
+
+
+ /**
+ * Clone
+ *
+ * @stable ICU 4.2
+ */
+ CurrencyPluralInfo* clone() const;
+
+
+ /**
+ * Gets plural rules of this locale, used for currency plural format
+ *
+ * @return plural rule
+ * @stable ICU 4.2
+ */
+ const PluralRules* getPluralRules() const;
+
+ /**
+ * Given a plural count, gets currency plural pattern of this locale,
+ * used for currency plural format
+ *
+ * @param pluralCount currency plural count
+ * @param result output param to receive the pattern
+ * @return a currency plural pattern based on plural count
+ * @stable ICU 4.2
+ */
+ UnicodeString& getCurrencyPluralPattern(const UnicodeString& pluralCount,
+ UnicodeString& result) const;
+
+ /**
+ * Get locale
+ *
+ * @return locale
+ * @stable ICU 4.2
+ */
+ const Locale& getLocale() const;
+
+ /**
+ * Set plural rules.
+ * The plural rule is set when CurrencyPluralInfo
+ * instance is created.
+ * You can call this method to reset plural rules only if you want
+ * to modify the default plural rule of the locale.
+ *
+ * @param ruleDescription new plural rule description
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.2
+ */
+ void setPluralRules(const UnicodeString& ruleDescription,
+ UErrorCode& status);
+
+ /**
+ * Set currency plural pattern.
+ * The currency plural pattern is set when CurrencyPluralInfo
+ * instance is created.
+ * You can call this method to reset currency plural pattern only if
+ * you want to modify the default currency plural pattern of the locale.
+ *
+ * @param pluralCount the plural count for which the currency pattern will
+ * be overridden.
+ * @param pattern the new currency plural pattern
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.2
+ */
+ void setCurrencyPluralPattern(const UnicodeString& pluralCount,
+ const UnicodeString& pattern,
+ UErrorCode& status);
+
+ /**
+ * Set locale
+ *
+ * @param loc the new locale to set
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.2
+ */
+ void setLocale(const Locale& loc, UErrorCode& status);
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for the actual class.
+ *
+ * @stable ICU 4.2
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for this class.
+ *
+ * @stable ICU 4.2
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+private:
+ friend class DecimalFormat;
+ friend class DecimalFormatImpl;
+
+ void initialize(const Locale& loc, UErrorCode& status);
+
+ void setupCurrencyPluralPattern(const Locale& loc, UErrorCode& status);
+
+ /*
+ * delete hash table
+ *
+ * @param hTable hash table to be deleted
+ */
+ void deleteHash(Hashtable* hTable);
+
+
+ /*
+ * initialize hash table
+ *
+ * @param status output param set to success/failure code on exit
+ * @return hash table initialized
+ */
+ Hashtable* initHash(UErrorCode& status);
+
+
+
+ /**
+ * copy hash table
+ *
+ * @param source the source to copy from
+ * @param target the target to copy to
+ * @param status error code
+ */
+ void copyHash(const Hashtable* source, Hashtable* target, UErrorCode& status);
+
+ //-------------------- private data member ---------------------
+ // map from plural count to currency plural pattern, for example
+ // a plural pattern defined in "CurrencyUnitPatterns" is
+ // "one{{0} {1}}", in which "one" is a plural count
+ // and "{0} {1}" is a currency plural pattern".
+ // The currency plural pattern saved in this mapping is the pattern
+ // defined in "CurrencyUnitPattern" by replacing
+ // {0} with the number format pattern,
+ // and {1} with 3 currency sign.
+ Hashtable* fPluralCountToCurrencyUnitPattern;
+
+ /*
+ * The plural rule is used to format currency plural name,
+ * for example: "3.00 US Dollars".
+ * If there are 3 currency signs in the currency pattern,
+ * the 3 currency signs will be replaced by currency plural name.
+ */
+ PluralRules* fPluralRules;
+
+ // locale
+ Locale* fLocale;
+
+private:
+ /**
+ * An internal status variable used to indicate that the object is in an 'invalid' state.
+ * Used by copy constructor, the assignment operator and the clone method.
+ */
+ UErrorCode fInternalStatus;
+};
+
+
+inline bool
+CurrencyPluralInfo::operator!=(const CurrencyPluralInfo& info) const {
+ return !operator==(info);
+}
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _CURRPINFO
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/currunit.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/currunit.h
new file mode 100644
index 0000000000..3b367b052b
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/currunit.h
@@ -0,0 +1,146 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+**********************************************************************
+* Copyright (c) 2004-2014, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+* Author: Alan Liu
+* Created: April 26, 2004
+* Since: ICU 3.0
+**********************************************************************
+*/
+#ifndef __CURRENCYUNIT_H__
+#define __CURRENCYUNIT_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/measunit.h"
+
+/**
+ * \file
+ * \brief C++ API: Currency Unit Information.
+ */
+
+U_NAMESPACE_BEGIN
+
+/**
+ * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
+ * yen). This class is a thin wrapper over a char16_t string that
+ * subclasses MeasureUnit, for use with Measure and MeasureFormat.
+ *
+ * @author Alan Liu
+ * @stable ICU 3.0
+ */
+class U_I18N_API CurrencyUnit: public MeasureUnit {
+ public:
+ /**
+ * Default constructor. Initializes currency code to "XXX" (no currency).
+ * @stable ICU 60
+ */
+ CurrencyUnit();
+
+ /**
+ * Construct an object with the given ISO currency code.
+ *
+ * @param isoCode the 3-letter ISO 4217 currency code; must have
+ * length 3 and need not be NUL-terminated. If nullptr, the currency
+ * is initialized to the unknown currency XXX.
+ * @param ec input-output error code. If the isoCode is invalid,
+ * then this will be set to a failing value.
+ * @stable ICU 3.0
+ */
+ CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec);
+
+ /**
+ * Construct an object with the given ISO currency code.
+ *
+ * @param isoCode the 3-letter ISO 4217 currency code; must have
+ * length 3. If invalid, the currency is initialized to XXX.
+ * @param ec input-output error code. If the isoCode is invalid,
+ * then this will be set to a failing value.
+ * @stable ICU 64
+ */
+ CurrencyUnit(StringPiece isoCode, UErrorCode &ec);
+
+ /**
+ * Copy constructor
+ * @stable ICU 3.0
+ */
+ CurrencyUnit(const CurrencyUnit& other);
+
+ /**
+ * Copy constructor from MeasureUnit. This constructor allows you to
+ * restore a CurrencyUnit that was sliced to MeasureUnit.
+ *
+ * @param measureUnit The MeasureUnit to copy from.
+ * @param ec Set to a failing value if the MeasureUnit is not a currency.
+ * @stable ICU 60
+ */
+ CurrencyUnit(const MeasureUnit& measureUnit, UErrorCode &ec);
+
+ /**
+ * Assignment operator
+ * @stable ICU 3.0
+ */
+ CurrencyUnit& operator=(const CurrencyUnit& other);
+
+ /**
+ * Return a polymorphic clone of this object. The result will
+ * have the same class as returned by getDynamicClassID().
+ * @stable ICU 3.0
+ */
+ virtual CurrencyUnit* clone() const override;
+
+ /**
+ * Destructor
+ * @stable ICU 3.0
+ */
+ virtual ~CurrencyUnit();
+
+ /**
+ * Returns a unique class ID for this object POLYMORPHICALLY.
+ * This method implements a simple form of RTTI used by ICU.
+ * @return The class ID for this object. All objects of a given
+ * class have the same class ID. Objects of other classes have
+ * different class IDs.
+ * @stable ICU 3.0
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * Returns the class ID for this class. This is used to compare to
+ * the return value of getDynamicClassID().
+ * @return The class ID for all objects of this class.
+ * @stable ICU 3.0
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Return the ISO currency code of this object.
+ * @stable ICU 3.0
+ */
+ inline const char16_t* getISOCurrency() const;
+
+ private:
+ /**
+ * The ISO 4217 code of this object.
+ */
+ char16_t isoCode[4];
+};
+
+inline const char16_t* CurrencyUnit::getISOCurrency() const {
+ return isoCode;
+}
+
+U_NAMESPACE_END
+
+#endif // !UCONFIG_NO_FORMATTING
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __CURRENCYUNIT_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/datefmt.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/datefmt.h
new file mode 100644
index 0000000000..9b05ea457c
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/datefmt.h
@@ -0,0 +1,968 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+ ********************************************************************************
+ * Copyright (C) 1997-2016, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ ********************************************************************************
+ *
+ * File DATEFMT.H
+ *
+ * Modification History:
+ *
+ * Date Name Description
+ * 02/19/97 aliu Converted from java.
+ * 04/01/97 aliu Added support for centuries.
+ * 07/23/98 stephen JDK 1.2 sync
+ * 11/15/99 weiv Added support for week of year/day of week formatting
+ ********************************************************************************
+ */
+
+#ifndef DATEFMT_H
+#define DATEFMT_H
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/udat.h"
+#include "unicode/calendar.h"
+#include "unicode/numfmt.h"
+#include "unicode/format.h"
+#include "unicode/locid.h"
+#include "unicode/enumset.h"
+#include "unicode/udisplaycontext.h"
+
+/**
+ * \file
+ * \brief C++ API: Abstract class for converting dates.
+ */
+
+U_NAMESPACE_BEGIN
+
+class TimeZone;
+class DateTimePatternGenerator;
+
+/**
+ * \cond
+ * Export an explicit template instantiation. (See digitlst.h, datefmt.h, and others.)
+ * (When building DLLs for Windows this is required.)
+ */
+#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN && !defined(U_IN_DOXYGEN)
+template class U_I18N_API EnumSet
+ * \code
+ * DateFormat* dfmt = DateFormat::createDateInstance();
+ * UDate myDate = Calendar::getNow();
+ * UnicodeString myString;
+ * myString = dfmt->format( myDate, myString );
+ * \endcode
+ *
+ * If you are formatting multiple numbers, it is more efficient to get the
+ * format and use it multiple times so that the system doesn't have to fetch the
+ * information about the local language and country conventions multiple times.
+ *
+ * \code
+ * DateFormat* df = DateFormat::createDateInstance();
+ * UnicodeString myString;
+ * UDate myDateArr[] = { 0.0, 100000000.0, 2000000000.0 }; // test values
+ * for (int32_t i = 0; i < 3; ++i) {
+ * myString.remove();
+ * cout << df->format( myDateArr[i], myString ) << endl;
+ * }
+ * \endcode
+ *
+ * To get specific fields of a date, you can use UFieldPosition to
+ * get specific fields.
+ *
+ * \code
+ * DateFormat* dfmt = DateFormat::createDateInstance();
+ * FieldPosition pos(DateFormat::YEAR_FIELD);
+ * UnicodeString myString;
+ * myString = dfmt->format( myDate, myString );
+ * cout << myString << endl;
+ * cout << pos.getBeginIndex() << "," << pos. getEndIndex() << endl;
+ * \endcode
+ *
+ * To format a date for a different Locale, specify it in the call to
+ * createDateInstance().
+ *
+ * \code
+ * DateFormat* df =
+ * DateFormat::createDateInstance( DateFormat::SHORT, Locale::getFrance());
+ * \endcode
+ *
+ * You can use a DateFormat to parse also.
+ *
+ * \code
+ * UErrorCode status = U_ZERO_ERROR;
+ * UDate myDate = df->parse(myString, status);
+ * \endcode
+ *
+ * Use createDateInstance() to produce the normal date format for that country.
+ * There are other static factory methods available. Use createTimeInstance()
+ * to produce the normal time format for that country. Use createDateTimeInstance()
+ * to produce a DateFormat that formats both date and time. You can pass in
+ * different options to these factory methods to control the length of the
+ * result; from SHORT to MEDIUM to LONG to FULL. The exact result depends on the
+ * locale, but generally:
+ *
+ *
+ * You can also set the time zone on the format if you wish. If you want even
+ * more control over the format or parsing, (or want to give your users more
+ * control), you can try casting the DateFormat you get from the factory methods
+ * to a SimpleDateFormat. This will work for the majority of countries; just
+ * remember to check getDynamicClassID() before carrying out the cast.
+ *
+ *
+ *
+ *
+ * \code
+ * Symbol Meaning
+ * 0 a digit
+ * # a digit, zero shows as absent
+ * . placeholder for decimal separator
+ * , placeholder for grouping separator.
+ * ; separates formats.
+ * - default negative prefix.
+ * % divide by 100 and show as percentage
+ * X any other characters can be used in the prefix or suffix
+ * ' used to quote special characters in a prefix or suffix.
+ * \endcode
+ *
+ * [Notes]
+ *
+ *
+ *
+ *
+ * Symbol
+ * Location
+ * Localized?
+ * Meaning
+ *
+ * 0
+ * Number
+ * Yes
+ * Digit
+ *
+ * 1-9
+ * Number
+ * Yes
+ * '1' through '9' indicate rounding.
+ *
+ * \htmlonly@\endhtmlonly
+ * Number
+ * No
+ * Significant digit
+ *
+ * #
+ * Number
+ * Yes
+ * Digit, zero shows as absent
+ *
+ * .
+ * Number
+ * Yes
+ * Decimal separator or monetary decimal separator
+ *
+ * -
+ * Number
+ * Yes
+ * Minus sign
+ *
+ * ,
+ * Number
+ * Yes
+ * Grouping separator
+ *
+ * E
+ * Number
+ * Yes
+ * Separates mantissa and exponent in scientific notation.
+ * Need not be quoted in prefix or suffix.
+ *
+ * +
+ * Exponent
+ * Yes
+ * Prefix positive exponents with localized plus sign.
+ * Need not be quoted in prefix or suffix.
+ *
+ * ;
+ * Subpattern boundary
+ * Yes
+ * Separates positive and negative subpatterns
+ *
+ * \%
+ * Prefix or suffix
+ * Yes
+ * Multiply by 100 and show as percentage
+ *
+ * \\u2030
+ * Prefix or suffix
+ * Yes
+ * Multiply by 1000 and show as per mille
+ *
+ * \htmlonly¤\endhtmlonly
(\\u00A4
)
+ * Prefix or suffix
+ * No
+ * Currency sign, replaced by currency symbol. If
+ * doubled, replaced by international currency symbol.
+ * If tripled, replaced by currency plural names, for example,
+ * "US dollar" or "US dollars" for America.
+ * If present in a pattern, the monetary decimal separator
+ * is used instead of the decimal separator.
+ *
+ * '
+ * Prefix or suffix
+ * No
+ * Used to quote special characters in a prefix or suffix,
+ * for example, "'#'#"
formats 123 to
+ * "#123"
. To create a single quote
+ * itself, use two in a row: "# o''clock"
.
+ *
+ * *
+ * Prefix or suffix boundary
+ * Yes
+ * Pad escape, precedes pad character
+ *
+ * pattern := subpattern (';' subpattern)?
+ * subpattern := prefix? number exponent? suffix?
+ * number := (integer ('.' fraction)?) | sigDigits
+ * prefix := '\\u0000'..'\\uFFFD' - specialCharacters
+ * suffix := '\\u0000'..'\\uFFFD' - specialCharacters
+ * integer := '#'* '0'* '0'
+ * fraction := '0'* '#'*
+ * sigDigits := '#'* '@' '@'* '#'*
+ * exponent := 'E' '+'? '0'* '0'
+ * padSpec := '*' padChar
+ * padChar := '\\u0000'..'\\uFFFD' - quote
+ *
+ * Notation:
+ * X* 0 or more instances of X
+ * X? 0 or 1 instances of X
+ * X|Y either X or Y
+ * C..D any character from C up to D, inclusive
+ * S-T characters in S, except those in T
+ *
+ * The first subpattern is for positive numbers. The second (optional)
+ * subpattern is for negative numbers.
+ *
+ *
+ *
+ * padSpec
may appear before the prefix,
+ * after the prefix, before the suffix, after the suffix, or not at all.
+ *
+ *
+ *
+ * NaN
is represented as a single character, typically
+ * \\uFFFD
. This character is determined by the
+ * DecimalFormatSymbols object. This is the only value for which
+ * the prefixes and suffixes are not used.
+ *
+ * \\u221E
, with the positive or negative prefixes and suffixes
+ * applied. The infinity character is determined by the
+ * DecimalFormatSymbols object.
+ *
+ * Scientific Notation
+ *
+ *
+ *
+ *
+ * Significant Digits
+ *
+ * DecimalFormat
has two ways of controlling how many
+ * digits are shows: (a) significant digits counts, or (b) integer and
+ * fraction digit counts. Integer and fraction digit counts are
+ * described above. When a formatter is using significant digits
+ * counts, the number of integer and fraction digits is not specified
+ * directly, and the formatter settings for these counts are ignored.
+ * Instead, the formatter uses however many integer and fraction
+ * digits are required to display the specified number of significant
+ * digits. Examples:
+ *
+ *
+ *
+ *
+ *
+ * Pattern
+ * Minimum significant digits
+ * Maximum significant digits
+ * Number
+ * Output of format()
+ *
+ * \@\@\@
+ * 3
+ * 3
+ * 12345
+ * 12300
+ *
+ * \@\@\@
+ * 3
+ * 3
+ * 0.12345
+ * 0.123
+ *
+ * \@\@##
+ * 2
+ * 4
+ * 3.14159
+ * 3.142
+ *
+ * \@\@##
+ * 2
+ * 4
+ * 1.23004
+ * 1.23
+ *
+ *
+ *
+ * '@'
and '#'
+ * characters. The minimum number of significant digits is the number
+ * of '@'
characters. The maximum number of significant
+ * digits is the number of '@'
characters plus the number
+ * of '#'
characters following on the right. For
+ * example, the pattern "@@@"
indicates exactly 3
+ * significant digits. The pattern "@##"
indicates from
+ * 1 to 3 significant digits. Trailing zero digits to the right of
+ * the decimal separator are suppressed after the minimum number of
+ * significant digits have been shown. For example, the pattern
+ * "@##"
formats the number 0.1203 as
+ * "0.12"
.
+ *
+ * '0'
pattern character.
+ * Patterns such as "@00"
or "@.###"
are
+ * disallowed.
+ *
+ * '#'
characters may be prepended to
+ * the left of the leftmost '@'
character. These have no
+ * effect on the minimum and maximum significant digits counts, but
+ * may be used to position grouping separators. For example,
+ * "#,#@#"
indicates a minimum of one significant digits,
+ * a maximum of two significant digits, and a grouping size of three.
+ *
+ * '@'
pattern character. Alternatively,
+ * call setSignificantDigitsUsed(true).
+ *
+ * '@'
pattern
+ * character. Alternatively, call setSignificantDigitsUsed(false).
+ *
+ * getMinimumSignificantDigits() - 1
, and a maximum fraction digit
+ * count of getMaximumSignificantDigits() - 1
. For example, the
+ * pattern "@@###E0"
is equivalent to "0.0###E0"
.
+ *
+ * "$*x#,##0.00"
formats 123 to
+ * "$xx123.00"
, and 1234 to "$1,234.00"
.
+ *
+ *
+ *
+ *
+ * "* #0 o''clock"
, the format width is 10.
+ *
+ *
+ *
+ *
+ *
+ * df.setMultiplier(5);
+ * df.setMultiplierScale(-1);
+ *
+ *
+ * This method is analogous to UNUM_SCALE in setAttribute.
+ *
+ * @param newValue the new value of the power-of-ten multiplier.
+ * @stable ICU 62
+ */
+ void setMultiplierScale(int32_t newValue);
+
+ /**
+ * Get the rounding increment.
+ * @return A positive rounding increment, or 0.0 if a custom rounding
+ * increment is not in effect.
+ * @see #setRoundingIncrement
+ * @see #getRoundingMode
+ * @see #setRoundingMode
+ * @stable ICU 2.0
+ */
+ virtual double getRoundingIncrement() const;
+
+ /**
+ * Set the rounding increment. In the absence of a rounding increment,
+ * numbers will be rounded to the number of digits displayed.
+ * @param newValue A positive rounding increment, or 0.0 to
+ * use the default rounding increment.
+ * Negative increments are equivalent to 0.0.
+ * @see #getRoundingIncrement
+ * @see #getRoundingMode
+ * @see #setRoundingMode
+ * @stable ICU 2.0
+ */
+ virtual void setRoundingIncrement(double newValue);
+
+ /**
+ * Get the rounding mode.
+ * @return A rounding mode
+ * @see #setRoundingIncrement
+ * @see #getRoundingIncrement
+ * @see #setRoundingMode
+ * @stable ICU 2.0
+ */
+ virtual ERoundingMode getRoundingMode() const override;
+
+ /**
+ * Set the rounding mode.
+ * @param roundingMode A rounding mode
+ * @see #setRoundingIncrement
+ * @see #getRoundingIncrement
+ * @see #getRoundingMode
+ * @stable ICU 2.0
+ */
+ virtual void setRoundingMode(ERoundingMode roundingMode) override;
+
+ /**
+ * Get the width to which the output of format() is padded.
+ * The width is counted in 16-bit code units.
+ * @return the format width, or zero if no padding is in effect
+ * @see #setFormatWidth
+ * @see #getPadCharacterString
+ * @see #setPadCharacter
+ * @see #getPadPosition
+ * @see #setPadPosition
+ * @stable ICU 2.0
+ */
+ virtual int32_t getFormatWidth() const;
+
+ /**
+ * Set the width to which the output of format() is padded.
+ * The width is counted in 16-bit code units.
+ * This method also controls whether padding is enabled.
+ * @param width the width to which to pad the result of
+ * format(), or zero to disable padding. A negative
+ * width is equivalent to 0.
+ * @see #getFormatWidth
+ * @see #getPadCharacterString
+ * @see #setPadCharacter
+ * @see #getPadPosition
+ * @see #setPadPosition
+ * @stable ICU 2.0
+ */
+ virtual void setFormatWidth(int32_t width);
+
+ /**
+ * Get the pad character used to pad to the format width. The
+ * default is ' '.
+ * @return a string containing the pad character. This will always
+ * have a length of one 32-bit code point.
+ * @see #setFormatWidth
+ * @see #getFormatWidth
+ * @see #setPadCharacter
+ * @see #getPadPosition
+ * @see #setPadPosition
+ * @stable ICU 2.0
+ */
+ virtual UnicodeString getPadCharacterString() const;
+
+ /**
+ * Set the character used to pad to the format width. If padding
+ * is not enabled, then this will take effect if padding is later
+ * enabled.
+ * @param padChar a string containing the pad character. If the string
+ * has length 0, then the pad character is set to ' '. Otherwise
+ * padChar.char32At(0) will be used as the pad character.
+ * @see #setFormatWidth
+ * @see #getFormatWidth
+ * @see #getPadCharacterString
+ * @see #getPadPosition
+ * @see #setPadPosition
+ * @stable ICU 2.0
+ */
+ virtual void setPadCharacter(const UnicodeString& padChar);
+
+ /**
+ * Get the position at which padding will take place. This is the location
+ * at which padding will be inserted if the result of format()
+ * is shorter than the format width.
+ * @return the pad position, one of kPadBeforePrefix,
+ * kPadAfterPrefix, kPadBeforeSuffix, or
+ * kPadAfterSuffix.
+ * @see #setFormatWidth
+ * @see #getFormatWidth
+ * @see #setPadCharacter
+ * @see #getPadCharacterString
+ * @see #setPadPosition
+ * @see #EPadPosition
+ * @stable ICU 2.0
+ */
+ virtual EPadPosition getPadPosition() const;
+
+ /**
+ * Set the position at which padding will take place. This is the location
+ * at which padding will be inserted if the result of format()
+ * is shorter than the format width. This has no effect unless padding is
+ * enabled.
+ * @param padPos the pad position, one of kPadBeforePrefix,
+ * kPadAfterPrefix, kPadBeforeSuffix, or
+ * kPadAfterSuffix.
+ * @see #setFormatWidth
+ * @see #getFormatWidth
+ * @see #setPadCharacter
+ * @see #getPadCharacterString
+ * @see #getPadPosition
+ * @see #EPadPosition
+ * @stable ICU 2.0
+ */
+ virtual void setPadPosition(EPadPosition padPos);
+
+ /**
+ * Return whether or not scientific notation is used.
+ * @return true if this object formats and parses scientific notation
+ * @see #setScientificNotation
+ * @see #getMinimumExponentDigits
+ * @see #setMinimumExponentDigits
+ * @see #isExponentSignAlwaysShown
+ * @see #setExponentSignAlwaysShown
+ * @stable ICU 2.0
+ */
+ virtual UBool isScientificNotation() const;
+
+ /**
+ * Set whether or not scientific notation is used. When scientific notation
+ * is used, the effective maximum number of integer digits is <= 8. If the
+ * maximum number of integer digits is set to more than 8, the effective
+ * maximum will be 1. This allows this call to generate a 'default' scientific
+ * number format without additional changes.
+ * @param useScientific true if this object formats and parses scientific
+ * notation
+ * @see #isScientificNotation
+ * @see #getMinimumExponentDigits
+ * @see #setMinimumExponentDigits
+ * @see #isExponentSignAlwaysShown
+ * @see #setExponentSignAlwaysShown
+ * @stable ICU 2.0
+ */
+ virtual void setScientificNotation(UBool useScientific);
+
+ /**
+ * Return the minimum exponent digits that will be shown.
+ * @return the minimum exponent digits that will be shown
+ * @see #setScientificNotation
+ * @see #isScientificNotation
+ * @see #setMinimumExponentDigits
+ * @see #isExponentSignAlwaysShown
+ * @see #setExponentSignAlwaysShown
+ * @stable ICU 2.0
+ */
+ virtual int8_t getMinimumExponentDigits() const;
+
+ /**
+ * Set the minimum exponent digits that will be shown. This has no
+ * effect unless scientific notation is in use.
+ * @param minExpDig a value >= 1 indicating the fewest exponent digits
+ * that will be shown. Values less than 1 will be treated as 1.
+ * @see #setScientificNotation
+ * @see #isScientificNotation
+ * @see #getMinimumExponentDigits
+ * @see #isExponentSignAlwaysShown
+ * @see #setExponentSignAlwaysShown
+ * @stable ICU 2.0
+ */
+ virtual void setMinimumExponentDigits(int8_t minExpDig);
+
+ /**
+ * Return whether the exponent sign is always shown.
+ * @return true if the exponent is always prefixed with either the
+ * localized minus sign or the localized plus sign, false if only negative
+ * exponents are prefixed with the localized minus sign.
+ * @see #setScientificNotation
+ * @see #isScientificNotation
+ * @see #setMinimumExponentDigits
+ * @see #getMinimumExponentDigits
+ * @see #setExponentSignAlwaysShown
+ * @stable ICU 2.0
+ */
+ virtual UBool isExponentSignAlwaysShown() const;
+
+ /**
+ * Set whether the exponent sign is always shown. This has no effect
+ * unless scientific notation is in use.
+ * @param expSignAlways true if the exponent is always prefixed with either
+ * the localized minus sign or the localized plus sign, false if only
+ * negative exponents are prefixed with the localized minus sign.
+ * @see #setScientificNotation
+ * @see #isScientificNotation
+ * @see #setMinimumExponentDigits
+ * @see #getMinimumExponentDigits
+ * @see #isExponentSignAlwaysShown
+ * @stable ICU 2.0
+ */
+ virtual void setExponentSignAlwaysShown(UBool expSignAlways);
+
+ /**
+ * Return the grouping size. Grouping size is the number of digits between
+ * grouping separators in the integer portion of a number. For example,
+ * in the number "123,456.78", the grouping size is 3.
+ *
+ * @return the grouping size.
+ * @see setGroupingSize
+ * @see NumberFormat::isGroupingUsed
+ * @see DecimalFormatSymbols::getGroupingSeparator
+ * @stable ICU 2.0
+ */
+ int32_t getGroupingSize() const;
+
+ /**
+ * Set the grouping size. Grouping size is the number of digits between
+ * grouping separators in the integer portion of a number. For example,
+ * in the number "123,456.78", the grouping size is 3.
+ *
+ * @param newValue the new value of the grouping size.
+ * @see getGroupingSize
+ * @see NumberFormat::setGroupingUsed
+ * @see DecimalFormatSymbols::setGroupingSeparator
+ * @stable ICU 2.0
+ */
+ virtual void setGroupingSize(int32_t newValue);
+
+ /**
+ * Return the secondary grouping size. In some locales one
+ * grouping interval is used for the least significant integer
+ * digits (the primary grouping size), and another is used for all
+ * others (the secondary grouping size). A formatter supporting a
+ * secondary grouping size will return a positive integer unequal
+ * to the primary grouping size returned by
+ * getGroupingSize(). For example, if the primary
+ * grouping size is 4, and the secondary grouping size is 2, then
+ * the number 123456789 formats as "1,23,45,6789", and the pattern
+ * appears as "#,##,###0".
+ * @return the secondary grouping size, or a value less than
+ * one if there is none
+ * @see setSecondaryGroupingSize
+ * @see NumberFormat::isGroupingUsed
+ * @see DecimalFormatSymbols::getGroupingSeparator
+ * @stable ICU 2.4
+ */
+ int32_t getSecondaryGroupingSize() const;
+
+ /**
+ * Set the secondary grouping size. If set to a value less than 1,
+ * then secondary grouping is turned off, and the primary grouping
+ * size is used for all intervals, not just the least significant.
+ *
+ * @param newValue the new value of the secondary grouping size.
+ * @see getSecondaryGroupingSize
+ * @see NumberFormat#setGroupingUsed
+ * @see DecimalFormatSymbols::setGroupingSeparator
+ * @stable ICU 2.4
+ */
+ virtual void setSecondaryGroupingSize(int32_t newValue);
+
+ /**
+ * Returns the minimum number of grouping digits.
+ * Grouping separators are output if there are at least this many
+ * digits to the left of the first (rightmost) grouping separator,
+ * that is, there are at least (minimum grouping + grouping size) integer digits.
+ * (Subject to isGroupingUsed().)
+ *
+ * For example, if this value is 2, and the grouping size is 3, then
+ * 9999 -> "9999" and 10000 -> "10,000"
+ *
+ * The default value for this attribute is 0.
+ * A value of 1, 0, or lower, means that the use of grouping separators
+ * only depends on the grouping size (and on isGroupingUsed()).
+ *
+ * NOTE: The CLDR data is used in NumberFormatter but not in DecimalFormat.
+ * This is for backwards compatibility reasons.
+ *
+ * For more control over grouping strategies, use NumberFormatter.
+ *
+ * @see setMinimumGroupingDigits
+ * @see getGroupingSize
+ * @stable ICU 64
+ */
+ int32_t getMinimumGroupingDigits() const;
+
+ /**
+ * Sets the minimum grouping digits. Setting the value to
+ * - 1: Turns off minimum grouping digits.
+ * - 0 or -1: The behavior is undefined.
+ * - UNUM_MINIMUM_GROUPING_DIGITS_AUTO: Display grouping using the default
+ * strategy for all locales.
+ * - UNUM_MINIMUM_GROUPING_DIGITS_MIN2: Display grouping using locale
+ * defaults, except do not show grouping on values smaller than 10000
+ * (such that there is a minimum of two digits before the first
+ * separator).
+ *
+ * For more control over grouping strategies, use NumberFormatter.
+ *
+ * @param newValue the new value of minimum grouping digits.
+ * @see getMinimumGroupingDigits
+ * @stable ICU 64
+ */
+ void setMinimumGroupingDigits(int32_t newValue);
+
+ /**
+ * Allows you to get the behavior of the decimal separator with integers.
+ * (The decimal separator will always appear with decimals.)
+ *
+ * @return true if the decimal separator always appear with decimals.
+ * Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
+ * @stable ICU 2.0
+ */
+ UBool isDecimalSeparatorAlwaysShown() const;
+
+ /**
+ * Allows you to set the behavior of the decimal separator with integers.
+ * (The decimal separator will always appear with decimals.)
+ *
+ * @param newValue set true if the decimal separator will always appear with decimals.
+ * Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345
+ * @stable ICU 2.0
+ */
+ virtual void setDecimalSeparatorAlwaysShown(UBool newValue);
+
+ /**
+ * Allows you to get the parse behavior of the pattern decimal mark.
+ *
+ * @return true if input must contain a match to decimal mark in pattern
+ * @stable ICU 54
+ */
+ UBool isDecimalPatternMatchRequired() const;
+
+ /**
+ * Allows you to set the parse behavior of the pattern decimal mark.
+ *
+ * if true, the input must have a decimal mark if one was specified in the pattern. When
+ * false the decimal mark may be omitted from the input.
+ *
+ * @param newValue set true if input must contain a match to decimal mark in pattern
+ * @stable ICU 54
+ */
+ virtual void setDecimalPatternMatchRequired(UBool newValue);
+
+ /**
+ * Returns whether to ignore exponents when parsing.
+ *
+ * @return Whether to ignore exponents when parsing.
+ * @see #setParseNoExponent
+ * @stable ICU 64
+ */
+ UBool isParseNoExponent() const;
+
+ /**
+ * Specifies whether to stop parsing when an exponent separator is encountered. For
+ * example, parses "123E4" to 123 (with parse position 3) instead of 1230000 (with parse position
+ * 5).
+ *
+ * @param value true to prevent exponents from being parsed; false to allow them to be parsed.
+ * @stable ICU 64
+ */
+ void setParseNoExponent(UBool value);
+
+ /**
+ * Returns whether parsing is sensitive to case (lowercase/uppercase).
+ *
+ * @return Whether parsing is case-sensitive.
+ * @see #setParseCaseSensitive
+ * @stable ICU 64
+ */
+ UBool isParseCaseSensitive() const;
+
+ /**
+ * Whether to pay attention to case when parsing; default is to ignore case (perform
+ * case-folding). For example, "A" == "a" in case-insensitive but not case-sensitive mode.
+ *
+ * Currency symbols are never case-folded. For example, "us$1.00" will not parse in case-insensitive
+ * mode, even though "US$1.00" parses.
+ *
+ * @param value true to enable case-sensitive parsing (the default); false to force
+ * case-sensitive parsing behavior.
+ * @stable ICU 64
+ */
+ void setParseCaseSensitive(UBool value);
+
+ /**
+ * Returns whether truncation of high-order integer digits should result in an error.
+ * By default, setMaximumIntegerDigits truncates high-order digits silently.
+ *
+ * @return Whether an error code is set if high-order digits are truncated.
+ * @see setFormatFailIfMoreThanMaxDigits
+ * @stable ICU 64
+ */
+ UBool isFormatFailIfMoreThanMaxDigits() const;
+
+ /**
+ * Sets whether truncation of high-order integer digits should result in an error.
+ * By default, setMaximumIntegerDigits truncates high-order digits silently.
+ *
+ * @param value Whether to set an error code if high-order digits are truncated.
+ * @stable ICU 64
+ */
+ void setFormatFailIfMoreThanMaxDigits(UBool value);
+
+ /**
+ * Synthesizes a pattern string that represents the current state
+ * of this Format object.
+ *
+ * @param result Output param which will receive the pattern.
+ * Previous contents are deleted.
+ * @return A reference to 'result'.
+ * @see applyPattern
+ * @stable ICU 2.0
+ */
+ virtual UnicodeString& toPattern(UnicodeString& result) const;
+
+ /**
+ * Synthesizes a localized pattern string that represents the current
+ * state of this Format object.
+ *
+ * @param result Output param which will receive the localized pattern.
+ * Previous contents are deleted.
+ * @return A reference to 'result'.
+ * @see applyPattern
+ * @stable ICU 2.0
+ */
+ virtual UnicodeString& toLocalizedPattern(UnicodeString& result) const;
+
+ /**
+ * Apply the given pattern to this Format object. A pattern is a
+ * short-hand specification for the various formatting properties.
+ * These properties can also be changed individually through the
+ * various setter methods.
+ *
+ * . Example "#,#00.0#" -> 1,234.56
+ *
+ * This means a minimum of 2 integer digits, 1 fraction digit, and
+ * a maximum of 2 fraction digits.
+ *
+ * . Example: "#,#00.0#;(#,#00.0#)" for negatives in parentheses.
+ *
+ * In negative patterns, the minimum and maximum counts are ignored;
+ * these are presumed to be set in the positive pattern.
+ *
+ * @param pattern The pattern to be applied.
+ * @param parseError Struct to receive information on position
+ * of error if an error is encountered
+ * @param status Output param set to success/failure code on
+ * exit. If the pattern is invalid, this will be
+ * set to a failure result.
+ * @stable ICU 2.0
+ */
+ virtual void applyPattern(const UnicodeString& pattern, UParseError& parseError, UErrorCode& status);
+
+ /**
+ * Sets the pattern.
+ * @param pattern The pattern to be applied.
+ * @param status Output param set to success/failure code on
+ * exit. If the pattern is invalid, this will be
+ * set to a failure result.
+ * @stable ICU 2.0
+ */
+ virtual void applyPattern(const UnicodeString& pattern, UErrorCode& status);
+
+ /**
+ * Apply the given pattern to this Format object. The pattern
+ * is assumed to be in a localized notation. A pattern is a
+ * short-hand specification for the various formatting properties.
+ * These properties can also be changed individually through the
+ * various setter methods.
+ *
+ * . Example "#,#00.0#" -> 1,234.56
+ *
+ * This means a minimum of 2 integer digits, 1 fraction digit, and
+ * a maximum of 2 fraction digits.
+ *
+ * Example: "#,#00.0#;(#,#00.0#)" for negatives in parentheses.
+ *
+ * In negative patterns, the minimum and maximum counts are ignored;
+ * these are presumed to be set in the positive pattern.
+ *
+ * @param pattern The localized pattern to be applied.
+ * @param parseError Struct to receive information on position
+ * of error if an error is encountered
+ * @param status Output param set to success/failure code on
+ * exit. If the pattern is invalid, this will be
+ * set to a failure result.
+ * @stable ICU 2.0
+ */
+ virtual void applyLocalizedPattern(const UnicodeString& pattern, UParseError& parseError,
+ UErrorCode& status);
+
+ /**
+ * Apply the given pattern to this Format object.
+ *
+ * @param pattern The localized pattern to be applied.
+ * @param status Output param set to success/failure code on
+ * exit. If the pattern is invalid, this will be
+ * set to a failure result.
+ * @stable ICU 2.0
+ */
+ virtual void applyLocalizedPattern(const UnicodeString& pattern, UErrorCode& status);
+
+
+ /**
+ * Sets the maximum number of digits allowed in the integer portion of a
+ * number. This override limits the integer digit count to 309.
+ *
+ * @param newValue the new value of the maximum number of digits
+ * allowed in the integer portion of a number.
+ * @see NumberFormat#setMaximumIntegerDigits
+ * @stable ICU 2.0
+ */
+ void setMaximumIntegerDigits(int32_t newValue) override;
+
+ /**
+ * Sets the minimum number of digits allowed in the integer portion of a
+ * number. This override limits the integer digit count to 309.
+ *
+ * @param newValue the new value of the minimum number of digits
+ * allowed in the integer portion of a number.
+ * @see NumberFormat#setMinimumIntegerDigits
+ * @stable ICU 2.0
+ */
+ void setMinimumIntegerDigits(int32_t newValue) override;
+
+ /**
+ * Sets the maximum number of digits allowed in the fraction portion of a
+ * number. This override limits the fraction digit count to 340.
+ *
+ * @param newValue the new value of the maximum number of digits
+ * allowed in the fraction portion of a number.
+ * @see NumberFormat#setMaximumFractionDigits
+ * @stable ICU 2.0
+ */
+ void setMaximumFractionDigits(int32_t newValue) override;
+
+ /**
+ * Sets the minimum number of digits allowed in the fraction portion of a
+ * number. This override limits the fraction digit count to 340.
+ *
+ * @param newValue the new value of the minimum number of digits
+ * allowed in the fraction portion of a number.
+ * @see NumberFormat#setMinimumFractionDigits
+ * @stable ICU 2.0
+ */
+ void setMinimumFractionDigits(int32_t newValue) override;
+
+ /**
+ * Returns the minimum number of significant digits that will be
+ * displayed. This value has no effect unless areSignificantDigitsUsed()
+ * returns true.
+ * @return the fewest significant digits that will be shown
+ * @stable ICU 3.0
+ */
+ int32_t getMinimumSignificantDigits() const;
+
+ /**
+ * Returns the maximum number of significant digits that will be
+ * displayed. This value has no effect unless areSignificantDigitsUsed()
+ * returns true.
+ * @return the most significant digits that will be shown
+ * @stable ICU 3.0
+ */
+ int32_t getMaximumSignificantDigits() const;
+
+ /**
+ * Sets the minimum number of significant digits that will be
+ * displayed. If min
is less than one then it is set
+ * to one. If the maximum significant digits count is less than
+ * min
, then it is set to min
.
+ * This function also enables the use of significant digits
+ * by this formatter - areSignificantDigitsUsed() will return true.
+ * @see #areSignificantDigitsUsed
+ * @param min the fewest significant digits to be shown
+ * @stable ICU 3.0
+ */
+ void setMinimumSignificantDigits(int32_t min);
+
+ /**
+ * Sets the maximum number of significant digits that will be
+ * displayed. If max
is less than one then it is set
+ * to one. If the minimum significant digits count is greater
+ * than max
, then it is set to max
.
+ * This function also enables the use of significant digits
+ * by this formatter - areSignificantDigitsUsed() will return true.
+ * @see #areSignificantDigitsUsed
+ * @param max the most significant digits to be shown
+ * @stable ICU 3.0
+ */
+ void setMaximumSignificantDigits(int32_t max);
+
+ /**
+ * Returns true if significant digits are in use, or false if
+ * integer and fraction digit counts are in use.
+ * @return true if significant digits are in use
+ * @stable ICU 3.0
+ */
+ UBool areSignificantDigitsUsed() const;
+
+ /**
+ * Sets whether significant digits are in use, or integer and
+ * fraction digit counts are in use.
+ * @param useSignificantDigits true to use significant digits, or
+ * false to use integer and fraction digit counts
+ * @stable ICU 3.0
+ */
+ void setSignificantDigitsUsed(UBool useSignificantDigits);
+
+ /**
+ * Sets the currency used to display currency
+ * amounts. This takes effect immediately, if this format is a
+ * currency format. If this format is not a currency format, then
+ * the currency is used if and when this object becomes a
+ * currency format through the application of a new pattern.
+ * @param theCurrency a 3-letter ISO code indicating new currency
+ * to use. It need not be null-terminated. May be the empty
+ * string or nullptr to indicate no currency.
+ * @param ec input-output error code
+ * @stable ICU 3.0
+ */
+ void setCurrency(const char16_t* theCurrency, UErrorCode& ec) override;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * Sets the currency used to display currency amounts. See
+ * setCurrency(const char16_t*, UErrorCode&).
+ * @deprecated ICU 3.0. Use setCurrency(const char16_t*, UErrorCode&).
+ */
+ virtual void setCurrency(const char16_t* theCurrency);
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Sets the `Currency Usage` object used to display currency.
+ * This takes effect immediately, if this format is a
+ * currency format.
+ * @param newUsage new currency usage object to use.
+ * @param ec input-output error code
+ * @stable ICU 54
+ */
+ void setCurrencyUsage(UCurrencyUsage newUsage, UErrorCode* ec);
+
+ /**
+ * Returns the `Currency Usage` object used to display currency
+ * @stable ICU 54
+ */
+ UCurrencyUsage getCurrencyUsage() const;
+
+#ifndef U_HIDE_INTERNAL_API
+
+ /**
+ * Format a number and save it into the given DecimalQuantity.
+ * Internal, not intended for public use.
+ * @internal
+ */
+ void formatToDecimalQuantity(double number, number::impl::DecimalQuantity& output,
+ UErrorCode& status) const;
+
+ /**
+ * Get a DecimalQuantity corresponding to a formattable as it would be
+ * formatted by this DecimalFormat.
+ * Internal, not intended for public use.
+ * @internal
+ */
+ void formatToDecimalQuantity(const Formattable& number, number::impl::DecimalQuantity& output,
+ UErrorCode& status) const;
+
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Converts this DecimalFormat to a (Localized)NumberFormatter. Starting
+ * in ICU 60, NumberFormatter is the recommended way to format numbers.
+ * You can use the returned LocalizedNumberFormatter to format numbers and
+ * get a FormattedNumber, which contains a string as well as additional
+ * annotations about the formatted value.
+ *
+ * If a memory allocation failure occurs, the return value of this method
+ * might be null. If you are concerned about correct recovery from
+ * out-of-memory situations, use this pattern:
+ *
+ *
+ * FormattedNumber result;
+ * if (auto* ptr = df->toNumberFormatter(status)) {
+ * result = ptr->formatDouble(123, status);
+ * }
+ *
+ *
+ * If you are not concerned about out-of-memory situations, or if your
+ * environment throws exceptions when memory allocation failure occurs,
+ * you can chain the methods, like this:
+ *
+ *
+ * FormattedNumber result = df
+ * ->toNumberFormatter(status)
+ * ->formatDouble(123, status);
+ *
+ *
+ * NOTE: The returned LocalizedNumberFormatter is owned by this DecimalFormat.
+ * If a non-const method is called on the DecimalFormat, or if the DecimalFormat
+ * is deleted, the object becomes invalid. If you plan to keep the return value
+ * beyond the lifetime of the DecimalFormat, copy it to a local variable:
+ *
+ *
+ * LocalizedNumberFormatter lnf;
+ * if (auto* ptr = df->toNumberFormatter(status)) {
+ * lnf = *ptr;
+ * }
+ *
+ *
+ * @param status Set on failure, like U_MEMORY_ALLOCATION_ERROR.
+ * @return A pointer to an internal object, or nullptr on failure.
+ * Do not delete the return value!
+ * @stable ICU 64
+ */
+ const number::LocalizedNumberFormatter* toNumberFormatter(UErrorCode& status) const;
+
+ /**
+ * Return the class ID for this class. This is useful only for
+ * comparing to a return value from getDynamicClassID(). For example:
+ *
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . Derived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 2.0
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override.
+ * This method is to implement a simple version of RTTI, since not all
+ * C++ compilers support genuine RTTI. Polymorphic operator==() and
+ * clone() methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 2.0
+ */
+ UClassID getDynamicClassID() const override;
+
+ private:
+
+ /** Rebuilds the formatter object from the property bag. */
+ void touch(UErrorCode& status);
+
+ /** Rebuilds the formatter object, ignoring any error code. */
+ void touchNoError();
+
+ /**
+ * Updates the property bag with settings from the given pattern.
+ *
+ * @param pattern The pattern string to parse.
+ * @param ignoreRounding Whether to leave out rounding information (minFrac, maxFrac, and rounding
+ * increment) when parsing the pattern. This may be desirable if a custom rounding mode, such
+ * as CurrencyUsage, is to be used instead. One of {@link
+ * PatternStringParser#IGNORE_ROUNDING_ALWAYS}, {@link PatternStringParser#IGNORE_ROUNDING_IF_CURRENCY},
+ * or {@link PatternStringParser#IGNORE_ROUNDING_NEVER}.
+ * @see PatternAndPropertyUtils#parseToExistingProperties
+ */
+ void setPropertiesFromPattern(const UnicodeString& pattern, int32_t ignoreRounding,
+ UErrorCode& status);
+
+ const numparse::impl::NumberParserImpl* getParser(UErrorCode& status) const;
+
+ const numparse::impl::NumberParserImpl* getCurrencyParser(UErrorCode& status) const;
+
+ static void fieldPositionHelper(
+ const number::impl::UFormattedNumberData& formatted,
+ FieldPosition& fieldPosition,
+ int32_t offset,
+ UErrorCode& status);
+
+ static void fieldPositionIteratorHelper(
+ const number::impl::UFormattedNumberData& formatted,
+ FieldPositionIterator* fpi,
+ int32_t offset,
+ UErrorCode& status);
+
+ void setupFastFormat();
+
+ bool fastFormatDouble(double input, UnicodeString& output) const;
+
+ bool fastFormatInt64(int64_t input, UnicodeString& output) const;
+
+ void doFastFormatInt32(int32_t input, bool isNegative, UnicodeString& output) const;
+
+ //=====================================================================================//
+ // INSTANCE FIELDS //
+ //=====================================================================================//
+
+
+ // One instance field for the implementation, keep all fields inside of an implementation
+ // class defined in number_mapper.h
+ number::impl::DecimalFormatFields* fields = nullptr;
+
+ // Allow child class CompactDecimalFormat to access fProperties:
+ friend class CompactDecimalFormat;
+
+ // Allow MeasureFormat to use fieldPositionHelper:
+ friend class MeasureFormat;
+
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _DECIMFMT
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/displayoptions.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/displayoptions.h
new file mode 100644
index 0000000000..9cc822626b
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/displayoptions.h
@@ -0,0 +1,270 @@
+// © 2022 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+#ifndef __DISPLAYOPTIONS_H__
+#define __DISPLAYOPTIONS_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+/**
+ * \file
+ * \brief C++ API: Display options class
+ *
+ * This class is designed as a more modern version of the UDisplayContext mechanism.
+ */
+
+#include "unicode/udisplayoptions.h"
+#include "unicode/uversion.h"
+
+U_NAMESPACE_BEGIN
+
+/**
+ * Represents all the display options that are supported by CLDR such as grammatical case, noun
+ * class, ... etc. It currently supports enums, but may be extended in the future to have other
+ * types of data. It replaces a DisplayContext[] as a method parameter.
+ *
+ * NOTE: This class is Immutable, and uses a Builder interface.
+ *
+ * For example:
+ * ```
+ * DisplayOptions x =
+ * DisplayOptions::builder().
+ * .setGrammaticalCase(UDISPOPT_GRAMMATICAL_CASE_DATIVE)
+ * .setPluralCategory(UDISPOPT_PLURAL_CATEGORY_FEW)
+ * .build();
+ * ```
+ *
+ * @stable ICU 72
+ */
+class U_I18N_API DisplayOptions {
+public:
+ /**
+ * Responsible for building `DisplayOptions`.
+ *
+ * @stable ICU 72
+ */
+ class U_I18N_API Builder {
+ public:
+ /**
+ * Sets the grammatical case.
+ *
+ * @param grammaticalCase The grammatical case.
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder &setGrammaticalCase(UDisplayOptionsGrammaticalCase grammaticalCase) {
+ this->grammaticalCase = grammaticalCase;
+ return *this;
+ }
+
+ /**
+ * Sets the noun class.
+ *
+ * @param nounClass The noun class.
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder &setNounClass(UDisplayOptionsNounClass nounClass) {
+ this->nounClass = nounClass;
+ return *this;
+ }
+
+ /**
+ * Sets the plural category.
+ *
+ * @param pluralCategory The plural category.
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder &setPluralCategory(UDisplayOptionsPluralCategory pluralCategory) {
+ this->pluralCategory = pluralCategory;
+ return *this;
+ }
+
+ /**
+ * Sets the capitalization.
+ *
+ * @param capitalization The capitalization.
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder &setCapitalization(UDisplayOptionsCapitalization capitalization) {
+ this->capitalization = capitalization;
+ return *this;
+ }
+
+ /**
+ * Sets the dialect handling.
+ *
+ * @param nameStyle The name style.
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder &setNameStyle(UDisplayOptionsNameStyle nameStyle) {
+ this->nameStyle = nameStyle;
+ return *this;
+ }
+
+ /**
+ * Sets the display length.
+ *
+ * @param displayLength The display length.
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder &setDisplayLength(UDisplayOptionsDisplayLength displayLength) {
+ this->displayLength = displayLength;
+ return *this;
+ }
+
+ /**
+ * Sets the substitute handling.
+ *
+ * @param substituteHandling The substitute handling.
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder &setSubstituteHandling(UDisplayOptionsSubstituteHandling substituteHandling) {
+ this->substituteHandling = substituteHandling;
+ return *this;
+ }
+
+ /**
+ * Builds the display options.
+ *
+ * @return DisplayOptions
+ * @stable ICU 72
+ */
+ DisplayOptions build() { return DisplayOptions(*this); }
+
+ private:
+ friend DisplayOptions;
+
+ Builder();
+ Builder(const DisplayOptions &displayOptions);
+
+ UDisplayOptionsGrammaticalCase grammaticalCase;
+ UDisplayOptionsNounClass nounClass;
+ UDisplayOptionsPluralCategory pluralCategory;
+ UDisplayOptionsCapitalization capitalization;
+ UDisplayOptionsNameStyle nameStyle;
+ UDisplayOptionsDisplayLength displayLength;
+ UDisplayOptionsSubstituteHandling substituteHandling;
+ };
+
+ /**
+ * Creates a builder with the `UNDEFINED` values for all the parameters.
+ *
+ * @return Builder
+ * @stable ICU 72
+ */
+ static Builder builder();
+ /**
+ * Creates a builder with the same parameters from this object.
+ *
+ * @return Builder
+ * @stable ICU 72
+ */
+ Builder copyToBuilder() const;
+ /**
+ * Gets the grammatical case.
+ *
+ * @return UDisplayOptionsGrammaticalCase
+ * @stable ICU 72
+ */
+ UDisplayOptionsGrammaticalCase getGrammaticalCase() const { return grammaticalCase; }
+
+ /**
+ * Gets the noun class.
+ *
+ * @return UDisplayOptionsNounClass
+ * @stable ICU 72
+ */
+ UDisplayOptionsNounClass getNounClass() const { return nounClass; }
+
+ /**
+ * Gets the plural category.
+ *
+ * @return UDisplayOptionsPluralCategory
+ * @stable ICU 72
+ */
+ UDisplayOptionsPluralCategory getPluralCategory() const { return pluralCategory; }
+
+ /**
+ * Gets the capitalization.
+ *
+ * @return UDisplayOptionsCapitalization
+ * @stable ICU 72
+ */
+ UDisplayOptionsCapitalization getCapitalization() const { return capitalization; }
+
+ /**
+ * Gets the dialect handling.
+ *
+ * @return UDisplayOptionsNameStyle
+ * @stable ICU 72
+ */
+ UDisplayOptionsNameStyle getNameStyle() const { return nameStyle; }
+
+ /**
+ * Gets the display length.
+ *
+ * @return UDisplayOptionsDisplayLength
+ * @stable ICU 72
+ */
+ UDisplayOptionsDisplayLength getDisplayLength() const { return displayLength; }
+
+ /**
+ * Gets the substitute handling.
+ *
+ * @return UDisplayOptionsSubstituteHandling
+ * @stable ICU 72
+ */
+ UDisplayOptionsSubstituteHandling getSubstituteHandling() const { return substituteHandling; }
+
+ /**
+ * Copies the DisplayOptions.
+ *
+ * @param other The options to copy.
+ * @stable ICU 72
+ */
+ DisplayOptions &operator=(const DisplayOptions &other) = default;
+
+ /**
+ * Moves the DisplayOptions.
+ *
+ * @param other The options to move from.
+ * @stable ICU 72
+ */
+ DisplayOptions &operator=(DisplayOptions &&other) noexcept = default;
+
+ /**
+ * Copies the DisplayOptions.
+ *
+ * @param other The options to copy.
+ * @stable ICU 72
+ */
+ DisplayOptions(const DisplayOptions &other) = default;
+
+private:
+ DisplayOptions(const Builder &builder);
+ UDisplayOptionsGrammaticalCase grammaticalCase;
+ UDisplayOptionsNounClass nounClass;
+ UDisplayOptionsPluralCategory pluralCategory;
+ UDisplayOptionsCapitalization capitalization;
+ UDisplayOptionsNameStyle nameStyle;
+ UDisplayOptionsDisplayLength displayLength;
+ UDisplayOptionsSubstituteHandling substituteHandling;
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __DISPLAYOPTIONS_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/docmain.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/docmain.h
new file mode 100644
index 0000000000..676e868e7c
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/docmain.h
@@ -0,0 +1,247 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/********************************************************************
+ * COPYRIGHT:
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ *
+ * FILE NAME: DOCMAIN.h
+ *
+ * Date Name Description
+ * 12/11/2000 Ram Creation.
+ */
+
+/**
+ * \file
+ * \brief (Non API- contains Doxygen definitions)
+ *
+ * This file contains documentation for Doxygen and does not have
+ * any significance with respect to C or C++ API
+ */
+
+/*! \mainpage
+ *
+ * \section API API Reference Usage
+ *
+ * C++ Programmers:
+ * C Programmers:
+ * API References for Previous Releases
+ *
+ *
+ * Architecture (User's Guide)
+ *
+ *
+ *
+ *
+ *\htmlonly Module List
\endhtmlonly
+ *
+ *
+ * This main page is generated from docmain.h
+ */
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtfmtsym.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtfmtsym.h
new file mode 100644
index 0000000000..18e2641b58
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtfmtsym.h
@@ -0,0 +1,1033 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+********************************************************************************
+* Copyright (C) 1997-2016, International Business Machines
+* Corporation and others. All Rights Reserved.
+********************************************************************************
+*
+* File DTFMTSYM.H
+*
+* Modification History:
+*
+* Date Name Description
+* 02/19/97 aliu Converted from java.
+* 07/21/98 stephen Added getZoneIndex()
+* Changed to match C++ conventions
+********************************************************************************
+*/
+
+#ifndef DTFMTSYM_H
+#define DTFMTSYM_H
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/calendar.h"
+#include "unicode/strenum.h"
+#include "unicode/uobject.h"
+#include "unicode/locid.h"
+#include "unicode/udat.h"
+#include "unicode/ures.h"
+
+/**
+ * \file
+ * \brief C++ API: Symbols for formatting dates.
+ */
+
+U_NAMESPACE_BEGIN
+
+/* forward declaration */
+class SimpleDateFormat;
+class Hashtable;
+class CharString;
+
+/**
+ * DateFormatSymbols is a public class for encapsulating localizable date-time
+ * formatting data -- including timezone data. DateFormatSymbols is used by
+ * DateFormat and SimpleDateFormat.
+ *
+ *
+ * Module Name
+ * C
+ * C++
+ *
+ *
+ * Basic Types and Constants
+ * utypes.h
+ * utypes.h
+ *
+ *
+ * Strings and Character Iteration
+ * ustring.h, utf8.h, utf16.h, icu::StringPiece, UText, UCharIterator, icu::ByteSink
+ * icu::UnicodeString, icu::CharacterIterator, icu::Appendable, icu::StringPiece,icu::ByteSink
+ *
+ *
+ * Unicode Character
+ *
Properties and Namesuchar.h, uscript.h
+ * C API
+ *
+ *
+ * Sets of Unicode Code Points and Strings
+ * uset.h
+ * icu::UnicodeSet
+ *
+ *
+ * Maps from Unicode Code Points to Integer Values
+ * ucptrie.h, umutablecptrie.h
+ * C API
+ *
+ *
+ * Maps from Strings to Integer Values
+ * (no C API)
+ * icu::BytesTrie, icu::UCharsTrie
+ *
+ *
+ * Codepage Conversion
+ * ucnv.h, ucnvsel.h
+ * C API
+ *
+ *
+ * Codepage Detection
+ * ucsdet.h
+ * C API
+ *
+ *
+ * Unicode Text Compression
+ * ucnv.h
+ *
(encoding name "SCSU" or "BOCU-1")C API
+ *
+ *
+ * Locales
+ * uloc.h, ulocale.h, ulocbuilder.h
+ * icu::Locale, icu::LocaleBuilder, icu::LocaleMatcher
+ *
+ *
+ * Resource Bundles
+ * ures.h
+ * icu::ResourceBundle
+ *
+ *
+ * Normalization
+ * unorm2.h
+ * icu::Normalizer2
+ *
+ *
+ * Calendars and Time Zones
+ * ucal.h
+ * icu::Calendar, icu::TimeZone
+ *
+ *
+ * Date and Time Formatting
+ * udat.h
+ * icu::DateFormat
+ *
+ *
+ * Relative Date and Time Formatting
+ * ureldatefmt.h
+ * icu::RelativeDateTimeFormatter
+ *
+ *
+ * Message Formatting
+ * umsg.h
+ * icu::MessageFormat
+ *
+ *
+ * Message Formatting 2
+ *
(technology preview)(no C API)
+ * icu::message2::MessageFormatter
+ *
+ *
+ * List Formatting
+ * ulistformatter.h
+ * icu::ListFormatter
+ *
+ *
+ * Number Formatting
+ *
(includes currency and unit formatting)unumberformatter.h, unum.h, usimplenumberformatter.h
+ * icu::number::NumberFormatter (ICU 60+) or icu::NumberFormat (older versions)
+ *
icu::number::SimpleNumberFormatter (ICU 73+)
+ *
+ * Number Range Formatting
+ *
(includes currency and unit ranges)unumberrangeformatter.h
+ * icu::number::NumberRangeFormatter
+ *
+ *
+ * Number Spellout
+ *
(Rule Based Number Formatting)unum.h
+ *
(use UNUM_SPELLOUT)icu::RuleBasedNumberFormat
+ *
+ *
+ * Text Transformation
+ *
(Transliteration)utrans.h
+ * icu::Transliterator
+ *
+ *
+ * Bidirectional Algorithm
+ * ubidi.h, ubiditransform.h
+ * C API
+ *
+ *
+ * Arabic Shaping
+ * ushape.h
+ * C API
+ *
+ *
+ * Collation
+ * ucol.h
+ * icu::Collator
+ *
+ *
+ * String Searching
+ * usearch.h
+ * icu::StringSearch
+ *
+ *
+ * Index Characters/
+ *
Bucketing for Sorted Lists(no C API)
+ * icu::AlphabeticIndex
+ *
+ *
+ * Text Boundary Analysis
+ *
(Break Iteration)ubrk.h
+ * icu::BreakIterator
+ *
+ *
+ * Regular Expressions
+ * uregex.h
+ * icu::RegexPattern, icu::RegexMatcher
+ *
+ *
+ * StringPrep
+ * usprep.h
+ * C API
+ *
+ *
+ * International Domain Names in Applications:
+ *
+ * UTS #46 in C/C++, IDNA2003 only via C APIuidna.h
+ * idna.h
+ *
+ * Identifier Spoofing & Confusability
+ * uspoof.h
+ * C API
+ *
+ *
+ * Universal Time Scale
+ * utmscale.h
+ * C API
+ *
+ *
+ * Paragraph Layout / Complex Text Layout
+ * playout.h
+ * icu::ParagraphLayout
+ *
+ *
+ * ICU I/O
+ * ustdio.h
+ * ustream.h
+ *
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . derived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 4.0
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
+ * method is to implement a simple version of RTTI, since not all C++
+ * compilers support genuine RTTI. Polymorphic operator==() and clone()
+ * methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 4.0
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * Copy constructor.
+ * @stable ICU 4.0
+ */
+ DateInterval(const DateInterval& other);
+
+ /**
+ * Default assignment operator
+ * @stable ICU 4.0
+ */
+ DateInterval& operator=(const DateInterval&);
+
+ /**
+ * Equality operator.
+ * @return true if the two DateIntervals are the same
+ * @stable ICU 4.0
+ */
+ virtual bool operator==(const DateInterval& other) const;
+
+ /**
+ * Non-equality operator
+ * @return true if the two DateIntervals are not the same
+ * @stable ICU 4.0
+ */
+ inline bool operator!=(const DateInterval& other) const;
+
+
+ /**
+ * clone this object.
+ * The caller owns the result and should delete it when done.
+ * @return a cloned DateInterval
+ * @stable ICU 4.0
+ */
+ virtual DateInterval* clone() const;
+
+private:
+ /**
+ * Default constructor, not implemented.
+ */
+ DateInterval() = delete;
+
+ UDate fromDate;
+ UDate toDate;
+
+} ;// end class DateInterval
+
+
+inline UDate
+DateInterval::getFromDate() const {
+ return fromDate;
+}
+
+
+inline UDate
+DateInterval::getToDate() const {
+ return toDate;
+}
+
+
+inline bool
+DateInterval::operator!=(const DateInterval& other) const {
+ return ( !operator==(other) );
+}
+
+
+U_NAMESPACE_END
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtitvfmt.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtitvfmt.h
new file mode 100644
index 0000000000..7bfdf2d8a2
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtitvfmt.h
@@ -0,0 +1,1201 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/********************************************************************************
+* Copyright (C) 2008-2016, International Business Machines Corporation and
+* others. All Rights Reserved.
+*******************************************************************************
+*
+* File DTITVFMT.H
+*
+*******************************************************************************
+*/
+
+#ifndef __DTITVFMT_H__
+#define __DTITVFMT_H__
+
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+/**
+ * \file
+ * \brief C++ API: Format and parse date interval in a language-independent manner.
+ */
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/ucal.h"
+#include "unicode/smpdtfmt.h"
+#include "unicode/dtintrv.h"
+#include "unicode/dtitvinf.h"
+#include "unicode/dtptngen.h"
+#include "unicode/formattedvalue.h"
+#include "unicode/udisplaycontext.h"
+
+U_NAMESPACE_BEGIN
+
+
+class FormattedDateIntervalData;
+class DateIntervalFormat;
+
+/**
+ * An immutable class containing the result of a date interval formatting operation.
+ *
+ * Instances of this class are immutable and thread-safe.
+ *
+ * When calling nextPosition():
+ * The fields are returned from left to right. The special field category
+ * UFIELD_CATEGORY_DATE_INTERVAL_SPAN is used to indicate which datetime
+ * primitives came from which arguments: 0 means fromCalendar, and 1 means
+ * toCalendar. The span category will always occur before the
+ * corresponding fields in UFIELD_CATEGORY_DATE
+ * in the nextPosition() iterator.
+ *
+ * Not intended for public subclassing.
+ *
+ * @stable ICU 64
+ */
+class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue {
+ public:
+ /**
+ * Default constructor; makes an empty FormattedDateInterval.
+ * @stable ICU 64
+ */
+ FormattedDateInterval() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
+
+ /**
+ * Move constructor: Leaves the source FormattedDateInterval in an undefined state.
+ * @stable ICU 64
+ */
+ FormattedDateInterval(FormattedDateInterval&& src) noexcept;
+
+ /**
+ * Destruct an instance of FormattedDateInterval.
+ * @stable ICU 64
+ */
+ virtual ~FormattedDateInterval() override;
+
+ /** Copying not supported; use move constructor instead. */
+ FormattedDateInterval(const FormattedDateInterval&) = delete;
+
+ /** Copying not supported; use move assignment instead. */
+ FormattedDateInterval& operator=(const FormattedDateInterval&) = delete;
+
+ /**
+ * Move assignment: Leaves the source FormattedDateInterval in an undefined state.
+ * @stable ICU 64
+ */
+ FormattedDateInterval& operator=(FormattedDateInterval&& src) noexcept;
+
+ /** @copydoc FormattedValue::toString() */
+ UnicodeString toString(UErrorCode& status) const override;
+
+ /** @copydoc FormattedValue::toTempString() */
+ UnicodeString toTempString(UErrorCode& status) const override;
+
+ /** @copydoc FormattedValue::appendTo() */
+ Appendable &appendTo(Appendable& appendable, UErrorCode& status) const override;
+
+ /** @copydoc FormattedValue::nextPosition() */
+ UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const override;
+
+ private:
+ FormattedDateIntervalData *fData;
+ UErrorCode fErrorCode;
+ explicit FormattedDateInterval(FormattedDateIntervalData *results)
+ : fData(results), fErrorCode(U_ZERO_ERROR) {}
+ explicit FormattedDateInterval(UErrorCode errorCode)
+ : fData(nullptr), fErrorCode(errorCode) {}
+ friend class DateIntervalFormat;
+};
+
+
+/**
+ * DateIntervalFormat is a class for formatting and parsing date
+ * intervals in a language-independent manner.
+ * Only formatting is supported, parsing is not supported.
+ *
+ *
+ *
+ *
+ * For those non-digit calendar fields, the pattern letter length is
+ * important, such as MMM, MMMM, and MMMMM; EEE and EEEE,
+ * and the field's pattern letter length is honored.
+ *
+ * For the digit calendar fields, such as M or MM, d or dd, yy or yyyy,
+ * the field pattern length is ignored and the best match, which is defined
+ * in date time patterns, will be returned without honor the field pattern
+ * letter length in skeleton.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * \code
+ * // the date interval object which the DateIntervalFormat formats on
+ * // and parses into
+ * DateInterval* dtInterval = new DateInterval(1000*3600*24, 1000*3600*24*2);
+ * UErrorCode status = U_ZERO_ERROR;
+ * DateIntervalFormat* dtIntervalFmt = DateIntervalFormat::createInstance(
+ * UDAT_YEAR_MONTH_DAY,
+ * Locale("en", "GB", ""), status);
+ * UnicodeUnicodeString dateIntervalString;
+ * FieldPosition pos = 0;
+ * // formatting
+ * dtIntervalFmt->format(dtInterval, dateIntervalUnicodeString, pos, status);
+ * delete dtIntervalFmt;
+ * \endcode
+ *
+ */
+class U_I18N_API DateIntervalFormat : public Format {
+public:
+
+ /**
+ * Construct a DateIntervalFormat from skeleton and the default locale.
+ *
+ * This is a convenient override of
+ * createInstance(const UnicodeString& skeleton, const Locale& locale,
+ * UErrorCode&)
+ * with the value of locale as default locale.
+ *
+ * @param skeleton the skeleton on which interval format based.
+ * @param status output param set to success/failure code on exit
+ * @return a date time interval formatter which the caller owns.
+ * @stable ICU 4.0
+ */
+ static DateIntervalFormat* U_EXPORT2 createInstance(
+ const UnicodeString& skeleton,
+ UErrorCode& status);
+
+ /**
+ * Construct a DateIntervalFormat from skeleton and a given locale.
+ *
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . erived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 4.0
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
+ * method is to implement a simple version of RTTI, since not all C++
+ * compilers support genuine RTTI. Polymorphic operator==() and clone()
+ * methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 4.0
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+protected:
+
+ /**
+ * Copy constructor.
+ * @stable ICU 4.0
+ */
+ DateIntervalFormat(const DateIntervalFormat&);
+
+ /**
+ * Assignment operator.
+ * @stable ICU 4.0
+ */
+ DateIntervalFormat& operator=(const DateIntervalFormat&);
+
+private:
+
+ /*
+ * This is for ICU internal use only. Please do not use.
+ * Save the interval pattern information.
+ * Interval pattern consists of 2 single date patterns and the separator.
+ * For example, interval pattern "MMM d - MMM d, yyyy" consists
+ * a single date pattern "MMM d", another single date pattern "MMM d, yyyy",
+ * and a separator "-".
+ * The pattern is divided into 2 parts. For above example,
+ * the first part is "MMM d - ", and the second part is "MMM d, yyyy".
+ * Also, the first date appears in an interval pattern could be
+ * the earlier date or the later date.
+ * And such information is saved in the interval pattern as well.
+ */
+ struct PatternInfo {
+ UnicodeString firstPart;
+ UnicodeString secondPart;
+ /**
+ * Whether the first date in interval pattern is later date or not.
+ * Fallback format set the default ordering.
+ * And for a particular interval pattern, the order can be
+ * overridden by prefixing the interval pattern with "latestFirst:" or
+ * "earliestFirst:"
+ * For example, given 2 date, Jan 10, 2007 to Feb 10, 2007.
+ * if the fallback format is "{0} - {1}",
+ * and the pattern is "d MMM - d MMM yyyy", the interval format is
+ * "10 Jan - 10 Feb, 2007".
+ * If the pattern is "latestFirst:d MMM - d MMM yyyy",
+ * the interval format is "10 Feb - 10 Jan, 2007"
+ */
+ UBool laterDateFirst;
+ };
+
+
+ /**
+ * default constructor
+ * @internal (private)
+ */
+ DateIntervalFormat();
+
+ /**
+ * Construct a DateIntervalFormat from DateFormat,
+ * a DateIntervalInfo, and skeleton.
+ * DateFormat provides the timezone, calendar,
+ * full pattern, and date format symbols information.
+ * It should be a SimpleDateFormat object which
+ * has a pattern in it.
+ * the DateIntervalInfo provides the interval patterns.
+ *
+ * Note: the DateIntervalFormat takes ownership of both
+ * DateFormat and DateIntervalInfo objects.
+ * Caller should not delete them.
+ *
+ * @param locale the locale of this date interval formatter.
+ * @param dtItvInfo the DateIntervalInfo object to be adopted.
+ * @param skeleton the skeleton of the date formatter
+ * @param status output param set to success/failure code on exit
+ */
+ DateIntervalFormat(const Locale& locale, DateIntervalInfo* dtItvInfo,
+ const UnicodeString* skeleton, UErrorCode& status);
+
+
+ /**
+ * Construct a DateIntervalFormat from DateFormat
+ * and a DateIntervalInfo.
+ *
+ * It is a wrapper of the constructor.
+ *
+ * @param locale the locale of this date interval formatter.
+ * @param dtitvinf the DateIntervalInfo object to be adopted.
+ * @param skeleton the skeleton of this formatter.
+ * @param status Output param set to success/failure code.
+ * @return a date time interval formatter which the caller owns.
+ */
+ static DateIntervalFormat* U_EXPORT2 create(const Locale& locale,
+ DateIntervalInfo* dtitvinf,
+ const UnicodeString* skeleton,
+ UErrorCode& status);
+
+ /**
+ * Below are for generating interval patterns local to the formatter
+ */
+
+ /** Like fallbackFormat, but only formats the range part of the fallback. */
+ void fallbackFormatRange(
+ Calendar& fromCalendar,
+ Calendar& toCalendar,
+ UnicodeString& appendTo,
+ int8_t& firstIndex,
+ FieldPositionHandler& fphandler,
+ UErrorCode& status) const;
+
+ /**
+ * Format 2 Calendars using fall-back interval pattern
+ *
+ * The full pattern used in this fall-back format is the
+ * full pattern of the date formatter.
+ *
+ * gFormatterMutex must already be locked when calling this function.
+ *
+ * @param fromCalendar calendar set to the from date in date interval
+ * to be formatted into date interval string
+ * @param toCalendar calendar set to the to date in date interval
+ * to be formatted into date interval string
+ * @param fromToOnSameDay true iff from and to dates are on the same day
+ * (any difference is in ampm/hours or below)
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param firstIndex See formatImpl for more information.
+ * @param fphandler See formatImpl for more information.
+ * @param status output param set to success/failure code on exit
+ * @return Reference to 'appendTo' parameter.
+ * @internal (private)
+ */
+ UnicodeString& fallbackFormat(Calendar& fromCalendar,
+ Calendar& toCalendar,
+ UBool fromToOnSameDay,
+ UnicodeString& appendTo,
+ int8_t& firstIndex,
+ FieldPositionHandler& fphandler,
+ UErrorCode& status) const;
+
+
+
+ /**
+ * Initialize interval patterns locale to this formatter
+ *
+ * This code is a bit complicated since
+ * 1. the interval patterns saved in resource bundle files are interval
+ * patterns based on date or time only.
+ * It does not have interval patterns based on both date and time.
+ * Interval patterns on both date and time are algorithm generated.
+ *
+ * For example, it has interval patterns on skeleton "dMy" and "hm",
+ * but it does not have interval patterns on skeleton "dMyhm".
+ *
+ * The rule to generate interval patterns for both date and time skeleton are
+ * 1) when the year, month, or day differs, concatenate the two original
+ * expressions with a separator between,
+ * For example, interval pattern from "Jan 10, 2007 10:10 am"
+ * to "Jan 11, 2007 10:10am" is
+ * "Jan 10, 2007 10:10 am - Jan 11, 2007 10:10am"
+ *
+ * 2) otherwise, present the date followed by the range expression
+ * for the time.
+ * For example, interval pattern from "Jan 10, 2007 10:10 am"
+ * to "Jan 10, 2007 11:10am" is
+ * "Jan 10, 2007 10:10 am - 11:10am"
+ *
+ * 2. even a pattern does not request a certain calendar field,
+ * the interval pattern needs to include such field if such fields are
+ * different between 2 dates.
+ * For example, a pattern/skeleton is "hm", but the interval pattern
+ * includes year, month, and date when year, month, and date differs.
+ *
+ *
+ * @param status output param set to success/failure code on exit
+ */
+ void initializePattern(UErrorCode& status);
+
+
+
+ /**
+ * Set fall back interval pattern given a calendar field,
+ * a skeleton, and a date time pattern generator.
+ * @param field the largest different calendar field
+ * @param skeleton a skeleton
+ * @param status output param set to success/failure code on exit
+ */
+ void setFallbackPattern(UCalendarDateFields field,
+ const UnicodeString& skeleton,
+ UErrorCode& status);
+
+
+
+ /**
+ * Converts special hour metacharacters (such as 'j') in the skeleton into locale-appropriate
+ * pattern characters.
+ *
+ *
+ * @param skeleton The skeleton to convert
+ * @return A copy of the skeleton, which "j" and any other special hour metacharacters converted to the regular ones.
+ *
+ */
+ UnicodeString normalizeHourMetacharacters(const UnicodeString& skeleton) const;
+
+
+
+ /**
+ * get separated date and time skeleton from a combined skeleton.
+ *
+ * The difference between date skeleton and normalizedDateSkeleton are:
+ * 1. both 'y' and 'd' are appeared only once in normalizeDateSkeleton
+ * 2. 'E' and 'EE' are normalized into 'EEE'
+ * 3. 'MM' is normalized into 'M'
+ *
+ ** the difference between time skeleton and normalizedTimeSkeleton are:
+ * 1. both 'H' and 'h' are normalized as 'h' in normalized time skeleton,
+ * 2. 'a' is omitted in normalized time skeleton.
+ * 3. there is only one appearance for 'h', 'm','v', 'z' in normalized time
+ * skeleton
+ *
+ *
+ * @param skeleton given combined skeleton.
+ * @param date Output parameter for date only skeleton.
+ * @param normalizedDate Output parameter for normalized date only
+ *
+ * @param time Output parameter for time only skeleton.
+ * @param normalizedTime Output parameter for normalized time only
+ * skeleton.
+ *
+ */
+ static void U_EXPORT2 getDateTimeSkeleton(const UnicodeString& skeleton,
+ UnicodeString& date,
+ UnicodeString& normalizedDate,
+ UnicodeString& time,
+ UnicodeString& normalizedTime);
+
+
+
+ /**
+ * Generate date or time interval pattern from resource,
+ * and set them into the interval pattern locale to this formatter.
+ *
+ * It needs to handle the following:
+ * 1. need to adjust field width.
+ * For example, the interval patterns saved in DateIntervalInfo
+ * includes "dMMMy", but not "dMMMMy".
+ * Need to get interval patterns for dMMMMy from dMMMy.
+ * Another example, the interval patterns saved in DateIntervalInfo
+ * includes "hmv", but not "hmz".
+ * Need to get interval patterns for "hmz' from 'hmv'
+ *
+ * 2. there might be no pattern for 'y' differ for skeleton "Md",
+ * in order to get interval patterns for 'y' differ,
+ * need to look for it from skeleton 'yMd'
+ *
+ * @param dateSkeleton normalized date skeleton
+ * @param timeSkeleton normalized time skeleton
+ * @return whether the resource is found for the skeleton.
+ * true if interval pattern found for the skeleton,
+ * false otherwise.
+ */
+ UBool setSeparateDateTimePtn(const UnicodeString& dateSkeleton,
+ const UnicodeString& timeSkeleton);
+
+
+
+
+ /**
+ * Generate interval pattern from existing resource
+ *
+ * It not only save the interval patterns,
+ * but also return the extended skeleton and its best match skeleton.
+ *
+ * @param field largest different calendar field
+ * @param skeleton skeleton
+ * @param bestSkeleton the best match skeleton which has interval pattern
+ * defined in resource
+ * @param differenceInfo the difference between skeleton and best skeleton
+ * 0 means the best matched skeleton is the same as input skeleton
+ * 1 means the fields are the same, but field width are different
+ * 2 means the only difference between fields are v/z,
+ * -1 means there are other fields difference
+ *
+ * @param extendedSkeleton extended skeleton
+ * @param extendedBestSkeleton extended best match skeleton
+ * @return whether the interval pattern is found
+ * through extending skeleton or not.
+ * true if interval pattern is found by
+ * extending skeleton, false otherwise.
+ */
+ UBool setIntervalPattern(UCalendarDateFields field,
+ const UnicodeString* skeleton,
+ const UnicodeString* bestSkeleton,
+ int8_t differenceInfo,
+ UnicodeString* extendedSkeleton = nullptr,
+ UnicodeString* extendedBestSkeleton = nullptr);
+
+ /**
+ * Adjust field width in best match interval pattern to match
+ * the field width in input skeleton.
+ *
+ * TODO (xji) make a general solution
+ * The adjusting rule can be:
+ * 1. always adjust
+ * 2. never adjust
+ * 3. default adjust, which means adjust according to the following rules
+ * 3.1 always adjust string, such as MMM and MMMM
+ * 3.2 never adjust between string and numeric, such as MM and MMM
+ * 3.3 always adjust year
+ * 3.4 do not adjust 'd', 'h', or 'm' if h presents
+ * 3.5 do not adjust 'M' if it is numeric(?)
+ *
+ * Since date interval format is well-formed format,
+ * date and time skeletons are normalized previously,
+ * till this stage, the adjust here is only "adjust strings, such as MMM
+ * and MMMM, EEE and EEEE.
+ *
+ * @param inputSkeleton the input skeleton
+ * @param bestMatchSkeleton the best match skeleton
+ * @param bestMatchIntervalPattern the best match interval pattern
+ * @param differenceInfo the difference between 2 skeletons
+ * 1 means only field width differs
+ * 2 means v/z exchange
+ * @param suppressDayPeriodField if true, remove the day period field from the pattern, if there is one
+ * @param adjustedIntervalPattern adjusted interval pattern
+ */
+ static void U_EXPORT2 adjustFieldWidth(
+ const UnicodeString& inputSkeleton,
+ const UnicodeString& bestMatchSkeleton,
+ const UnicodeString& bestMatchIntervalPattern,
+ int8_t differenceInfo,
+ UBool suppressDayPeriodField,
+ UnicodeString& adjustedIntervalPattern);
+
+ /**
+ * Does the same thing as UnicodeString::findAndReplace(), except that it won't perform
+ * the substitution inside quoted literal text.
+ * @param targetString The string to perform the find-replace operation on.
+ * @param strToReplace The string to search for and replace in the target string.
+ * @param strToReplaceWith The string to substitute in wherever `stringToReplace` was found.
+ */
+ static void U_EXPORT2 findReplaceInPattern(UnicodeString& targetString,
+ const UnicodeString& strToReplace,
+ const UnicodeString& strToReplaceWith);
+
+ /**
+ * Concat a single date pattern with a time interval pattern,
+ * set it into the intervalPatterns, while field is time field.
+ * This is used to handle time interval patterns on skeleton with
+ * both time and date. Present the date followed by
+ * the range expression for the time.
+ * @param format date and time format
+ * @param datePattern date pattern
+ * @param field time calendar field: AM_PM, HOUR, MINUTE
+ * @param status output param set to success/failure code on exit
+ */
+ void concatSingleDate2TimeInterval(UnicodeString& format,
+ const UnicodeString& datePattern,
+ UCalendarDateFields field,
+ UErrorCode& status);
+
+ /**
+ * check whether a calendar field present in a skeleton.
+ * @param field calendar field need to check
+ * @param skeleton given skeleton on which to check the calendar field
+ * @return true if field present in a skeleton.
+ */
+ static UBool U_EXPORT2 fieldExistsInSkeleton(UCalendarDateFields field,
+ const UnicodeString& skeleton);
+
+
+ /**
+ * Split interval patterns into 2 part.
+ * @param intervalPattern interval pattern
+ * @return the index in interval pattern which split the pattern into 2 part
+ */
+ static int32_t U_EXPORT2 splitPatternInto2Part(const UnicodeString& intervalPattern);
+
+
+ /**
+ * Break interval patterns as 2 part and save them into pattern info.
+ * @param field calendar field
+ * @param intervalPattern interval pattern
+ */
+ void setIntervalPattern(UCalendarDateFields field,
+ const UnicodeString& intervalPattern);
+
+
+ /**
+ * Break interval patterns as 2 part and save them into pattern info.
+ * @param field calendar field
+ * @param intervalPattern interval pattern
+ * @param laterDateFirst whether later date appear first in interval pattern
+ */
+ void setIntervalPattern(UCalendarDateFields field,
+ const UnicodeString& intervalPattern,
+ UBool laterDateFirst);
+
+
+ /**
+ * Set pattern information.
+ *
+ * @param field calendar field
+ * @param firstPart the first part in interval pattern
+ * @param secondPart the second part in interval pattern
+ * @param laterDateFirst whether the first date in intervalPattern
+ * is earlier date or later date
+ */
+ void setPatternInfo(UCalendarDateFields field,
+ const UnicodeString* firstPart,
+ const UnicodeString* secondPart,
+ UBool laterDateFirst);
+
+ /**
+ * Format 2 Calendars to produce a string.
+ * Implementation of the similar public format function.
+ * Must be called with gFormatterMutex already locked.
+ *
+ * Note: "fromCalendar" and "toCalendar" are not const,
+ * since calendar is not const in SimpleDateFormat::format(Calendar&),
+ *
+ * @param fromCalendar calendar set to the from date in date interval
+ * to be formatted into date interval string
+ * @param toCalendar calendar set to the to date in date interval
+ * to be formatted into date interval string
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param firstIndex 0 if the first output date is fromCalendar;
+ * 1 if it corresponds to toCalendar;
+ * -1 if there is only one date printed.
+ * @param fphandler Handler for field position information.
+ * The fields will be from the UDateFormatField enum.
+ * @param status Output param filled with success/failure status.
+ * Caller needs to make sure it is SUCCESS
+ * at the function entrance
+ * @return Reference to 'appendTo' parameter.
+ * @internal (private)
+ */
+ UnicodeString& formatImpl(Calendar& fromCalendar,
+ Calendar& toCalendar,
+ UnicodeString& appendTo,
+ int8_t& firstIndex,
+ FieldPositionHandler& fphandler,
+ UErrorCode& status) const ;
+
+ /** Version of formatImpl for DateInterval. */
+ UnicodeString& formatIntervalImpl(const DateInterval& dtInterval,
+ UnicodeString& appendTo,
+ int8_t& firstIndex,
+ FieldPositionHandler& fphandler,
+ UErrorCode& status) const;
+
+
+ // from calendar field to pattern letter
+ static const char16_t fgCalendarFieldToPatternLetter[];
+
+
+ /**
+ * The interval patterns for this locale.
+ */
+ DateIntervalInfo* fInfo;
+
+ /**
+ * The DateFormat object used to format single pattern
+ */
+ SimpleDateFormat* fDateFormat;
+
+ /**
+ * The 2 calendars with the from and to date.
+ * could re-use the calendar in fDateFormat,
+ * but keeping 2 calendars make it clear and clean.
+ */
+ Calendar* fFromCalendar;
+ Calendar* fToCalendar;
+
+ Locale fLocale;
+
+ /**
+ * Following are interval information relevant (locale) to this formatter.
+ */
+ UnicodeString fSkeleton;
+ PatternInfo fIntervalPatterns[DateIntervalInfo::kIPI_MAX_INDEX];
+
+ /**
+ * Patterns for fallback formatting.
+ */
+ UnicodeString* fDatePattern;
+ UnicodeString* fTimePattern;
+ UnicodeString* fDateTimeFormat;
+
+ /**
+ * Other formatting information
+ */
+ UDisplayContext fCapitalizationContext;
+};
+
+inline bool
+DateIntervalFormat::operator!=(const Format& other) const {
+ return !operator==(other);
+}
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _DTITVFMT_H__
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtitvinf.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtitvinf.h
new file mode 100644
index 0000000000..5b9a45351c
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/dtitvinf.h
@@ -0,0 +1,524 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+ *******************************************************************************
+ * Copyright (C) 2008-2016, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ *******************************************************************************
+ *
+ * File DTITVINF.H
+ *
+ *******************************************************************************
+ */
+
+#ifndef __DTITVINF_H__
+#define __DTITVINF_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+/**
+ * \file
+ * \brief C++ API: Date/Time interval patterns for formatting date/time interval
+ */
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/udat.h"
+#include "unicode/locid.h"
+#include "unicode/ucal.h"
+#include "unicode/dtptngen.h"
+
+U_NAMESPACE_BEGIN
+
+/**
+ * DateIntervalInfo is a public class for encapsulating localizable
+ * date time interval patterns. It is used by DateIntervalFormat.
+ *
+ *
+ *
+ *
+ *
+ * UErrorCode status = U_ZERO_ERROR;
+ * DateIntervalInfo dIntervalInfo = new DateIntervalInfo();
+ * dIntervalInfo->setFallbackIntervalPattern("{0} ~ {1}");
+ * dIntervalInfo->setIntervalPattern("yMd", UCAL_YEAR, "'from' yyyy-M-d 'to' yyyy-M-d", status);
+ * dIntervalInfo->setIntervalPattern("yMMMd", UCAL_MONTH, "'from' yyyy MMM d 'to' MMM d", status);
+ * dIntervalInfo->setIntervalPattern("yMMMd", UCAL_DAY, "yyyy MMM d-d", status, status);
+ *
+ *
+ * Restriction:
+ * Currently, users can only set interval patterns when the following
+ * calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH,
+ * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND and MILLISECOND.
+ * Interval patterns when other calendar fields are different are
+ * not supported.
+ *
+ * @param skeleton the skeleton on which interval pattern based
+ * @param lrgDiffCalUnit the largest different calendar unit.
+ * @param intervalPattern the interval pattern on the largest different
+ * calendar unit.
+ * For example, if lrgDiffCalUnit is
+ * "year", the interval pattern for en_US when year
+ * is different could be "'from' yyyy 'to' yyyy".
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.0
+ */
+ void setIntervalPattern(const UnicodeString& skeleton,
+ UCalendarDateFields lrgDiffCalUnit,
+ const UnicodeString& intervalPattern,
+ UErrorCode& status);
+
+ /**
+ * Get the interval pattern given skeleton and
+ * the largest different calendar field.
+ * @param skeleton the skeleton
+ * @param field the largest different calendar field
+ * @param result output param to receive the pattern
+ * @param status output param set to success/failure code on exit
+ * @return a reference to 'result'
+ * @stable ICU 4.0
+ */
+ UnicodeString& getIntervalPattern(const UnicodeString& skeleton,
+ UCalendarDateFields field,
+ UnicodeString& result,
+ UErrorCode& status) const;
+
+ /**
+ * Get the fallback interval pattern.
+ * @param result output param to receive the pattern
+ * @return a reference to 'result'
+ * @stable ICU 4.0
+ */
+ UnicodeString& getFallbackIntervalPattern(UnicodeString& result) const;
+
+
+ /**
+ * Re-set the fallback interval pattern.
+ *
+ * In construction, default fallback pattern is set as "{0} - {1}".
+ * And constructor taking locale as parameter will set the
+ * fallback pattern as what defined in the locale resource file.
+ *
+ * This method provides a way for user to replace the fallback pattern.
+ *
+ * @param fallbackPattern fall-back interval pattern.
+ * @param status output param set to success/failure code on exit
+ * @stable ICU 4.0
+ */
+ void setFallbackIntervalPattern(const UnicodeString& fallbackPattern,
+ UErrorCode& status);
+
+
+ /** Get default order -- whether the first date in pattern is later date
+ or not.
+ * return default date ordering in interval pattern. true if the first date
+ * in pattern is later date, false otherwise.
+ * @stable ICU 4.0
+ */
+ UBool getDefaultOrder() const;
+
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for the actual class.
+ *
+ * @stable ICU 4.0
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for this class.
+ *
+ * @stable ICU 4.0
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+
+private:
+ /**
+ * DateIntervalFormat will need access to
+ * getBestSkeleton(), parseSkeleton(), enum IntervalPatternIndex,
+ * and calendarFieldToPatternIndex().
+ *
+ * Instead of making above public,
+ * make DateIntervalFormat a friend of DateIntervalInfo.
+ */
+ friend class DateIntervalFormat;
+
+ /**
+ * Internal struct used to load resource bundle data.
+ */
+ struct U_HIDDEN DateIntervalSink;
+
+ /**
+ * Following is for saving the interval patterns.
+ * We only support interval patterns on
+ * ERA, YEAR, MONTH, DAY, AM_PM, HOUR, MINUTE, SECOND and MILLISECOND.
+ */
+ enum IntervalPatternIndex
+ {
+ kIPI_ERA,
+ kIPI_YEAR,
+ kIPI_MONTH,
+ kIPI_DATE,
+ kIPI_AM_PM,
+ kIPI_HOUR,
+ kIPI_MINUTE,
+ kIPI_SECOND,
+ kIPI_MILLISECOND,
+ kIPI_MAX_INDEX
+ };
+public:
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Max index for stored interval patterns
+ * @internal ICU 4.4
+ */
+ enum {
+ kMaxIntervalPatternIndex = kIPI_MAX_INDEX
+ };
+#endif /* U_HIDE_INTERNAL_API */
+private:
+
+
+ /**
+ * Initialize the DateIntervalInfo from locale
+ * @param locale the given locale.
+ * @param status output param set to success/failure code on exit
+ */
+ void initializeData(const Locale& locale, UErrorCode& status);
+
+
+ /* Set Interval pattern.
+ *
+ * It sets interval pattern into the hash map.
+ *
+ * @param skeleton skeleton on which the interval pattern based
+ * @param lrgDiffCalUnit the largest different calendar unit.
+ * @param intervalPattern the interval pattern on the largest different
+ * calendar unit.
+ * @param status output param set to success/failure code on exit
+ */
+ void setIntervalPatternInternally(const UnicodeString& skeleton,
+ UCalendarDateFields lrgDiffCalUnit,
+ const UnicodeString& intervalPattern,
+ UErrorCode& status);
+
+
+ /**given an input skeleton, get the best match skeleton
+ * which has pre-defined interval pattern in resource file.
+ * Also return the difference between the input skeleton
+ * and the best match skeleton.
+ *
+ * TODO (xji): set field weight or
+ * isolate the functionality in DateTimePatternGenerator
+ * @param skeleton input skeleton
+ * @param bestMatchDistanceInfo the difference between input skeleton
+ * and best match skeleton.
+ * 0, if there is exact match for input skeleton
+ * 1, if there is only field width difference between
+ * the best match and the input skeleton
+ * 2, the only field difference is 'v' and 'z'
+ * -1, if there is calendar field difference between
+ * the best match and the input skeleton
+ * @return best match skeleton
+ */
+ const UnicodeString* getBestSkeleton(const UnicodeString& skeleton,
+ int8_t& bestMatchDistanceInfo) const;
+
+
+ /**
+ * Parse skeleton, save each field's width.
+ * It is used for looking for best match skeleton,
+ * and adjust pattern field width.
+ * @param skeleton skeleton to be parsed
+ * @param skeletonFieldWidth parsed skeleton field width
+ */
+ static void U_EXPORT2 parseSkeleton(const UnicodeString& skeleton,
+ int32_t* skeletonFieldWidth);
+
+
+ /**
+ * Check whether one field width is numeric while the other is string.
+ *
+ * TODO (xji): make it general
+ *
+ * @param fieldWidth one field width
+ * @param anotherFieldWidth another field width
+ * @param patternLetter pattern letter char
+ * @return true if one field width is numeric and the other is string,
+ * false otherwise.
+ */
+ static UBool U_EXPORT2 stringNumeric(int32_t fieldWidth,
+ int32_t anotherFieldWidth,
+ char patternLetter);
+
+
+ /**
+ * Convert calendar field to the interval pattern index in
+ * hash table.
+ *
+ * Since we only support the following calendar fields:
+ * ERA, YEAR, MONTH, DATE, DAY_OF_MONTH, DAY_OF_WEEK,
+ * AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND.
+ * We reserve only 4 interval patterns for a skeleton.
+ *
+ * @param field calendar field
+ * @param status output param set to success/failure code on exit
+ * @return interval pattern index in hash table
+ */
+ static IntervalPatternIndex U_EXPORT2 calendarFieldToIntervalIndex(
+ UCalendarDateFields field,
+ UErrorCode& status);
+
+
+ /**
+ * delete hash table (of type fIntervalPatterns).
+ *
+ * @param hTable hash table to be deleted
+ */
+ void deleteHash(Hashtable* hTable);
+
+
+ /**
+ * initialize hash table (of type fIntervalPatterns).
+ *
+ * @param status output param set to success/failure code on exit
+ * @return hash table initialized
+ */
+ Hashtable* initHash(UErrorCode& status);
+
+
+
+ /**
+ * copy hash table (of type fIntervalPatterns).
+ *
+ * @param source the source to copy from
+ * @param target the target to copy to
+ * @param status output param set to success/failure code on exit
+ */
+ void copyHash(const Hashtable* source, Hashtable* target, UErrorCode& status);
+
+
+ // data members
+ // fallback interval pattern
+ UnicodeString fFallbackIntervalPattern;
+ // default order
+ UBool fFirstDateInPtnIsLaterDate;
+
+ // HashMapDateTimeRule
is a class representing a time in a year by
+ * a rule specified by month, day of month, day of week and
+ * time in the day.
+ *
+ * @stable ICU 3.8
+ */
+class U_I18N_API DateTimeRule : public UObject {
+public:
+
+ /**
+ * Date rule type constants.
+ * @stable ICU 3.8
+ */
+ enum DateRuleType {
+ DOM = 0, /**< The exact day of month,
+ for example, March 11. */
+ DOW, /**< The Nth occurrence of the day of week,
+ for example, 2nd Sunday in March. */
+ DOW_GEQ_DOM, /**< The first occurrence of the day of week on or after the day of monnth,
+ for example, first Sunday on or after March 8. */
+ DOW_LEQ_DOM /**< The last occurrence of the day of week on or before the day of month,
+ for example, first Sunday on or before March 14. */
+ };
+
+ /**
+ * Time rule type constants.
+ * @stable ICU 3.8
+ */
+ enum TimeRuleType {
+ WALL_TIME = 0, /**< The local wall clock time */
+ STANDARD_TIME, /**< The local standard time */
+ UTC_TIME /**< The UTC time */
+ };
+
+ /**
+ * Constructs a DateTimeRule
by the day of month and
+ * the time rule. The date rule type for an instance created by
+ * this constructor is DOM
.
+ *
+ * @param month The rule month, for example, Calendar::JANUARY
+ * @param dayOfMonth The day of month, 1-based.
+ * @param millisInDay The milliseconds in the rule date.
+ * @param timeType The time type, WALL_TIME
or STANDARD_TIME
+ * or UTC_TIME
.
+ * @stable ICU 3.8
+ */
+ DateTimeRule(int32_t month, int32_t dayOfMonth,
+ int32_t millisInDay, TimeRuleType timeType);
+
+ /**
+ * Constructs a DateTimeRule
by the day of week and its ordinal
+ * number and the time rule. The date rule type for an instance created
+ * by this constructor is DOW
.
+ *
+ * @param month The rule month, for example, Calendar::JANUARY
.
+ * @param weekInMonth The ordinal number of the day of week. Negative number
+ * may be used for specifying a rule date counted from the
+ * end of the rule month.
+ * @param dayOfWeek The day of week, for example, Calendar::SUNDAY
.
+ * @param millisInDay The milliseconds in the rule date.
+ * @param timeType The time type, WALL_TIME
or STANDARD_TIME
+ * or UTC_TIME
.
+ * @stable ICU 3.8
+ */
+ DateTimeRule(int32_t month, int32_t weekInMonth, int32_t dayOfWeek,
+ int32_t millisInDay, TimeRuleType timeType);
+
+ /**
+ * Constructs a DateTimeRule
by the first/last day of week
+ * on or after/before the day of month and the time rule. The date rule
+ * type for an instance created by this constructor is either
+ * DOM_GEQ_DOM
or DOM_LEQ_DOM
.
+ *
+ * @param month The rule month, for example, Calendar::JANUARY
+ * @param dayOfMonth The day of month, 1-based.
+ * @param dayOfWeek The day of week, for example, Calendar::SUNDAY
.
+ * @param after true if the rule date is on or after the day of month.
+ * @param millisInDay The milliseconds in the rule date.
+ * @param timeType The time type, WALL_TIME
or STANDARD_TIME
+ * or UTC_TIME
.
+ * @stable ICU 3.8
+ */
+ DateTimeRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, UBool after,
+ int32_t millisInDay, TimeRuleType timeType);
+
+ /**
+ * Copy constructor.
+ * @param source The DateTimeRule object to be copied.
+ * @stable ICU 3.8
+ */
+ DateTimeRule(const DateTimeRule& source);
+
+ /**
+ * Destructor.
+ * @stable ICU 3.8
+ */
+ ~DateTimeRule();
+
+ /**
+ * Clone this DateTimeRule object polymorphically. The caller owns the result and
+ * should delete it when done.
+ * @return A copy of the object.
+ * @stable ICU 3.8
+ */
+ DateTimeRule* clone() const;
+
+ /**
+ * Assignment operator.
+ * @param right The object to be copied.
+ * @stable ICU 3.8
+ */
+ DateTimeRule& operator=(const DateTimeRule& right);
+
+ /**
+ * Return true if the given DateTimeRule objects are semantically equal. Objects
+ * of different subclasses are considered unequal.
+ * @param that The object to be compared with.
+ * @return true if the given DateTimeRule objects are semantically equal.
+ * @stable ICU 3.8
+ */
+ bool operator==(const DateTimeRule& that) const;
+
+ /**
+ * Return true if the given DateTimeRule objects are semantically unequal. Objects
+ * of different subclasses are considered unequal.
+ * @param that The object to be compared with.
+ * @return true if the given DateTimeRule objects are semantically unequal.
+ * @stable ICU 3.8
+ */
+ bool operator!=(const DateTimeRule& that) const;
+
+ /**
+ * Gets the date rule type, such as DOM
+ * @return The date rule type.
+ * @stable ICU 3.8
+ */
+ DateRuleType getDateRuleType() const;
+
+ /**
+ * Gets the time rule type
+ * @return The time rule type, either WALL_TIME
or STANDARD_TIME
+ * or UTC_TIME
.
+ * @stable ICU 3.8
+ */
+ TimeRuleType getTimeRuleType() const;
+
+ /**
+ * Gets the rule month.
+ * @return The rule month.
+ * @stable ICU 3.8
+ */
+ int32_t getRuleMonth() const;
+
+ /**
+ * Gets the rule day of month. When the date rule type
+ * is DOW
, the value is always 0.
+ * @return The rule day of month
+ * @stable ICU 3.8
+ */
+ int32_t getRuleDayOfMonth() const;
+
+ /**
+ * Gets the rule day of week. When the date rule type
+ * is DOM
, the value is always 0.
+ * @return The rule day of week.
+ * @stable ICU 3.8
+ */
+ int32_t getRuleDayOfWeek() const;
+
+ /**
+ * Gets the ordinal number of the occurrence of the day of week
+ * in the month. When the date rule type is not DOW
,
+ * the value is always 0.
+ * @return The rule day of week ordinal number in the month.
+ * @stable ICU 3.8
+ */
+ int32_t getRuleWeekInMonth() const;
+
+ /**
+ * Gets the rule time in the rule day.
+ * @return The time in the rule day in milliseconds.
+ * @stable ICU 3.8
+ */
+ int32_t getRuleMillisInDay() const;
+
+ private:
+ int32_t fMonth;
+ int32_t fDayOfMonth;
+ int32_t fDayOfWeek;
+ int32_t fWeekInMonth;
+ int32_t fMillisInDay;
+ DateRuleType fDateRuleType;
+ TimeRuleType fTimeRuleType;
+
+public:
+ /**
+ * Return the class ID for this class. This is useful only for comparing to
+ * a return value from getDynamicClassID(). For example:
+ *
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . erived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 3.8
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
+ * method is to implement a simple version of RTTI, since not all C++
+ * compilers support genuine RTTI. Polymorphic operator==() and clone()
+ * methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 3.8
+ */
+ virtual UClassID getDynamicClassID() const override;
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // DTRULE_H
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/edits.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/edits.h
new file mode 100644
index 0000000000..bc3c943822
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/edits.h
@@ -0,0 +1,531 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+// edits.h
+// created: 2016dec30 Markus W. Scherer
+
+#ifndef __EDITS_H__
+#define __EDITS_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#include "unicode/uobject.h"
+
+/**
+ * \file
+ * \brief C++ API: C++ class Edits for low-level string transformations on styled text.
+ */
+
+U_NAMESPACE_BEGIN
+
+class UnicodeString;
+
+/**
+ * Records lengths of string edits but not replacement text. Supports replacements, insertions, deletions
+ * in linear progression. Does not support moving/reordering of text.
+ *
+ * There are two types of edits: change edits and no-change edits. Add edits to
+ * instances of this class using {@link #addReplace(int32_t, int32_t)} (for change edits) and
+ * {@link #addUnchanged(int32_t)} (for no-change edits). Change edits are retained with full granularity,
+ * whereas adjacent no-change edits are always merged together. In no-change edits, there is a one-to-one
+ * mapping between code points in the source and destination strings.
+ *
+ * After all edits have been added, instances of this class should be considered immutable, and an
+ * {@link Edits::Iterator} can be used for queries.
+ *
+ * There are four flavors of Edits::Iterator:
+ *
+ *
+ *
+ *
+ * For example, consider the string "abcßDeF", which case-folds to "abcssdef". This string has the
+ * following fine edits:
+ *
+ *
+ * and the following coarse edits (note how adjacent change edits get merged together):
+ *
+ *
+ *
+ * The "fine changes" and "coarse changes" iterators will step through only the change edits when their
+ * `Edits::Iterator::next()` methods are called. They are identical to the non-change iterators when
+ * their `Edits::Iterator::findSourceIndex()` or `Edits::Iterator::findDestinationIndex()`
+ * methods are used to walk through the string.
+ *
+ * For examples of how to use this class, see the test `TestCaseMapEditsIteratorDocs` in
+ * UCharacterCaseTest.java.
+ *
+ * An Edits object tracks a separate UErrorCode, but ICU string transformation functions
+ * (e.g., case mapping functions) merge any such errors into their API's UErrorCode.
+ *
+ * @stable ICU 59
+ */
+class U_COMMON_API Edits final : public UMemory {
+public:
+ /**
+ * Constructs an empty object.
+ * @stable ICU 59
+ */
+ Edits() :
+ array(stackArray), capacity(STACK_CAPACITY), length(0), delta(0), numChanges(0),
+ errorCode_(U_ZERO_ERROR) {}
+ /**
+ * Copy constructor.
+ * @param other source edits
+ * @stable ICU 60
+ */
+ Edits(const Edits &other) :
+ array(stackArray), capacity(STACK_CAPACITY), length(other.length),
+ delta(other.delta), numChanges(other.numChanges),
+ errorCode_(other.errorCode_) {
+ copyArray(other);
+ }
+ /**
+ * Move constructor, might leave src empty.
+ * This object will have the same contents that the source object had.
+ * @param src source edits
+ * @stable ICU 60
+ */
+ Edits(Edits &&src) noexcept :
+ array(stackArray), capacity(STACK_CAPACITY), length(src.length),
+ delta(src.delta), numChanges(src.numChanges),
+ errorCode_(src.errorCode_) {
+ moveArray(src);
+ }
+
+ /**
+ * Destructor.
+ * @stable ICU 59
+ */
+ ~Edits();
+
+ /**
+ * Assignment operator.
+ * @param other source edits
+ * @return *this
+ * @stable ICU 60
+ */
+ Edits &operator=(const Edits &other);
+
+ /**
+ * Move assignment operator, might leave src empty.
+ * This object will have the same contents that the source object had.
+ * The behavior is undefined if *this and src are the same object.
+ * @param src source edits
+ * @return *this
+ * @stable ICU 60
+ */
+ Edits &operator=(Edits &&src) noexcept;
+
+ /**
+ * Resets the data but may not release memory.
+ * @stable ICU 59
+ */
+ void reset() noexcept;
+
+ /**
+ * Adds a no-change edit: a record for an unchanged segment of text.
+ * Normally called from inside ICU string transformation functions, not user code.
+ * @stable ICU 59
+ */
+ void addUnchanged(int32_t unchangedLength);
+ /**
+ * Adds a change edit: a record for a text replacement/insertion/deletion.
+ * Normally called from inside ICU string transformation functions, not user code.
+ * @stable ICU 59
+ */
+ void addReplace(int32_t oldLength, int32_t newLength);
+ /**
+ * Sets the UErrorCode if an error occurred while recording edits.
+ * Preserves older error codes in the outErrorCode.
+ * Normally called from inside ICU string transformation functions, not user code.
+ * @param outErrorCode Set to an error code if it does not contain one already
+ * and an error occurred while recording edits.
+ * Otherwise unchanged.
+ * @return true if U_FAILURE(outErrorCode)
+ * @stable ICU 59
+ */
+ UBool copyErrorTo(UErrorCode &outErrorCode) const;
+
+ /**
+ * How much longer is the new text compared with the old text?
+ * @return new length minus old length
+ * @stable ICU 59
+ */
+ int32_t lengthDelta() const { return delta; }
+ /**
+ * @return true if there are any change edits
+ * @stable ICU 59
+ */
+ UBool hasChanges() const { return numChanges != 0; }
+
+ /**
+ * @return the number of change edits
+ * @stable ICU 60
+ */
+ int32_t numberOfChanges() const { return numChanges; }
+
+ /**
+ * Access to the list of edits.
+ *
+ * At any moment in time, an instance of this class points to a single edit: a "window" into a span
+ * of the source string and the corresponding span of the destination string. The source string span
+ * starts at {@link #sourceIndex()} and runs for {@link #oldLength()} chars; the destination string
+ * span starts at {@link #destinationIndex()} and runs for {@link #newLength()} chars.
+ *
+ * The iterator can be moved between edits using the `next()`, `findSourceIndex(int32_t, UErrorCode &)`,
+ * and `findDestinationIndex(int32_t, UErrorCode &)` methods.
+ * Calling any of these methods mutates the iterator to make it point to the corresponding edit.
+ *
+ * For more information, see the documentation for {@link Edits}.
+ *
+ * @see getCoarseIterator
+ * @see getFineIterator
+ * @stable ICU 59
+ */
+ struct U_COMMON_API Iterator final : public UMemory {
+ /**
+ * Default constructor, empty iterator.
+ * @stable ICU 60
+ */
+ Iterator() :
+ array(nullptr), index(0), length(0),
+ remaining(0), onlyChanges_(false), coarse(false),
+ dir(0), changed(false), oldLength_(0), newLength_(0),
+ srcIndex(0), replIndex(0), destIndex(0) {}
+ /**
+ * Copy constructor.
+ * @stable ICU 59
+ */
+ Iterator(const Iterator &other) = default;
+ /**
+ * Assignment operator.
+ * @stable ICU 59
+ */
+ Iterator &operator=(const Iterator &other) = default;
+
+ /**
+ * Advances the iterator to the next edit.
+ * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test,
+ * or else the function returns immediately. Check for U_FAILURE()
+ * on output or use with function chaining. (See User Guide for details.)
+ * @return true if there is another edit
+ * @stable ICU 59
+ */
+ UBool next(UErrorCode &errorCode) { return next(onlyChanges_, errorCode); }
+
+ /**
+ * Moves the iterator to the edit that contains the source index.
+ * The source index may be found in a no-change edit
+ * even if normal iteration would skip no-change edits.
+ * Normal iteration can continue from a found edit.
+ *
+ * The iterator state before this search logically does not matter.
+ * (It may affect the performance of the search.)
+ *
+ * The iterator state after this search is undefined
+ * if the source index is out of bounds for the source string.
+ *
+ * @param i source index
+ * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test,
+ * or else the function returns immediately. Check for U_FAILURE()
+ * on output or use with function chaining. (See User Guide for details.)
+ * @return true if the edit for the source index was found
+ * @stable ICU 59
+ */
+ UBool findSourceIndex(int32_t i, UErrorCode &errorCode) {
+ return findIndex(i, true, errorCode) == 0;
+ }
+
+ /**
+ * Moves the iterator to the edit that contains the destination index.
+ * The destination index may be found in a no-change edit
+ * even if normal iteration would skip no-change edits.
+ * Normal iteration can continue from a found edit.
+ *
+ * The iterator state before this search logically does not matter.
+ * (It may affect the performance of the search.)
+ *
+ * The iterator state after this search is undefined
+ * if the source index is out of bounds for the source string.
+ *
+ * @param i destination index
+ * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test,
+ * or else the function returns immediately. Check for U_FAILURE()
+ * on output or use with function chaining. (See User Guide for details.)
+ * @return true if the edit for the destination index was found
+ * @stable ICU 60
+ */
+ UBool findDestinationIndex(int32_t i, UErrorCode &errorCode) {
+ return findIndex(i, false, errorCode) == 0;
+ }
+
+ /**
+ * Computes the destination index corresponding to the given source index.
+ * If the source index is inside a change edit (not at its start),
+ * then the destination index at the end of that edit is returned,
+ * since there is no information about index mapping inside a change edit.
+ *
+ * (This means that indexes to the start and middle of an edit,
+ * for example around a grapheme cluster, are mapped to indexes
+ * encompassing the entire edit.
+ * The alternative, mapping an interior index to the start,
+ * would map such an interval to an empty one.)
+ *
+ * This operation will usually but not always modify this object.
+ * The iterator state after this search is undefined.
+ *
+ * @param i source index
+ * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test,
+ * or else the function returns immediately. Check for U_FAILURE()
+ * on output or use with function chaining. (See User Guide for details.)
+ * @return destination index; undefined if i is not 0..string length
+ * @stable ICU 60
+ */
+ int32_t destinationIndexFromSourceIndex(int32_t i, UErrorCode &errorCode);
+
+ /**
+ * Computes the source index corresponding to the given destination index.
+ * If the destination index is inside a change edit (not at its start),
+ * then the source index at the end of that edit is returned,
+ * since there is no information about index mapping inside a change edit.
+ *
+ * (This means that indexes to the start and middle of an edit,
+ * for example around a grapheme cluster, are mapped to indexes
+ * encompassing the entire edit.
+ * The alternative, mapping an interior index to the start,
+ * would map such an interval to an empty one.)
+ *
+ * This operation will usually but not always modify this object.
+ * The iterator state after this search is undefined.
+ *
+ * @param i destination index
+ * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test,
+ * or else the function returns immediately. Check for U_FAILURE()
+ * on output or use with function chaining. (See User Guide for details.)
+ * @return source index; undefined if i is not 0..string length
+ * @stable ICU 60
+ */
+ int32_t sourceIndexFromDestinationIndex(int32_t i, UErrorCode &errorCode);
+
+ /**
+ * Returns whether the edit currently represented by the iterator is a change edit.
+ *
+ * @return true if this edit replaces oldLength() units with newLength() different ones.
+ * false if oldLength units remain unchanged.
+ * @stable ICU 59
+ */
+ UBool hasChange() const { return changed; }
+
+ /**
+ * The length of the current span in the source string, which starts at {@link #sourceIndex}.
+ *
+ * @return the number of units in the original string which are replaced or remain unchanged.
+ * @stable ICU 59
+ */
+ int32_t oldLength() const { return oldLength_; }
+
+ /**
+ * The length of the current span in the destination string, which starts at
+ * {@link #destinationIndex}, or in the replacement string, which starts at
+ * {@link #replacementIndex}.
+ *
+ * @return the number of units in the modified string, if hasChange() is true.
+ * Same as oldLength if hasChange() is false.
+ * @stable ICU 59
+ */
+ int32_t newLength() const { return newLength_; }
+
+ /**
+ * The start index of the current span in the source string; the span has length
+ * {@link #oldLength}.
+ *
+ * @return the current index into the source string
+ * @stable ICU 59
+ */
+ int32_t sourceIndex() const { return srcIndex; }
+
+ /**
+ * The start index of the current span in the replacement string; the span has length
+ * {@link #newLength}. Well-defined only if the current edit is a change edit.
+ *
+ * The *replacement string* is the concatenation of all substrings of the destination
+ * string corresponding to change edits.
+ *
+ * This method is intended to be used together with operations that write only replacement
+ * characters (e.g. operations specifying the \ref U_OMIT_UNCHANGED_TEXT option).
+ * The source string can then be modified in-place.
+ *
+ * @return the current index into the replacement-characters-only string,
+ * not counting unchanged spans
+ * @stable ICU 59
+ */
+ int32_t replacementIndex() const {
+ // TODO: Throw an exception if we aren't in a change edit?
+ return replIndex;
+ }
+
+ /**
+ * The start index of the current span in the destination string; the span has length
+ * {@link #newLength}.
+ *
+ * @return the current index into the full destination string
+ * @stable ICU 59
+ */
+ int32_t destinationIndex() const { return destIndex; }
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * A string representation of the current edit represented by the iterator for debugging. You
+ * should not depend on the contents of the return string.
+ * @internal
+ */
+ UnicodeString& toString(UnicodeString& appendTo) const;
+#endif // U_HIDE_INTERNAL_API
+
+ private:
+ friend class Edits;
+
+ Iterator(const uint16_t *a, int32_t len, UBool oc, UBool crs);
+
+ int32_t readLength(int32_t head);
+ void updateNextIndexes();
+ void updatePreviousIndexes();
+ UBool noNext();
+ UBool next(UBool onlyChanges, UErrorCode &errorCode);
+ UBool previous(UErrorCode &errorCode);
+ /** @return -1: error or i<0; 0: found; 1: i>=string length */
+ int32_t findIndex(int32_t i, UBool findSource, UErrorCode &errorCode);
+
+ const uint16_t *array;
+ int32_t index, length;
+ // 0 if we are not within compressed equal-length changes.
+ // Otherwise the number of remaining changes, including the current one.
+ int32_t remaining;
+ UBool onlyChanges_, coarse;
+
+ int8_t dir; // iteration direction: back(<0), initial(0), forward(>0)
+ UBool changed;
+ int32_t oldLength_, newLength_;
+ int32_t srcIndex, replIndex, destIndex;
+ };
+
+ /**
+ * Returns an Iterator for coarse-grained change edits
+ * (adjacent change edits are treated as one).
+ * Can be used to perform simple string updates.
+ * Skips no-change edits.
+ * @return an Iterator that merges adjacent changes.
+ * @stable ICU 59
+ */
+ Iterator getCoarseChangesIterator() const {
+ return Iterator(array, length, true, true);
+ }
+
+ /**
+ * Returns an Iterator for coarse-grained change and no-change edits
+ * (adjacent change edits are treated as one).
+ * Can be used to perform simple string updates.
+ * Adjacent change edits are treated as one edit.
+ * @return an Iterator that merges adjacent changes.
+ * @stable ICU 59
+ */
+ Iterator getCoarseIterator() const {
+ return Iterator(array, length, false, true);
+ }
+
+ /**
+ * Returns an Iterator for fine-grained change edits
+ * (full granularity of change edits is retained).
+ * Can be used for modifying styled text.
+ * Skips no-change edits.
+ * @return an Iterator that separates adjacent changes.
+ * @stable ICU 59
+ */
+ Iterator getFineChangesIterator() const {
+ return Iterator(array, length, true, false);
+ }
+
+ /**
+ * Returns an Iterator for fine-grained change and no-change edits
+ * (full granularity of change edits is retained).
+ * Can be used for modifying styled text.
+ * @return an Iterator that separates adjacent changes.
+ * @stable ICU 59
+ */
+ Iterator getFineIterator() const {
+ return Iterator(array, length, false, false);
+ }
+
+ /**
+ * Merges the two input Edits and appends the result to this object.
+ *
+ * Consider two string transformations (for example, normalization and case mapping)
+ * where each records Edits in addition to writing an output string.
+ * Edits ab reflect how substrings of input string a
+ * map to substrings of intermediate string b.
+ * Edits bc reflect how substrings of intermediate string b
+ * map to substrings of output string c.
+ * This function merges ab and bc such that the additional edits
+ * recorded in this object reflect how substrings of input string a
+ * map to substrings of output string c.
+ *
+ * If unrelated Edits are passed in where the output string of the first
+ * has a different length than the input string of the second,
+ * then a U_ILLEGAL_ARGUMENT_ERROR is reported.
+ *
+ * @param ab reflects how substrings of input string a
+ * map to substrings of intermediate string b.
+ * @param bc reflects how substrings of intermediate string b
+ * map to substrings of output string c.
+ * @param errorCode ICU error code. Its input value must pass the U_SUCCESS() test,
+ * or else the function returns immediately. Check for U_FAILURE()
+ * on output or use with function chaining. (See User Guide for details.)
+ * @return *this, with the merged edits appended
+ * @stable ICU 60
+ */
+ Edits &mergeAndAppend(const Edits &ab, const Edits &bc, UErrorCode &errorCode);
+
+private:
+ void releaseArray() noexcept;
+ Edits ©Array(const Edits &other);
+ Edits &moveArray(Edits &src) noexcept;
+
+ void setLastUnit(int32_t last) { array[length - 1] = static_castFieldPosition
is a simple class used by Format
+ * and its subclasses to identify fields in formatted output. Fields are
+ * identified by constants, whose names typically end with _FIELD
,
+ * defined in the various subclasses of Format
. See
+ * ERA_FIELD
and its friends in DateFormat
for
+ * an example.
+ *
+ * FieldPosition
keeps track of the position of the
+ * field within the formatted output with two indices: the index
+ * of the first character of the field and the index of the last
+ * character of the field.
+ *
+ * format
method in the various
+ * Format
classes requires a FieldPosition
+ * object as an argument. You use this format
method
+ * to perform partial formatting or to get information about the
+ * formatted output (such as the position of a field).
+ *
+ * The FieldPosition class is not intended for public subclassing.
+ *
+ * FieldPosition
to aid
+ * alignment of an array of formatted floating-point numbers on
+ * their decimal points:
+ *
+ * \code
+ * double doubleNum[] = {123456789.0, -12345678.9, 1234567.89, -123456.789,
+ * 12345.6789, -1234.56789, 123.456789, -12.3456789, 1.23456789};
+ * int dNumSize = (int)(sizeof(doubleNum)/sizeof(double));
+ *
+ * UErrorCode status = U_ZERO_ERROR;
+ * DecimalFormat* fmt = (DecimalFormat*) NumberFormat::createInstance(status);
+ * fmt->setDecimalSeparatorAlwaysShown(true);
+ *
+ * const int tempLen = 20;
+ * char temp[tempLen];
+ *
+ * for (int i=0; i
+ * \code
+ * 123,456,789.000
+ * -12,345,678.900
+ * 1,234,567.880
+ * -123,456.789
+ * 12,345.678
+ * -1,234.567
+ * 123.456
+ * -12.345
+ * 1.234
+ * \endcode
+ *
+ */
+class U_I18N_API FieldPosition : public UObject {
+public:
+ /**
+ * DONT_CARE may be specified as the field to indicate that the
+ * caller doesn't need to specify a field.
+ * @stable ICU 2.0
+ */
+ enum { DONT_CARE = -1 };
+
+ /**
+ * Creates a FieldPosition object with a non-specified field.
+ * @stable ICU 2.0
+ */
+ FieldPosition()
+ : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
+
+ /**
+ * Creates a FieldPosition object for the given field. Fields are
+ * identified by constants, whose names typically end with _FIELD,
+ * in the various subclasses of Format.
+ *
+ * @see NumberFormat#INTEGER_FIELD
+ * @see NumberFormat#FRACTION_FIELD
+ * @see DateFormat#YEAR_FIELD
+ * @see DateFormat#MONTH_FIELD
+ * @stable ICU 2.0
+ */
+ FieldPosition(int32_t field)
+ : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {}
+
+ /**
+ * Copy constructor
+ * @param copy the object to be copied from.
+ * @stable ICU 2.0
+ */
+ FieldPosition(const FieldPosition& copy)
+ : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
+
+ /**
+ * Destructor
+ * @stable ICU 2.0
+ */
+ virtual ~FieldPosition();
+
+ /**
+ * Assignment operator
+ * @param copy the object to be copied from.
+ * @stable ICU 2.0
+ */
+ FieldPosition& operator=(const FieldPosition& copy);
+
+ /**
+ * Equality operator.
+ * @param that the object to be compared with.
+ * @return true if the two field positions are equal, false otherwise.
+ * @stable ICU 2.0
+ */
+ bool operator==(const FieldPosition& that) const;
+
+ /**
+ * Equality operator.
+ * @param that the object to be compared with.
+ * @return true if the two field positions are not equal, false otherwise.
+ * @stable ICU 2.0
+ */
+ bool operator!=(const FieldPosition& that) const;
+
+ /**
+ * Clone this object.
+ * Clones can be used concurrently in multiple threads.
+ * If an error occurs, then nullptr is returned.
+ * The caller must delete the clone.
+ *
+ * @return a clone of this object
+ *
+ * @see getDynamicClassID
+ * @stable ICU 2.8
+ */
+ FieldPosition *clone() const;
+
+ /**
+ * Retrieve the field identifier.
+ * @return the field identifier.
+ * @stable ICU 2.0
+ */
+ int32_t getField() const { return fField; }
+
+ /**
+ * Retrieve the index of the first character in the requested field.
+ * @return the index of the first character in the requested field.
+ * @stable ICU 2.0
+ */
+ int32_t getBeginIndex() const { return fBeginIndex; }
+
+ /**
+ * Retrieve the index of the character following the last character in the
+ * requested field.
+ * @return the index of the character following the last character in the
+ * requested field.
+ * @stable ICU 2.0
+ */
+ int32_t getEndIndex() const { return fEndIndex; }
+
+ /**
+ * Set the field.
+ * @param f the new value of the field.
+ * @stable ICU 2.0
+ */
+ void setField(int32_t f) { fField = f; }
+
+ /**
+ * Set the begin index. For use by subclasses of Format.
+ * @param bi the new value of the begin index
+ * @stable ICU 2.0
+ */
+ void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
+
+ /**
+ * Set the end index. For use by subclasses of Format.
+ * @param ei the new value of the end index
+ * @stable ICU 2.0
+ */
+ void setEndIndex(int32_t ei) { fEndIndex = ei; }
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for the actual class.
+ *
+ * @stable ICU 2.2
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * ICU "poor man's RTTI", returns a UClassID for this class.
+ *
+ * @stable ICU 2.2
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+private:
+ /**
+ * Input: Desired field to determine start and end offsets for.
+ * The meaning depends on the subclass of Format.
+ */
+ int32_t fField;
+
+ /**
+ * Output: Start offset of field in text.
+ * If the field does not occur in the text, 0 is returned.
+ */
+ int32_t fBeginIndex;
+
+ /**
+ * Output: End offset of field in text.
+ * If the field does not occur in the text, 0 is returned.
+ */
+ int32_t fEndIndex;
+};
+
+inline FieldPosition&
+FieldPosition::operator=(const FieldPosition& copy)
+{
+ fField = copy.fField;
+ fEndIndex = copy.fEndIndex;
+ fBeginIndex = copy.fBeginIndex;
+ return *this;
+}
+
+inline bool
+FieldPosition::operator==(const FieldPosition& copy) const
+{
+ return (fField == copy.fField &&
+ fEndIndex == copy.fEndIndex &&
+ fBeginIndex == copy.fBeginIndex);
+}
+
+inline bool
+FieldPosition::operator!=(const FieldPosition& copy) const
+{
+ return !operator==(copy);
+}
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _FIELDPOS
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/filteredbrk.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/filteredbrk.h
new file mode 100644
index 0000000000..8b07e39ae1
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/filteredbrk.h
@@ -0,0 +1,152 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+********************************************************************************
+* Copyright (C) 1997-2015, International Business Machines
+* Corporation and others. All Rights Reserved.
+********************************************************************************
+*/
+
+#ifndef FILTEREDBRK_H
+#define FILTEREDBRK_H
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#include "unicode/brkiter.h"
+
+#if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \file
+ * \brief C++ API: FilteredBreakIteratorBuilder
+ */
+
+/**
+ * The BreakIteratorFilter is used to modify the behavior of a BreakIterator
+ * by constructing a new BreakIterator which suppresses certain segment boundaries.
+ * See http://www.unicode.org/reports/tr35/tr35-general.html#Segmentation_Exceptions .
+ * For example, a typical English Sentence Break Iterator would break on the space
+ * in the string "Mr. Smith" (resulting in two segments),
+ * but with "Mr." as an exception, a filtered break iterator
+ * would consider the string "Mr. Smith" to be a single segment.
+ *
+ * @stable ICU 56
+ */
+class U_COMMON_API FilteredBreakIteratorBuilder : public UObject {
+ public:
+ /**
+ * destructor.
+ * @stable ICU 56
+ */
+ virtual ~FilteredBreakIteratorBuilder();
+
+ /**
+ * Construct a FilteredBreakIteratorBuilder based on rules in a locale.
+ * The rules are taken from CLDR exception data for the locale,
+ * see http://www.unicode.org/reports/tr35/tr35-general.html#Segmentation_Exceptions
+ * This is the equivalent of calling createInstance(UErrorCode&)
+ * and then repeatedly calling addNoBreakAfter(...) with the contents
+ * of the CLDR exception data.
+ * @param where the locale.
+ * @param status The error code.
+ * @return the new builder
+ * @stable ICU 56
+ */
+ static FilteredBreakIteratorBuilder *createInstance(const Locale& where, UErrorCode& status);
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * This function has been deprecated in favor of createEmptyInstance, which has
+ * identical behavior.
+ * @param status The error code.
+ * @return the new builder
+ * @deprecated ICU 60 use createEmptyInstance instead
+ * @see createEmptyInstance()
+ */
+ static FilteredBreakIteratorBuilder *createInstance(UErrorCode &status);
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Construct an empty FilteredBreakIteratorBuilder.
+ * In this state, it will not suppress any segment boundaries.
+ * @param status The error code.
+ * @return the new builder
+ * @stable ICU 60
+ */
+ static FilteredBreakIteratorBuilder *createEmptyInstance(UErrorCode &status);
+
+ /**
+ * Suppress a certain string from being the end of a segment.
+ * For example, suppressing "Mr.", then segments ending in "Mr." will not be returned
+ * by the iterator.
+ * @param string the string to suppress, such as "Mr."
+ * @param status error code
+ * @return returns true if the string was not present and now added,
+ * false if the call was a no-op because the string was already being suppressed.
+ * @stable ICU 56
+ */
+ virtual UBool suppressBreakAfter(const UnicodeString& string, UErrorCode& status) = 0;
+
+ /**
+ * Stop suppressing a certain string from being the end of the segment.
+ * This function does not create any new segment boundaries, but only serves to un-do
+ * the effect of earlier calls to suppressBreakAfter, or to un-do the effect of
+ * locale data which may be suppressing certain strings.
+ * @param string the exception to remove
+ * @param status error code
+ * @return returns true if the string was present and now removed,
+ * false if the call was a no-op because the string was not being suppressed.
+ * @stable ICU 56
+ */
+ virtual UBool unsuppressBreakAfter(const UnicodeString& string, UErrorCode& status) = 0;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * This function has been deprecated in favor of wrapIteratorWithFilter()
+ * The behavior is identical.
+ * @param adoptBreakIterator the break iterator to adopt
+ * @param status error code
+ * @return the new BreakIterator, owned by the caller.
+ * @deprecated ICU 60 use wrapIteratorWithFilter() instead
+ * @see wrapBreakIteratorWithFilter()
+ */
+ virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status) = 0;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * Wrap (adopt) an existing break iterator in a new filtered instance.
+ * The resulting BreakIterator is owned by the caller.
+ * The BreakIteratorFilter may be destroyed before the BreakIterator is destroyed.
+ * Note that the adoptBreakIterator is adopted by the new BreakIterator
+ * and should no longer be used by the caller.
+ * The FilteredBreakIteratorBuilder may be reused.
+ * This function is an alias for build()
+ * @param adoptBreakIterator the break iterator to adopt
+ * @param status error code
+ * @return the new BreakIterator, owned by the caller.
+ * @stable ICU 60
+ */
+ inline BreakIterator *wrapIteratorWithFilter(BreakIterator* adoptBreakIterator, UErrorCode& status) {
+ return build(adoptBreakIterator, status);
+ }
+
+ protected:
+ /**
+ * For subclass use
+ * @stable ICU 56
+ */
+ FilteredBreakIteratorBuilder();
+};
+
+
+U_NAMESPACE_END
+
+#endif // #if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // #ifndef FILTEREDBRK_H
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/fmtable.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/fmtable.h
new file mode 100644
index 0000000000..1f6b43844a
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/fmtable.h
@@ -0,0 +1,758 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+********************************************************************************
+* Copyright (C) 1997-2014, International Business Machines
+* Corporation and others. All Rights Reserved.
+********************************************************************************
+*
+* File FMTABLE.H
+*
+* Modification History:
+*
+* Date Name Description
+* 02/29/97 aliu Creation.
+********************************************************************************
+*/
+#ifndef FMTABLE_H
+#define FMTABLE_H
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+/**
+ * \file
+ * \brief C++ API: Formattable is a thin wrapper for primitive types used for formatting and parsing
+ */
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/unistr.h"
+#include "unicode/stringpiece.h"
+#include "unicode/uformattable.h"
+
+U_NAMESPACE_BEGIN
+
+class CharString;
+
+namespace number::impl {
+class DecimalQuantity;
+}
+
+/**
+ * Formattable objects can be passed to the Format class or
+ * its subclasses for formatting. Formattable is a thin wrapper
+ * class which interconverts between the primitive numeric types
+ * (double, long, etc.) as well as UDate and UnicodeString.
+ *
+ * GenderInfo
object is
+ * returned.
+ * @param status Output param set to success/failure code on exit, which
+ * must not indicate a failure before the function call.
+ * @return The predefined GenderInfo
object pointer for
+ * this locale. The returned object is immutable, so it is
+ * declared as const. Caller does not own the returned
+ * pointer, so it must not attempt to free it.
+ * @stable ICU 50
+ */
+ static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status);
+
+ /**
+ * Determines the gender of a list as a whole given the gender of each
+ * of the elements.
+ *
+ * @param genders the gender of each element in the list.
+ * @param length the length of gender array.
+ * @param status Output param set to success/failure code on exit, which
+ * must not indicate a failure before the function call.
+ * @return the gender of the whole list.
+ * @stable ICU 50
+ */
+ UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const;
+
+ /**
+ * Destructor.
+ *
+ * @stable ICU 50
+ */
+ virtual ~GenderInfo();
+
+private:
+ int32_t _style;
+
+ /**
+ * Copy constructor. One object per locale invariant. Clients
+ * must never copy GenderInfo objects.
+ */
+ GenderInfo(const GenderInfo& other) = delete;
+
+ /**
+ * Assignment operator. Not applicable to immutable objects.
+ */
+ GenderInfo& operator=(const GenderInfo&) = delete;
+
+ GenderInfo();
+
+ static const GenderInfo* getNeutralInstance();
+
+ static const GenderInfo* getMixedNeutralInstance();
+
+ static const GenderInfo* getMaleTaintsInstance();
+
+ static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status);
+
+ friend class ::GenderInfoTest;
+ friend void U_CALLCONV GenderInfo_initCache(UErrorCode &status);
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // _GENDER
+//eof
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/gregocal.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/gregocal.h
new file mode 100644
index 0000000000..cd84471c9b
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/gregocal.h
@@ -0,0 +1,737 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+* Copyright (C) 1997-2013, International Business Machines Corporation and others.
+* All Rights Reserved.
+********************************************************************************
+*
+* File GREGOCAL.H
+*
+* Modification History:
+*
+* Date Name Description
+* 04/22/97 aliu Overhauled header.
+* 07/28/98 stephen Sync with JDK 1.2
+* 09/04/98 stephen Re-sync with JDK 8/31 putback
+* 09/14/98 stephen Changed type of kOneDay, kOneWeek to double.
+* Fixed bug in roll()
+* 10/15/99 aliu Fixed j31, incorrect WEEK_OF_YEAR computation.
+* Added documentation of WEEK_OF_YEAR computation.
+* 10/15/99 aliu Fixed j32, cannot set date to Feb 29 2000 AD.
+* {JDK bug 4210209 4209272}
+* 11/07/2003 srl Update, clean up documentation.
+********************************************************************************
+*/
+
+#ifndef GREGOCAL_H
+#define GREGOCAL_H
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/calendar.h"
+
+/**
+ * \file
+ * \brief C++ API: Concrete class which provides the standard calendar.
+ */
+
+U_NAMESPACE_BEGIN
+
+/**
+ * Concrete class which provides the standard calendar used by most of the world.
+ * WEEK_OF_YEAR
field range from 1 to
+ * 53. Week 1 for a year is the first week that contains at least
+ * getMinimalDaysInFirstWeek()
days from that year. It thus
+ * depends on the values of getMinimalDaysInFirstWeek()
,
+ * getFirstDayOfWeek()
, and the day of the week of January 1.
+ * Weeks between week 1 of one year and week 1 of the following year are
+ * numbered sequentially from 2 to 52 or 53 (as needed).
+ *
+ * getFirstDayOfWeek()
is MONDAY
and
+ * getMinimalDaysInFirstWeek()
is 4 (these are the values
+ * reflecting ISO 8601 and many national standards), then week 1 of 1998 starts
+ * on December 29, 1997, and ends on January 4, 1998. If, however,
+ * getFirstDayOfWeek()
is SUNDAY
, then week 1 of 1998
+ * starts on January 4, 1998, and ends on January 10, 1998; the first three days
+ * of 1998 then are part of week 53 of 1997.
+ *
+ *
+ * \code
+ * // get the supported ids for GMT-08:00 (Pacific Standard Time)
+ * UErrorCode success = U_ZERO_ERROR;
+ * const StringEnumeration *ids = TimeZone::createEnumeration(-8 * 60 * 60 * 1000, success);
+ * // if no ids were returned, something is wrong. get out.
+ * if (U_FAILURE(success)) {
+ * return;
+ * }
+ *
+ * // begin output
+ * cout << "Current Time" << endl;
+ *
+ * // create a Pacific Standard Time time zone
+ * SimpleTimeZone* pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids->unext(nullptr, success)));
+ *
+ * // set up rules for daylight savings time
+ * pdt->setStartRule(UCAL_MARCH, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000);
+ * pdt->setEndRule(UCAL_NOVEMBER, 2, UCAL_SUNDAY, 2 * 60 * 60 * 1000);
+ *
+ * // create a GregorianCalendar with the Pacific Daylight time zone
+ * // and the current date and time
+ * Calendar* calendar = new GregorianCalendar( pdt, success );
+ *
+ * // print out a bunch of interesting things
+ * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl;
+ * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl;
+ * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl;
+ * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, success ) << endl;
+ * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, success ) << endl;
+ * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl;
+ * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, success ) << endl;
+ * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success ) << endl;
+ * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success ) << endl;
+ * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_IN_MONTH, success ) << endl;
+ * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl;
+ * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl;
+ * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success ) << endl;
+ * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl;
+ * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl;
+ * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success ) << endl;
+ * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success )/(60*60*1000)) << endl;
+ * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success )/(60*60*1000)) << endl;
+ *
+ * cout << "Current Time, with hour reset to 3" << endl;
+ * calendar->clear(UCAL_HOUR_OF_DAY); // so doesn't override
+ * calendar->set(UCAL_HOUR, 3);
+ * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl;
+ * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl;
+ * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl;
+ * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, success ) << endl;
+ * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, success ) << endl;
+ * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl;
+ * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, success ) << endl;
+ * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success ) << endl;
+ * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success ) << endl;
+ * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_IN_MONTH, success ) << endl;
+ * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl;
+ * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl;
+ * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success ) << endl;
+ * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl;
+ * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl;
+ * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success ) << endl;
+ * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success )/(60*60*1000)) << endl; // in hours
+ * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success )/(60*60*1000)) << endl; // in hours
+ *
+ * if (U_FAILURE(success)) {
+ * cout << "An error occurred. success=" << u_errorName(success) << endl;
+ * }
+ *
+ * delete ids;
+ * delete calendar; // also deletes pdt
+ * \endcode
+ *
+ * @stable ICU 2.0
+ */
+class U_I18N_API GregorianCalendar: public Calendar {
+public:
+
+ /**
+ * Useful constants for GregorianCalendar and TimeZone.
+ * @stable ICU 2.0
+ */
+ enum EEras {
+ BC,
+ AD
+ };
+
+ /**
+ * Constructs a default GregorianCalendar using the current time in the default time
+ * zone with the default locale.
+ *
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar based on the current time in the given time zone
+ * with the default locale. Clients are no longer responsible for deleting the given
+ * time zone object after it's adopted.
+ *
+ * @param zoneToAdopt The given timezone.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(TimeZone* zoneToAdopt, UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar based on the current time in the given time zone
+ * with the default locale.
+ *
+ * @param zone The given timezone.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(const TimeZone& zone, UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar based on the current time in the default time zone
+ * with the given locale.
+ *
+ * @param aLocale The given locale.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar based on the current time in the given time zone
+ * with the given locale. Clients are no longer responsible for deleting the given
+ * time zone object after it's adopted.
+ *
+ * @param zoneToAdopt The given timezone.
+ * @param aLocale The given locale.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar based on the current time in the given time zone
+ * with the given locale.
+ *
+ * @param zone The given timezone.
+ * @param aLocale The given locale.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar with the given AD date set in the default time
+ * zone with the default locale.
+ *
+ * @param year The value used to set the YEAR time field in the calendar.
+ * @param month The value used to set the MONTH time field in the calendar. Month
+ * value is 0-based. e.g., 0 for January.
+ * @param date The value used to set the DATE time field in the calendar.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(int32_t year, int32_t month, int32_t date, UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar with the given AD date and time set for the
+ * default time zone with the default locale.
+ *
+ * @param year The value used to set the YEAR time field in the calendar.
+ * @param month The value used to set the MONTH time field in the calendar. Month
+ * value is 0-based. e.g., 0 for January.
+ * @param date The value used to set the DATE time field in the calendar.
+ * @param hour The value used to set the HOUR_OF_DAY time field in the calendar.
+ * @param minute The value used to set the MINUTE time field in the calendar.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, UErrorCode& success);
+
+ /**
+ * Constructs a GregorianCalendar with the given AD date and time set for the
+ * default time zone with the default locale.
+ *
+ * @param year The value used to set the YEAR time field in the calendar.
+ * @param month The value used to set the MONTH time field in the calendar. Month
+ * value is 0-based. e.g., 0 for January.
+ * @param date The value used to set the DATE time field in the calendar.
+ * @param hour The value used to set the HOUR_OF_DAY time field in the calendar.
+ * @param minute The value used to set the MINUTE time field in the calendar.
+ * @param second The value used to set the SECOND time field in the calendar.
+ * @param success Indicates the status of GregorianCalendar object construction.
+ * Returns U_ZERO_ERROR if constructed successfully.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode& success);
+
+ /**
+ * Destructor
+ * @stable ICU 2.0
+ */
+ virtual ~GregorianCalendar();
+
+ /**
+ * Copy constructor
+ * @param source the object to be copied.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar(const GregorianCalendar& source);
+
+ /**
+ * Default assignment operator
+ * @param right the object to be copied.
+ * @stable ICU 2.0
+ */
+ GregorianCalendar& operator=(const GregorianCalendar& right);
+
+ /**
+ * Create and return a polymorphic copy of this calendar.
+ * @return return a polymorphic copy of this calendar.
+ * @stable ICU 2.0
+ */
+ virtual GregorianCalendar* clone() const override;
+
+ /**
+ * Sets the GregorianCalendar change date. This is the point when the switch from
+ * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October
+ * 15, 1582. Previous to this time and date will be Julian dates.
+ *
+ * @param date The given Gregorian cutover date.
+ * @param success Output param set to success/failure code on exit.
+ * @stable ICU 2.0
+ */
+ void setGregorianChange(UDate date, UErrorCode& success);
+
+ /**
+ * Gets the Gregorian Calendar change date. This is the point when the switch from
+ * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October
+ * 15, 1582. Previous to this time and date will be Julian dates.
+ *
+ * @return The Gregorian cutover time for this calendar.
+ * @stable ICU 2.0
+ */
+ UDate getGregorianChange() const;
+
+ /**
+ * Return true if the given year is a leap year. Determination of whether a year is
+ * a leap year is actually very complicated. We do something crude and mostly
+ * correct here, but for a real determination you need a lot of contextual
+ * information. For example, in Sweden, the change from Julian to Gregorian happened
+ * in a complex way resulting in missed leap years and double leap years between
+ * 1700 and 1753. Another example is that after the start of the Julian calendar in
+ * 45 B.C., the leap years did not regularize until 8 A.D. This method ignores these
+ * quirks, and pays attention only to the Julian onset date and the Gregorian
+ * cutover (which can be changed).
+ *
+ * @param year The given year.
+ * @return True if the given year is a leap year; false otherwise.
+ * @stable ICU 2.0
+ */
+ UBool isLeapYear(int32_t year) const;
+
+ /**
+ * Returns true if the given Calendar object is equivalent to this
+ * one. Calendar override.
+ *
+ * @param other the Calendar to be compared with this Calendar
+ * @stable ICU 2.4
+ */
+ virtual UBool isEquivalentTo(const Calendar& other) const override;
+
+#ifndef U_FORCE_HIDE_DEPRECATED_API
+ /**
+ * (Overrides Calendar) Rolls up or down by the given amount in the specified field.
+ * For more information, see the documentation for Calendar::roll().
+ *
+ * @param field The time field.
+ * @param amount Indicates amount to roll.
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid, this will be set to
+ * an error status.
+ * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead.
+ */
+ virtual void roll(EDateFields field, int32_t amount, UErrorCode& status) override;
+#endif // U_FORCE_HIDE_DEPRECATED_API
+
+ /**
+ * (Overrides Calendar) Rolls up or down by the given amount in the specified field.
+ * For more information, see the documentation for Calendar::roll().
+ *
+ * @param field The time field.
+ * @param amount Indicates amount to roll.
+ * @param status Output param set to success/failure code on exit. If any value
+ * previously set in the time field is invalid, this will be set to
+ * an error status.
+ * @stable ICU 2.6.
+ */
+ virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) override;
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Return the minimum value that this field could have, given the current date.
+ * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
+ * @param field the time field.
+ * @return the minimum value that this field could have, given the current date.
+ * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field) instead.
+ */
+ int32_t getActualMinimum(EDateFields field) const;
+
+ /**
+ * Return the minimum value that this field could have, given the current date.
+ * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
+ * @param field the time field.
+ * @param status
+ * @return the minimum value that this field could have, given the current date.
+ * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field) instead. (Added to ICU 3.0 for signature consistency)
+ */
+ int32_t getActualMinimum(EDateFields field, UErrorCode& status) const;
+#endif /* U_HIDE_DEPRECATED_API */
+
+ /**
+ * Return the minimum value that this field could have, given the current date.
+ * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
+ * @param field the time field.
+ * @param status error result.
+ * @return the minimum value that this field could have, given the current date.
+ * @stable ICU 3.0
+ */
+ int32_t getActualMinimum(UCalendarDateFields field, UErrorCode &status) const override;
+
+ /**
+ * Return the maximum value that this field could have, given the current date.
+ * For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual
+ * maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar,
+ * for some years the actual maximum for MONTH is 12, and for others 13.
+ * @param field the time field.
+ * @param status returns any errors that may result from this function call.
+ * @return the maximum value that this field could have, given the current date.
+ * @stable ICU 2.6
+ */
+ virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const override;
+
+public:
+
+ /**
+ * Override Calendar Returns a unique class ID POLYMORPHICALLY. Pure virtual
+ * override. This method is to implement a simple version of RTTI, since not all C++
+ * compilers support genuine RTTI. Polymorphic operator==() and clone() methods call
+ * this method.
+ *
+ * @return The class ID for this object. All objects of a given class have the
+ * same class ID. Objects of other classes have different class IDs.
+ * @stable ICU 2.0
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ /**
+ * Return the class ID for this class. This is useful only for comparing to a return
+ * value from getDynamicClassID(). For example:
+ *
+ * Base* polymorphic_pointer = createPolymorphicObject();
+ * if (polymorphic_pointer->getDynamicClassID() ==
+ * Derived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 2.0
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns the calendar type name string for this Calendar object.
+ * The returned string is the legacy ICU calendar attribute value,
+ * for example, "gregorian" or "japanese".
+ *
+ * For more details see the Calendar::getType() documentation.
+ *
+ * @return legacy calendar type name string
+ * @stable ICU 49
+ */
+ virtual const char * getType() const override;
+
+ private:
+ GregorianCalendar() = delete; // default constructor not implemented
+
+ protected:
+ /**
+ * Return the ERA. We need a special method for this because the
+ * default ERA is AD, but a zero (unset) ERA is BC.
+ * @return the ERA.
+ * @internal
+ */
+ virtual int32_t internalGetEra() const;
+
+ /**
+ * Return the Julian day number of day before the first day of the
+ * given month in the given extended year. Subclasses should override
+ * this method to implement their calendar system.
+ * @param eyear the extended year
+ * @param month the zero-based month, or 0 if useMonth is false
+ * @param useMonth if false, compute the day before the first day of
+ * the given year, otherwise, compute the day before the first day of
+ * the given month
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return the Julian day number of the day before the first
+ * day of the given month and year
+ * @internal
+ */
+ virtual int64_t handleComputeMonthStart(int32_t eyear, int32_t month,
+ UBool useMonth, UErrorCode& status) const override;
+
+ /**
+ * Subclasses may override this. This method calls
+ * handleGetMonthLength() to obtain the calendar-specific month
+ * length.
+ * @param bestField which field to use to calculate the date
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return julian day specified by calendar fields.
+ * @internal
+ */
+ virtual int32_t handleComputeJulianDay(UCalendarDateFields bestField, UErrorCode& status) override;
+
+ /**
+ * Return the number of days in the given month of the given extended
+ * year of this calendar system. Subclasses should override this
+ * method if they can provide a more correct or more efficient
+ * implementation than the default implementation in Calendar.
+ * @internal
+ */
+ virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month, UErrorCode& status) const override;
+
+ /**
+ * Return the number of days in the given extended year of this
+ * calendar system. Subclasses should override this method if they can
+ * provide a more correct or more efficient implementation than the
+ * default implementation in Calendar.
+ * @stable ICU 2.0
+ */
+ virtual int32_t handleGetYearLength(int32_t eyear, UErrorCode& status) const override;
+
+ /**
+ * return the length of the given month.
+ * @param month the given month.
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return the length of the given month.
+ * @internal
+ */
+ virtual int32_t monthLength(int32_t month, UErrorCode& status) const;
+
+ /**
+ * return the length of the month according to the given year.
+ * @param month the given month.
+ * @param year the given year.
+ * @return the length of the month
+ * @internal
+ */
+ virtual int32_t monthLength(int32_t month, int32_t year) const;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * return the length of the year field.
+ * @return the length of the year field
+ * @internal
+ */
+ int32_t yearLength() const;
+
+#endif /* U_HIDE_INTERNAL_API */
+
+ /**
+ * Return the day number with respect to the epoch. January 1, 1970 (Gregorian)
+ * is day zero.
+ * @param status Fill-in parameter which receives the status of this operation.
+ * @return the day number with respect to the epoch.
+ * @internal
+ */
+ virtual UDate getEpochDay(UErrorCode& status);
+
+ /**
+ * Subclass API for defining limits of different types.
+ * Subclasses must implement this method to return limits for the
+ * following fields:
+ *
+ * UCAL_ERA
+ * UCAL_YEAR
+ * UCAL_MONTH
+ * UCAL_WEEK_OF_YEAR
+ * UCAL_WEEK_OF_MONTH
+ * UCAL_DATE (DAY_OF_MONTH on Java)
+ * UCAL_DAY_OF_YEAR
+ * UCAL_DAY_OF_WEEK_IN_MONTH
+ * UCAL_YEAR_WOY
+ * UCAL_EXTENDED_YEAR
+ *
+ * @param field one of the above field numbers
+ * @param limitType one of MINIMUM
, GREATEST_MINIMUM
,
+ * LEAST_MAXIMUM
, or MAXIMUM
+ * @internal
+ */
+ virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override;
+
+ /**
+ * Return the extended year defined by the current fields. This will
+ * use the UCAL_EXTENDED_YEAR field or the UCAL_YEAR and supra-year fields (such
+ * as UCAL_ERA) specific to the calendar system, depending on which set of
+ * fields is newer.
+ * @param status
+ * @return the extended year
+ * @internal
+ */
+ virtual int32_t handleGetExtendedYear(UErrorCode& status) override;
+
+ /**
+ * Subclasses may override this to convert from week fields
+ * (YEAR_WOY and WEEK_OF_YEAR) to an extended year in the case
+ * where YEAR, EXTENDED_YEAR are not set.
+ * The Gregorian implementation assumes a yearWoy in gregorian format, according to the current era.
+ * @return the extended year, UCAL_EXTENDED_YEAR
+ * @internal
+ */
+ virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy, UErrorCode& status) override;
+
+
+ /**
+ * Subclasses may override this method to compute several fields
+ * specific to each calendar system. These are:
+ *
+ *
+ *
+ * C API: ICU Plugin API
+ *
+ * Loading and Configuration
+ *
+ *
+ *
+ *
+ * Implementing a Plugin
+ * \code
+ * U_CAPI UPlugTokenReturn U_EXPORT2
+ * myPlugin (UPlugData *plug, UPlugReason reason, UErrorCode *status) {
+ * if(reason==UPLUG_REASON_QUERY) {
+ * uplug_setPlugName(plug, "Simple Plugin");
+ * uplug_setPlugLevel(plug, UPLUG_LEVEL_HIGH);
+ * } else if(reason==UPLUG_REASON_LOAD) {
+ * ... Set up some ICU things here....
+ * } else if(reason==UPLUG_REASON_UNLOAD) {
+ * ... unload, clean up ...
+ * }
+ * return UPLUG_TOKEN;
+ * }
+ * \endcode
+ *
+ *
+ *
+ *
+ * \internal ICU 4.4 Technology Preview
+ */
+
+
+#ifndef ICUPLUG_H
+#define ICUPLUG_H
+
+#include "unicode/utypes.h"
+
+
+#if UCONFIG_ENABLE_PLUGINS || defined(U_IN_DOXYGEN)
+
+
+
+/* === Basic types === */
+
+#ifndef U_HIDE_INTERNAL_API
+struct UPlugData;
+/**
+ * @{
+ * Typedef for opaque structure passed to/from a plugin.
+ * Use the APIs to access it.
+ * @internal ICU 4.4 Technology Preview
+ */
+typedef struct UPlugData UPlugData;
+
+/** @} */
+
+/**
+ * Random Token to identify a valid ICU plugin. Plugins must return this
+ * from the entrypoint.
+ * @internal ICU 4.4 Technology Preview
+ */
+#define UPLUG_TOKEN 0x54762486
+
+/**
+ * Max width of names, symbols, and configuration strings
+ * @internal ICU 4.4 Technology Preview
+ */
+#define UPLUG_NAME_MAX 100
+
+
+/**
+ * Return value from a plugin entrypoint.
+ * Must always be set to UPLUG_TOKEN
+ * @see UPLUG_TOKEN
+ * @internal ICU 4.4 Technology Preview
+ */
+typedef uint32_t UPlugTokenReturn;
+
+/**
+ * Reason code for the entrypoint's call
+ * @internal ICU 4.4 Technology Preview
+ */
+typedef enum {
+ UPLUG_REASON_QUERY = 0, /**< The plugin is being queried for info. **/
+ UPLUG_REASON_LOAD = 1, /**< The plugin is being loaded. **/
+ UPLUG_REASON_UNLOAD = 2, /**< The plugin is being unloaded. **/
+ /**
+ * Number of known reasons.
+ * @internal The numeric value may change over time, see ICU ticket #12420.
+ */
+ UPLUG_REASON_COUNT
+} UPlugReason;
+
+
+/**
+ * Level of plugin loading
+ * INITIAL: UNKNOWN
+ * QUERY: INVALID -> { LOW | HIGH }
+ * ERR -> INVALID
+ * @internal ICU 4.4 Technology Preview
+ */
+typedef enum {
+ UPLUG_LEVEL_INVALID = 0, /**< The plugin is invalid, hasn't called uplug_setLevel, or can't load. **/
+ UPLUG_LEVEL_UNKNOWN = 1, /**< The plugin is waiting to be installed. **/
+ UPLUG_LEVEL_LOW = 2, /**< The plugin must be called before u_init completes **/
+ UPLUG_LEVEL_HIGH = 3, /**< The plugin can run at any time. **/
+ /**
+ * Number of known levels.
+ * @internal The numeric value may change over time, see ICU ticket #12420.
+ */
+ UPLUG_LEVEL_COUNT
+} UPlugLevel;
+
+/**
+ * Entrypoint for an ICU plugin.
+ * @param plug the UPlugData handle.
+ * @param reason the reason code for the entrypoint's call.
+ * @param status Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return A valid plugin must return UPLUG_TOKEN
+ * @internal ICU 4.4 Technology Preview
+ */
+typedef UPlugTokenReturn (U_EXPORT2 UPlugEntrypoint) (
+ UPlugData *plug,
+ UPlugReason reason,
+ UErrorCode *status);
+
+/* === Needed for Implementing === */
+
+/**
+ * Request that this plugin not be unloaded at cleanup time.
+ * This is appropriate for plugins which cannot be cleaned up.
+ * @see u_cleanup()
+ * @param plug plugin
+ * @param dontUnload set true if this plugin can't be unloaded
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI void U_EXPORT2
+uplug_setPlugNoUnload(UPlugData *plug, UBool dontUnload);
+
+/**
+ * Set the level of this plugin.
+ * @param plug plugin data handle
+ * @param level the level of this plugin
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI void U_EXPORT2
+uplug_setPlugLevel(UPlugData *plug, UPlugLevel level);
+
+/**
+ * Get the level of this plugin.
+ * @param plug plugin data handle
+ * @return the level of this plugin
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI UPlugLevel U_EXPORT2
+uplug_getPlugLevel(UPlugData *plug);
+
+/**
+ * Get the lowest level of plug which can currently load.
+ * For example, if UPLUG_LEVEL_LOW is returned, then low level plugins may load
+ * if UPLUG_LEVEL_HIGH is returned, then only high level plugins may load.
+ * @return the lowest level of plug which can currently load
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI UPlugLevel U_EXPORT2
+uplug_getCurrentLevel(void);
+
+
+/**
+ * Get plug load status
+ * @return The error code of this plugin's load attempt.
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI UErrorCode U_EXPORT2
+uplug_getPlugLoadStatus(UPlugData *plug);
+
+/**
+ * Set the human-readable name of this plugin.
+ * @param plug plugin data handle
+ * @param name the name of this plugin. The first UPLUG_NAME_MAX characters willi be copied into a new buffer.
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI void U_EXPORT2
+uplug_setPlugName(UPlugData *plug, const char *name);
+
+/**
+ * Get the human-readable name of this plugin.
+ * @param plug plugin data handle
+ * @return the name of this plugin
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI const char * U_EXPORT2
+uplug_getPlugName(UPlugData *plug);
+
+/**
+ * Return the symbol name for this plugin, if known.
+ * @param plug plugin data handle
+ * @return the symbol name, or NULL
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI const char * U_EXPORT2
+uplug_getSymbolName(UPlugData *plug);
+
+/**
+ * Return the library name for this plugin, if known.
+ * @param plug plugin data handle
+ * @param status error code
+ * @return the library name, or NULL
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI const char * U_EXPORT2
+uplug_getLibraryName(UPlugData *plug, UErrorCode *status);
+
+/**
+ * Return the library used for this plugin, if known.
+ * Plugins could use this to load data out of their
+ * @param plug plugin data handle
+ * @return the library, or NULL
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI void * U_EXPORT2
+uplug_getLibrary(UPlugData *plug);
+
+/**
+ * Return the plugin-specific context data.
+ * @param plug plugin data handle
+ * @return the context, or NULL if not set
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI void * U_EXPORT2
+uplug_getContext(UPlugData *plug);
+
+/**
+ * Set the plugin-specific context data.
+ * @param plug plugin data handle
+ * @param context new context to set
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI void U_EXPORT2
+uplug_setContext(UPlugData *plug, void *context);
+
+
+/**
+ * Get the configuration string, if available.
+ * The string is in the platform default codepage.
+ * @param plug plugin data handle
+ * @return configuration string, or else null.
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI const char * U_EXPORT2
+uplug_getConfiguration(UPlugData *plug);
+
+/**
+ * Return all currently installed plugins, from newest to oldest
+ * Usage Example:
+ * \code
+ * UPlugData *plug = NULL;
+ * while(plug=uplug_nextPlug(plug)) {
+ * ... do something with 'plug' ...
+ * }
+ * \endcode
+ * Not thread safe- do not call while plugs are added or removed.
+ * @param prior pass in 'NULL' to get the first (most recent) plug,
+ * otherwise pass the value returned on a prior call to uplug_nextPlug
+ * @return the next oldest plugin, or NULL if no more.
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI UPlugData* U_EXPORT2
+uplug_nextPlug(UPlugData *prior);
+
+/**
+ * Inject a plugin as if it were loaded from a library.
+ * This is useful for testing plugins.
+ * Note that it will have a 'NULL' library pointer associated
+ * with it, and therefore no llibrary will be closed at cleanup time.
+ * Low level plugins may not be able to load, as ordering can't be enforced.
+ * @param entrypoint entrypoint to install
+ * @param config user specified configuration string, if available, or NULL.
+ * @param status error result
+ * @return the new UPlugData associated with this plugin, or NULL if error.
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI UPlugData* U_EXPORT2
+uplug_loadPlugFromEntrypoint(UPlugEntrypoint *entrypoint, const char *config, UErrorCode *status);
+
+
+/**
+ * Inject a plugin from a library, as if the information came from a config file.
+ * Low level plugins may not be able to load, and ordering can't be enforced.
+ * @param libName DLL name to load
+ * @param sym symbol of plugin (UPlugEntrypoint function)
+ * @param config configuration string, or NULL
+ * @param status error result
+ * @return the new UPlugData associated with this plugin, or NULL if error.
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI UPlugData* U_EXPORT2
+uplug_loadPlugFromLibrary(const char *libName, const char *sym, const char *config, UErrorCode *status);
+
+/**
+ * Remove a plugin.
+ * Will request the plugin to be unloaded, and close the library if needed
+ * @param plug plugin handle to close
+ * @param status error result
+ * @internal ICU 4.4 Technology Preview
+ */
+U_CAPI void U_EXPORT2
+uplug_removePlug(UPlugData *plug, UErrorCode *status);
+#endif /* U_HIDE_INTERNAL_API */
+
+#endif /* UCONFIG_ENABLE_PLUGINS */
+
+#endif /* _ICUPLUG */
+
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/idna.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/idna.h
new file mode 100644
index 0000000000..1e36fa771f
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/idna.h
@@ -0,0 +1,333 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+*******************************************************************************
+* Copyright (C) 2010-2012, International Business Machines
+* Corporation and others. All Rights Reserved.
+*******************************************************************************
+* file name: idna.h
+* encoding: UTF-8
+* tab size: 8 (not used)
+* indentation:4
+*
+* created on: 2010mar05
+* created by: Markus W. Scherer
+*/
+
+#ifndef __IDNA_H__
+#define __IDNA_H__
+
+/**
+ * \file
+ * \brief C++ API: Internationalizing Domain Names in Applications (IDNA)
+ */
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_IDNA
+
+#include "unicode/bytestream.h"
+#include "unicode/stringpiece.h"
+#include "unicode/uidna.h"
+#include "unicode/unistr.h"
+
+U_NAMESPACE_BEGIN
+
+class IDNAInfo;
+
+/**
+ * Abstract base class for IDNA processing.
+ * See http://www.unicode.org/reports/tr46/
+ * and http://www.ietf.org/rfc/rfc3490.txt
+ *
+ * The IDNA class is not intended for public subclassing.
+ *
+ * This C++ API currently only implements UTS #46.
+ * The uidna.h C API implements both UTS #46 (functions using UIDNA service object)
+ * and IDNA2003 (functions that do not use a service object).
+ * @stable ICU 4.6
+ */
+class U_COMMON_API IDNA : public UObject {
+public:
+ /**
+ * Destructor.
+ * @stable ICU 4.6
+ */
+ ~IDNA();
+
+ /**
+ * Returns an IDNA instance which implements UTS #46.
+ * Returns an unmodifiable instance, owned by the caller.
+ * Cache it for multiple operations, and delete it when done.
+ * The instance is thread-safe, that is, it can be used concurrently.
+ *
+ * UTS #46 defines Unicode IDNA Compatibility Processing,
+ * updated to the latest version of Unicode and compatible with both
+ * IDNA2003 and IDNA2008.
+ *
+ * The worker functions use transitional processing, including deviation mappings,
+ * unless UIDNA_NONTRANSITIONAL_TO_ASCII or UIDNA_NONTRANSITIONAL_TO_UNICODE
+ * is used in which case the deviation characters are passed through without change.
+ * Unicode 15.1 UTS #46 deprecated transitional processing.
+ *
+ * Disallowed characters are mapped to U+FFFD.
+ *
+ * For available options see the uidna.h header.
+ * Operations with the UTS #46 instance do not support the
+ * UIDNA_ALLOW_UNASSIGNED option.
+ *
+ * By default, the UTS #46 implementation allows all ASCII characters (as valid or mapped).
+ * When the UIDNA_USE_STD3_RULES option is used, ASCII characters other than
+ * letters, digits, hyphen (LDH) and dot/full stop are disallowed and mapped to U+FFFD.
+ *
+ * @param options Bit set to modify the processing and error checking.
+ * These should include UIDNA_DEFAULT, or
+ * UIDNA_NONTRANSITIONAL_TO_ASCII | UIDNA_NONTRANSITIONAL_TO_UNICODE.
+ * See option bit set values in uidna.h.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return the UTS #46 IDNA instance, if successful
+ * @stable ICU 4.6
+ */
+ static IDNA *
+ createUTS46Instance(uint32_t options, UErrorCode &errorCode);
+
+ /**
+ * Converts a single domain name label into its ASCII form for DNS lookup.
+ * If any processing step fails, then info.hasErrors() will be true and
+ * the result might not be an ASCII string.
+ * The label might be modified according to the types of errors.
+ * Labels with severe errors will be left in (or turned into) their Unicode form.
+ *
+ * The UErrorCode indicates an error only in exceptional cases,
+ * such as a U_MEMORY_ALLOCATION_ERROR.
+ *
+ * @param label Input domain name label
+ * @param dest Destination string object
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual UnicodeString &
+ labelToASCII(const UnicodeString &label, UnicodeString &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const = 0;
+
+ /**
+ * Converts a single domain name label into its Unicode form for human-readable display.
+ * If any processing step fails, then info.hasErrors() will be true.
+ * The label might be modified according to the types of errors.
+ *
+ * The UErrorCode indicates an error only in exceptional cases,
+ * such as a U_MEMORY_ALLOCATION_ERROR.
+ *
+ * @param label Input domain name label
+ * @param dest Destination string object
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual UnicodeString &
+ labelToUnicode(const UnicodeString &label, UnicodeString &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const = 0;
+
+ /**
+ * Converts a whole domain name into its ASCII form for DNS lookup.
+ * If any processing step fails, then info.hasErrors() will be true and
+ * the result might not be an ASCII string.
+ * The domain name might be modified according to the types of errors.
+ * Labels with severe errors will be left in (or turned into) their Unicode form.
+ *
+ * The UErrorCode indicates an error only in exceptional cases,
+ * such as a U_MEMORY_ALLOCATION_ERROR.
+ *
+ * @param name Input domain name
+ * @param dest Destination string object
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual UnicodeString &
+ nameToASCII(const UnicodeString &name, UnicodeString &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const = 0;
+
+ /**
+ * Converts a whole domain name into its Unicode form for human-readable display.
+ * If any processing step fails, then info.hasErrors() will be true.
+ * The domain name might be modified according to the types of errors.
+ *
+ * The UErrorCode indicates an error only in exceptional cases,
+ * such as a U_MEMORY_ALLOCATION_ERROR.
+ *
+ * @param name Input domain name
+ * @param dest Destination string object
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual UnicodeString &
+ nameToUnicode(const UnicodeString &name, UnicodeString &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const = 0;
+
+ // UTF-8 versions of the processing methods ---------------------------- ***
+
+ /**
+ * Converts a single domain name label into its ASCII form for DNS lookup.
+ * UTF-8 version of labelToASCII(), same behavior.
+ *
+ * @param label Input domain name label
+ * @param dest Destination byte sink; Flush()ed if successful
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual void
+ labelToASCII_UTF8(StringPiece label, ByteSink &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const;
+
+ /**
+ * Converts a single domain name label into its Unicode form for human-readable display.
+ * UTF-8 version of labelToUnicode(), same behavior.
+ *
+ * @param label Input domain name label
+ * @param dest Destination byte sink; Flush()ed if successful
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual void
+ labelToUnicodeUTF8(StringPiece label, ByteSink &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const;
+
+ /**
+ * Converts a whole domain name into its ASCII form for DNS lookup.
+ * UTF-8 version of nameToASCII(), same behavior.
+ *
+ * @param name Input domain name
+ * @param dest Destination byte sink; Flush()ed if successful
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual void
+ nameToASCII_UTF8(StringPiece name, ByteSink &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const;
+
+ /**
+ * Converts a whole domain name into its Unicode form for human-readable display.
+ * UTF-8 version of nameToUnicode(), same behavior.
+ *
+ * @param name Input domain name
+ * @param dest Destination byte sink; Flush()ed if successful
+ * @param info Output container of IDNA processing details.
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.6
+ */
+ virtual void
+ nameToUnicodeUTF8(StringPiece name, ByteSink &dest,
+ IDNAInfo &info, UErrorCode &errorCode) const;
+};
+
+class UTS46;
+
+/**
+ * Output container for IDNA processing errors.
+ * The IDNAInfo class is not suitable for subclassing.
+ * @stable ICU 4.6
+ */
+class U_COMMON_API IDNAInfo : public UMemory {
+public:
+ /**
+ * Constructor for stack allocation.
+ * @stable ICU 4.6
+ */
+ IDNAInfo() : errors(0), labelErrors(0), isTransDiff(false), isBiDi(false), isOkBiDi(true) {}
+ /**
+ * Were there IDNA processing errors?
+ * @return true if there were processing errors
+ * @stable ICU 4.6
+ */
+ UBool hasErrors() const { return errors!=0; }
+ /**
+ * Returns a bit set indicating IDNA processing errors.
+ * See UIDNA_ERROR_... constants in uidna.h.
+ * @return bit set of processing errors
+ * @stable ICU 4.6
+ */
+ uint32_t getErrors() const { return errors; }
+ /**
+ * Returns true if transitional and nontransitional processing produce different results.
+ * This is the case when the input label or domain name contains
+ * one or more deviation characters outside a Punycode label (see UTS #46).
+ *
+ *
+ * @return true if transitional and nontransitional processing produce different results
+ * @stable ICU 4.6
+ */
+ UBool isTransitionalDifferent() const { return isTransDiff; }
+
+private:
+ friend class UTS46;
+
+ IDNAInfo(const IDNAInfo &other) = delete; // no copying
+ IDNAInfo &operator=(const IDNAInfo &other) = delete; // no copying
+
+ void reset() {
+ errors=labelErrors=0;
+ isTransDiff=false;
+ isBiDi=false;
+ isOkBiDi=true;
+ }
+
+ uint32_t errors, labelErrors;
+ UBool isTransDiff;
+ UBool isBiDi;
+ UBool isOkBiDi;
+};
+
+U_NAMESPACE_END
+
+#endif // UCONFIG_NO_IDNA
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __IDNA_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/listformatter.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/listformatter.h
new file mode 100644
index 0000000000..37a76dcdd4
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/listformatter.h
@@ -0,0 +1,286 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+*******************************************************************************
+*
+* Copyright (C) 2012-2016, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+* file name: listformatter.h
+* encoding: UTF-8
+* tab size: 8 (not used)
+* indentation:4
+*
+* created on: 20120426
+* created by: Umesh P. Nair
+*/
+
+#ifndef __LISTFORMATTER_H__
+#define __LISTFORMATTER_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/unistr.h"
+#include "unicode/locid.h"
+#include "unicode/formattedvalue.h"
+#include "unicode/ulistformatter.h"
+
+U_NAMESPACE_BEGIN
+
+class FieldPositionHandler;
+class FormattedListData;
+class ListFormatter;
+
+/** @internal */
+class Hashtable;
+
+/** @internal */
+struct ListFormatInternal;
+
+/* The following can't be #ifndef U_HIDE_INTERNAL_API, needed for other .h file declarations */
+/**
+ * @internal
+ * \cond
+ */
+struct ListFormatData : public UMemory {
+ UnicodeString twoPattern;
+ UnicodeString startPattern;
+ UnicodeString middlePattern;
+ UnicodeString endPattern;
+ Locale locale;
+
+ ListFormatData(const UnicodeString& two, const UnicodeString& start, const UnicodeString& middle, const UnicodeString& end,
+ const Locale& loc) :
+ twoPattern(two), startPattern(start), middlePattern(middle), endPattern(end), locale(loc) {}
+};
+/** \endcond */
+
+
+/**
+ * \file
+ * \brief C++ API: API for formatting a list.
+ */
+
+
+/**
+ * An immutable class containing the result of a list formatting operation.
+ *
+ * Instances of this class are immutable and thread-safe.
+ *
+ * When calling nextPosition():
+ * The fields are returned from start to end. The special field category
+ * UFIELD_CATEGORY_LIST_SPAN is used to indicate which argument
+ * was inserted at the given position. The span category will
+ * always occur before the corresponding instance of UFIELD_CATEGORY_LIST
+ * in the nextPosition() iterator.
+ *
+ * Not intended for public subclassing.
+ *
+ * @stable ICU 64
+ */
+class U_I18N_API FormattedList : public UMemory, public FormattedValue {
+ public:
+ /**
+ * Default constructor; makes an empty FormattedList.
+ * @stable ICU 64
+ */
+ FormattedList() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
+
+ /**
+ * Move constructor: Leaves the source FormattedList in an undefined state.
+ * @stable ICU 64
+ */
+ FormattedList(FormattedList&& src) noexcept;
+
+ /**
+ * Destruct an instance of FormattedList.
+ * @stable ICU 64
+ */
+ virtual ~FormattedList() override;
+
+ /** Copying not supported; use move constructor instead. */
+ FormattedList(const FormattedList&) = delete;
+
+ /** Copying not supported; use move assignment instead. */
+ FormattedList& operator=(const FormattedList&) = delete;
+
+ /**
+ * Move assignment: Leaves the source FormattedList in an undefined state.
+ * @stable ICU 64
+ */
+ FormattedList& operator=(FormattedList&& src) noexcept;
+
+ /** @copydoc FormattedValue::toString() */
+ UnicodeString toString(UErrorCode& status) const override;
+
+ /** @copydoc FormattedValue::toTempString() */
+ UnicodeString toTempString(UErrorCode& status) const override;
+
+ /** @copydoc FormattedValue::appendTo() */
+ Appendable &appendTo(Appendable& appendable, UErrorCode& status) const override;
+
+ /** @copydoc FormattedValue::nextPosition() */
+ UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const override;
+
+ private:
+ FormattedListData *fData;
+ UErrorCode fErrorCode;
+ explicit FormattedList(FormattedListData *results)
+ : fData(results), fErrorCode(U_ZERO_ERROR) {}
+ explicit FormattedList(UErrorCode errorCode)
+ : fData(nullptr), fErrorCode(errorCode) {}
+ friend class ListFormatter;
+};
+
+
+/**
+ * An immutable class for formatting a list, using data from CLDR (or supplied
+ * separately).
+ *
+ * Example: Input data ["Alice", "Bob", "Charlie", "Delta"] will be formatted
+ * as "Alice, Bob, Charlie and Delta" in English.
+ *
+ * The ListFormatter class is not intended for public subclassing.
+ * @stable ICU 50
+ */
+class U_I18N_API ListFormatter : public UObject{
+
+ public:
+
+ /**
+ * Copy constructor.
+ * @stable ICU 52
+ */
+ ListFormatter(const ListFormatter&);
+
+ /**
+ * Assignment operator.
+ * @stable ICU 52
+ */
+ ListFormatter& operator=(const ListFormatter& other);
+
+ /**
+ * Creates a ListFormatter appropriate for the default locale.
+ *
+ * @param errorCode ICU error code, set if no data available for default locale.
+ * @return Pointer to a ListFormatter object for the default locale,
+ * created from internal data derived from CLDR data.
+ * @stable ICU 50
+ */
+ static ListFormatter* createInstance(UErrorCode& errorCode);
+
+ /**
+ * Creates a ListFormatter appropriate for a locale.
+ *
+ * @param locale The locale.
+ * @param errorCode ICU error code, set if no data available for the given locale.
+ * @return A ListFormatter object created from internal data derived from
+ * CLDR data.
+ * @stable ICU 50
+ */
+ static ListFormatter* createInstance(const Locale& locale, UErrorCode& errorCode);
+
+ /**
+ * Creates a ListFormatter for the given locale, list type, and style.
+ *
+ * @param locale The locale.
+ * @param type The type of list formatting to use.
+ * @param width The width of formatting to use.
+ * @param errorCode ICU error code, set if no data available for the given locale.
+ * @return A ListFormatter object created from internal data derived from CLDR data.
+ * @stable ICU 67
+ */
+ static ListFormatter* createInstance(
+ const Locale& locale, UListFormatterType type, UListFormatterWidth width, UErrorCode& errorCode);
+
+ /**
+ * Destructor.
+ *
+ * @stable ICU 50
+ */
+ virtual ~ListFormatter();
+
+
+ /**
+ * Formats a list of strings.
+ *
+ * @param items An array of strings to be combined and formatted.
+ * @param n_items Length of the array items.
+ * @param appendTo The string to which the result should be appended to.
+ * @param errorCode ICU error code, set if there is an error.
+ * @return Formatted string combining the elements of items, appended to appendTo.
+ * @stable ICU 50
+ */
+ UnicodeString& format(const UnicodeString items[], int32_t n_items,
+ UnicodeString& appendTo, UErrorCode& errorCode) const;
+
+ /**
+ * Formats a list of strings to a FormattedList, which exposes field
+ * position information. The FormattedList contains more information than
+ * a FieldPositionIterator.
+ *
+ * @param items An array of strings to be combined and formatted.
+ * @param n_items Length of the array items.
+ * @param errorCode ICU error code returned here.
+ * @return A FormattedList containing field information.
+ * @stable ICU 64
+ */
+ FormattedList formatStringsToValue(
+ const UnicodeString items[],
+ int32_t n_items,
+ UErrorCode& errorCode) const;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ @internal for MeasureFormat
+ */
+ UnicodeString& format(
+ const UnicodeString items[],
+ int32_t n_items,
+ UnicodeString& appendTo,
+ int32_t index,
+ int32_t &offset,
+ UErrorCode& errorCode) const;
+ /**
+ * @internal constructor made public for testing.
+ */
+ ListFormatter(const ListFormatData &data, UErrorCode &errorCode);
+ /**
+ * @internal constructor made public for testing.
+ */
+ ListFormatter(const ListFormatInternal* listFormatterInternal);
+#endif /* U_HIDE_INTERNAL_API */
+
+ private:
+
+ /**
+ * Creates a ListFormatter appropriate for a locale and style.
+ *
+ * @param locale The locale.
+ * @param style the style, either "standard", "or", "unit", "unit-narrow", or "unit-short"
+ */
+ static ListFormatter* createInstance(const Locale& locale, const char* style, UErrorCode& errorCode);
+
+ static void initializeHash(UErrorCode& errorCode);
+ static const ListFormatInternal* getListFormatInternal(const Locale& locale, const char *style, UErrorCode& errorCode);
+ struct U_HIDDEN ListPatternsSink;
+ static ListFormatInternal* loadListFormatInternal(const Locale& locale, const char* style, UErrorCode& errorCode);
+
+ ListFormatter() = delete;
+
+ ListFormatInternal* owned;
+ const ListFormatInternal* data;
+};
+
+U_NAMESPACE_END
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __LISTFORMATTER_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/localebuilder.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/localebuilder.h
new file mode 100644
index 0000000000..f708a7ed7c
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/localebuilder.h
@@ -0,0 +1,309 @@
+// © 2018 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+#ifndef __LOCALEBUILDER_H__
+#define __LOCALEBUILDER_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#include "unicode/locid.h"
+#include "unicode/localematcher.h"
+#include "unicode/stringpiece.h"
+#include "unicode/uobject.h"
+
+/**
+ * \file
+ * \brief C++ API: Builder API for Locale
+ */
+
+U_NAMESPACE_BEGIN
+class CharString;
+
+/**
+ * LocaleBuilder
is used to build instances of Locale
+ * from values configured by the setters. Unlike the Locale
+ * constructors, the LocaleBuilder
checks if a value configured by a
+ * setter satisfies the syntax requirements defined by the Locale
+ * class. A Locale
object created by a LocaleBuilder
is
+ * well-formed and can be transformed to a well-formed IETF BCP 47 language tag
+ * without losing information.
+ *
+ * Locale
object
+ * with the LocaleBuilder
.
+ *
+ *
+ *
+ *
+ * UErrorCode status = U_ZERO_ERROR;
+ * Locale aLocale = LocaleBuilder()
+ * .setLanguage("sr")
+ * .setScript("Latn")
+ * .setRegion("RS")
+ * .build(status);
+ * if (U_SUCCESS(status)) {
+ * // ...
+ * }
+ *
+ * clear()
resets all
+ * fields to their default values.
+ *
+ * LocaleBuilder
to match the provided
+ * locale
. Existing state is discarded.
+ *
+ * language tag
must be well-formed,
+ * or else the build() method will later report an U_ILLEGAL_ARGUMENT_ERROR.
+ *
+ * language
is the empty string, the
+ * language in this LocaleBuilder
is removed. Otherwise, the
+ * language
must be well-formed, or else the build() method will
+ * later report an U_ILLEGAL_ARGUMENT_ERROR.
+ *
+ * script
is the empty string, the script in
+ * this LocaleBuilder
is removed.
+ * Otherwise, the script
must be well-formed, or else the build()
+ * method will later report an U_ILLEGAL_ARGUMENT_ERROR.
+ *
+ * LocaleBuilder
is removed. Otherwise, the region
+ * must be well-formed, or else the build() method will later report an
+ * U_ILLEGAL_ARGUMENT_ERROR.
+ *
+ * Locale
created by the
+ * LocaleBuilder
is always normalized to upper case.
+ *
+ * @param region the region
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& setRegion(StringPiece region);
+
+ /**
+ * Sets the variant. If variant is the empty string, the variant in this
+ * LocaleBuilder
is removed. Otherwise, the variant
+ * must be well-formed, or else the build() method will later report an
+ * U_ILLEGAL_ARGUMENT_ERROR.
+ *
+ * variant
+ * satisfies the
+ * [unicode_variant_subtag](http://www.unicode.org/reports/tr35/tr35.html#unicode_variant_subtag)
+ * syntax requirements, and normalizes the value to lowercase letters. However,
+ * the Locale
class does not impose any syntactic
+ * restriction on variant. To set an ill-formed variant, use a Locale constructor.
+ * If there are multiple unicode_variant_subtag, the caller must concatenate
+ * them with '-' as separator (ex: "foobar-fibar").
+ *
+ * @param variant the variant
+ * @return This builder.
+ * @stable ICU 64
+ */
+ LocaleBuilder& setVariant(StringPiece variant);
+
+ /**
+ * Sets the extension for the given key. If the value is the empty string,
+ * the extension is removed. Otherwise, the key
and
+ * value
must be well-formed, or else the build() method will
+ * later report an U_ILLEGAL_ARGUMENT_ERROR.
+ *
+ * Locale
created from the fields set
+ * on this builder.
+ * If any set methods or during the build() call require memory allocation
+ * but fail U_MEMORY_ALLOCATION_ERROR will be set to status.
+ * If any of the fields set by the setters are not well-formed, the status
+ * will be set to U_ILLEGAL_ARGUMENT_ERROR. The state of the builder will
+ * not change after the build() call and the caller is free to keep using
+ * the same builder to build more locales.
+ *
+ * @return a new Locale
+ * @stable ICU 64
+ */
+ Locale build(UErrorCode& status);
+
+ /**
+ * Sets the UErrorCode if an error occurred while recording sets.
+ * Preserves older error codes in the outErrorCode.
+ * @param outErrorCode Set to an error code that occurred while setting subtags.
+ * Unchanged if there is no such error or if outErrorCode
+ * already contained an error.
+ * @return true if U_FAILURE(outErrorCode)
+ * @stable ICU 65
+ */
+ UBool copyErrorTo(UErrorCode &outErrorCode) const;
+
+private:
+ friend class LocaleMatcher::Result;
+
+ void copyExtensionsFrom(const Locale& src, UErrorCode& errorCode);
+
+ UErrorCode status_;
+ char language_[9];
+ char script_[5];
+ char region_[4];
+ CharString *variant_; // Pointer not object so we need not #include internal charstr.h.
+ icu::Locale *extensions_; // Pointer not object. Storage for all other fields.
+
+};
+
+U_NAMESPACE_END
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __LOCALEBUILDER_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/localematcher.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/localematcher.h
new file mode 100644
index 0000000000..e16f1a31ca
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/localematcher.h
@@ -0,0 +1,710 @@
+// © 2019 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+// localematcher.h
+// created: 2019may08 Markus W. Scherer
+
+#ifndef __LOCALEMATCHER_H__
+#define __LOCALEMATCHER_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#include Supported={en, sv} desired=[en-GB, sv]
+ * yields Result(en-GB, en)
because
+ * with the demotion of sv its perfect match is no better than
+ * the region distance between the earlier desired locale en-GB and en=en-US.
+ *
+ *
+ *
+ *
+ * @stable ICU 65
+ */
+ ULOCMATCH_DEMOTION_REGION
+};
+#ifndef U_IN_DOXYGEN
+typedef enum ULocMatchDemotion ULocMatchDemotion;
+#endif
+
+/**
+ * Builder option for whether to include or ignore one-way (fallback) match data.
+ * The LocaleMatcher uses CLDR languageMatch data which includes fallback (oneway=true) entries.
+ * Sometimes it is desirable to ignore those.
+ *
+ *
+ * UErrorCode errorCode = U_ZERO_ERROR;
+ * LocaleMatcher matcher = LocaleMatcher::Builder().setSupportedLocales("fr, en-GB, en").build(errorCode);
+ * Locale *bestSupported = matcher.getBestLocale(Locale.US, errorCode); // "en"
+ *
+ *
+ * Locale
object represents a specific geographical, political,
+ * or cultural region. An operation that requires a Locale
to perform
+ * its task is called locale-sensitive and uses the Locale
+ * to tailor information for the user. For example, displaying a number
+ * is a locale-sensitive operation--the number should be formatted
+ * according to the customs/conventions of the user's native country,
+ * region, or culture.
+ *
+ * The Locale class is not suitable for subclassing.
+ *
+ * Locale
object using the constructor in
+ * this class:
+ * \htmlonly\endhtmlonly
+ *
\endhtmlonly
+ * The first argument to the constructors is a valid ISO
+ * Language Code. These codes are the lower-case two-letter
+ * codes as defined by ISO-639.
+ * You can find a full list of these codes at:
+ *
+ * Locale( const char* language,
+ * const char* country,
+ * const char* variant);
+ *
+ * \htmlonly
+ * http://www.loc.gov/standards/iso639-2/
+ *
+ *
+ * http://www.iso.org/iso/en/prods-services/iso3166ma/index.html
+ *
+ * Locale
object is just an identifier for a region,
+ * no validity check is performed when you construct a Locale
.
+ * If you want to see whether particular resources are available for the
+ * Locale
you construct, you must query those resources. For
+ * example, ask the NumberFormat
for the locales it supports
+ * using its getAvailableLocales
method.
+ *
Note: When you ask for a resource for a particular
+ * locale, you get back the best available match, not necessarily
+ * precisely what you asked for. For more information, look at
+ * ResourceBundle
.
+ *
+ * Locale
class provides a number of convenient constants
+ * that you can use to create Locale
objects for commonly used
+ * locales. For example, the following refers to a Locale
object
+ * for the United States:
+ * \htmlonly\endhtmlonly
+ *
\endhtmlonly
+ *
+ *
+ * Locale::getUS()
+ *
+ * \htmlonlyLocale
you can query it for information about
+ * itself. Use getCountry
to get the ISO Country Code and
+ * getLanguage
to get the ISO Language Code. You can
+ * use getDisplayCountry
to get the
+ * name of the country suitable for displaying to the user. Similarly,
+ * you can use getDisplayLanguage
to get the name of
+ * the language suitable for displaying to the user. Interestingly,
+ * the getDisplayXXX
methods are themselves locale-sensitive
+ * and have two versions: one that uses the default locale and one
+ * that takes a locale as an argument and displays the name or country in
+ * a language appropriate to that locale.
+ *
+ * NumberFormat
class formats
+ * numbers, currency, or percentages in a locale-sensitive manner. Classes
+ * such as NumberFormat
have a number of convenience methods
+ * for creating a default object of that type. For example, the
+ * NumberFormat
class provides these three convenience methods
+ * for creating a default NumberFormat
object:
+ * \htmlonly\endhtmlonly
+ *
\endhtmlonly
+ * Each of these methods has two variants; one with an explicit locale
+ * and one without; the latter using the default locale.
+ * \htmlonly
+ * UErrorCode success = U_ZERO_ERROR;
+ * Locale myLocale;
+ * NumberFormat *nf;
+ *
+ * nf = NumberFormat::createInstance( success ); delete nf;
+ * nf = NumberFormat::createCurrencyInstance( success ); delete nf;
+ * nf = NumberFormat::createPercentInstance( success ); delete nf;
+ *
+ * \htmlonly\endhtmlonly
+ *
\endhtmlonly
+ * A
+ * nf = NumberFormat::createInstance( myLocale, success ); delete nf;
+ * nf = NumberFormat::createCurrencyInstance( myLocale, success ); delete nf;
+ * nf = NumberFormat::createPercentInstance( myLocale, success ); delete nf;
+ *
+ * \htmlonlyLocale
is the mechanism for identifying the kind of object
+ * (NumberFormat
) that you would like to get. The locale is
+ * just a mechanism for identifying objects,
+ * not a container for the objects themselves.
+ *
+ * \endhtmlonly
+ *
\endhtmlonly
+ *
+ * @stable ICU 2.0
+ * @see ResourceBundle
+ */
+class U_COMMON_API Locale : public UObject {
+public:
+ /** Useful constant for the Root locale. @stable ICU 4.4 */
+ static const Locale& U_EXPORT2 getRoot();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getEnglish();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getFrench();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getGerman();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getItalian();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getJapanese();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getKorean();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getChinese();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getSimplifiedChinese();
+ /** Useful constant for this language. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getTraditionalChinese();
+
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getFrance();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getGermany();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getItaly();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getJapan();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getKorea();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getChina();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getPRC();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getTaiwan();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getUK();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getUS();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getCanada();
+ /** Useful constant for this country/region. @stable ICU 2.0 */
+ static const Locale& U_EXPORT2 getCanadaFrench();
+
+ /**
+ * Construct a default locale object, a Locale for the default locale ID.
+ *
+ * @see getDefault
+ * @see uloc_getDefault
+ * @stable ICU 2.0
+ */
+ Locale();
+
+ /**
+ * Construct a locale from language, country, variant.
+ * If an error occurs, then the constructed object will be "bogus"
+ * (isBogus() will return true).
+ *
+ * @param language Lowercase two-letter or three-letter ISO-639 code.
+ * This parameter can instead be an ICU style C locale (e.g. "en_US"),
+ * but the other parameters must not be used.
+ * This parameter can be nullptr; if so,
+ * the locale is initialized to match the current default locale.
+ * (This is the same as using the default constructor.)
+ * Please note: The Java Locale class does NOT accept the form
+ * 'new Locale("en_US")' but only 'new Locale("en","US")'
+ *
+ * @param country Uppercase two-letter ISO-3166 code. (optional)
+ * @param variant Uppercase vendor and browser specific code. See class
+ * description. (optional)
+ * @param keywordsAndValues A string consisting of keyword/values pairs, such as
+ * "collation=phonebook;currency=euro"
+ *
+ * @see getDefault
+ * @see uloc_getDefault
+ * @stable ICU 2.0
+ */
+ Locale(const char* language,
+ const char* country = nullptr,
+ const char* variant = nullptr,
+ const char* keywordsAndValues = nullptr);
+
+ /**
+ * Initializes a Locale object from another Locale object.
+ *
+ * @param other The Locale object being copied in.
+ * @stable ICU 2.0
+ */
+ Locale(const Locale& other);
+
+ /**
+ * Move constructor; might leave source in bogus state.
+ * This locale will have the same contents that the source locale had.
+ *
+ * @param other The Locale object being moved in.
+ * @stable ICU 63
+ */
+ Locale(Locale&& other) noexcept;
+
+ /**
+ * Destructor
+ * @stable ICU 2.0
+ */
+ virtual ~Locale() ;
+
+ /**
+ * Replaces the entire contents of *this with the specified value.
+ *
+ * @param other The Locale object being copied in.
+ * @return *this
+ * @stable ICU 2.0
+ */
+ Locale& operator=(const Locale& other);
+
+ /**
+ * Move assignment operator; might leave source in bogus state.
+ * This locale will have the same contents that the source locale had.
+ * The behavior is undefined if *this and the source are the same object.
+ *
+ * @param other The Locale object being moved in.
+ * @return *this
+ * @stable ICU 63
+ */
+ Locale& operator=(Locale&& other) noexcept;
+
+ /**
+ * Checks if two locale keys are the same.
+ *
+ * @param other The locale key object to be compared with this.
+ * @return true if the two locale keys are the same, false otherwise.
+ * @stable ICU 2.0
+ */
+ bool operator==(const Locale& other) const;
+
+ /**
+ * Checks if two locale keys are not the same.
+ *
+ * @param other The locale key object to be compared with this.
+ * @return true if the two locale keys are not the same, false
+ * otherwise.
+ * @stable ICU 2.0
+ */
+ inline bool operator!=(const Locale& other) const;
+
+ /**
+ * Clone this object.
+ * Clones can be used concurrently in multiple threads.
+ * If an error occurs, then nullptr is returned.
+ * The caller must delete the clone.
+ *
+ * @return a clone of this object
+ *
+ * @see getDynamicClassID
+ * @stable ICU 2.8
+ */
+ Locale *clone() const;
+
+#ifndef U_HIDE_SYSTEM_API
+ /**
+ * Common methods of getting the current default Locale. Used for the
+ * presentation: menus, dialogs, etc. Generally set once when your applet or
+ * application is initialized, then never reset. (If you do reset the
+ * default locale, you probably want to reload your GUI, so that the change
+ * is reflected in your interface.)
+ *
+ * More advanced programs will allow users to use different locales for
+ * different fields, e.g. in a spreadsheet.
+ *
+ * Note that the initial setting will match the host system.
+ * @return a reference to the Locale object for the default locale ID
+ * @system
+ * @stable ICU 2.0
+ */
+ static const Locale& U_EXPORT2 getDefault();
+
+ /**
+ * Sets the default. Normally set once at the beginning of a process,
+ * then never reset.
+ * setDefault() only changes ICU's default locale ID, not
+ * the default locale ID of the runtime environment.
+ *
+ * @param newLocale Locale to set to. If nullptr, set to the value obtained
+ * from the runtime environment.
+ * @param success The error code.
+ * @system
+ * @stable ICU 2.0
+ */
+ static void U_EXPORT2 setDefault(const Locale& newLocale,
+ UErrorCode& success);
+#endif /* U_HIDE_SYSTEM_API */
+
+ /**
+ * Returns a Locale for the specified BCP47 language tag string.
+ * If the specified language tag contains any ill-formed subtags,
+ * the first such subtag and all following subtags are ignored.
+ *
+ * static Locale* getAvailableLocales(int32_t& numLocales)
+ * static UnicodeString& getDisplayName(const Locale& objectLocale,
+ * const Locale& displayLocale,
+ * UnicodeString& displayName)
+ * static UnicodeString& getDisplayName(const Locale& objectLocale,
+ * UnicodeString& displayName)
+ *
+ * \htmlonly
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . erived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 53
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
+ * method is to implement a simple version of RTTI, since not all C++
+ * compilers support genuine RTTI. Polymorphic operator==() and clone()
+ * methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 53
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ protected:
+ /**
+ * Default constructor.
+ * @stable ICU 3.0
+ */
+ MeasureFormat();
+
+#ifndef U_HIDE_INTERNAL_API
+
+ /**
+ * ICU use only.
+ * Initialize or change MeasureFormat class from subclass.
+ * @internal.
+ */
+ void initMeasureFormat(
+ const Locale &locale,
+ UMeasureFormatWidth width,
+ NumberFormat *nfToAdopt,
+ UErrorCode &status);
+ /**
+ * ICU use only.
+ * Allows subclass to change locale. Note that this method also changes
+ * the NumberFormat object. Returns true if locale changed; false if no
+ * change was made.
+ * @internal.
+ */
+ UBool setMeasureFormatLocale(const Locale &locale, UErrorCode &status);
+
+ /**
+ * ICU use only.
+ * Let subclass change NumberFormat.
+ * @internal.
+ */
+ void adoptNumberFormat(NumberFormat *nfToAdopt, UErrorCode &status);
+
+ /**
+ * ICU use only.
+ * @internal.
+ */
+ const NumberFormat &getNumberFormatInternal() const;
+
+ /**
+ * ICU use only.
+ * Always returns the short form currency formatter.
+ * @internal.
+ */
+ const NumberFormat& getCurrencyFormatInternal() const;
+
+ /**
+ * ICU use only.
+ * @internal.
+ */
+ const PluralRules &getPluralRules() const;
+
+ /**
+ * ICU use only.
+ * @internal.
+ */
+ Locale getLocale(UErrorCode &status) const;
+
+ /**
+ * ICU use only.
+ * @internal.
+ */
+ const char *getLocaleID(UErrorCode &status) const;
+
+#endif /* U_HIDE_INTERNAL_API */
+
+ private:
+ const MeasureFormatCacheData *cache;
+ const SharedNumberFormat *numberFormat;
+ const SharedPluralRules *pluralRules;
+ UMeasureFormatWidth fWidth;
+
+ // Declared outside of MeasureFormatSharedData because ListFormatter
+ // objects are relatively cheap to copy; therefore, they don't need to be
+ // shared across instances.
+ ListFormatter *listFormatter;
+
+ UnicodeString &formatMeasure(
+ const Measure &measure,
+ const NumberFormat &nf,
+ UnicodeString &appendTo,
+ FieldPosition &pos,
+ UErrorCode &status) const;
+
+ UnicodeString &formatMeasuresSlowTrack(
+ const Measure *measures,
+ int32_t measureCount,
+ UnicodeString& appendTo,
+ FieldPosition& pos,
+ UErrorCode& status) const;
+
+ UnicodeString &formatNumeric(
+ const Formattable *hms, // always length 3: [0] is hour; [1] is
+ // minute; [2] is second.
+ int32_t bitMap, // 1=hour set, 2=minute set, 4=second set
+ UnicodeString &appendTo,
+ UErrorCode &status) const;
+};
+
+U_NAMESPACE_END
+
+#endif // #if !UCONFIG_NO_FORMATTING
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // #ifndef MEASUREFORMAT_H
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/measunit.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/measunit.h
new file mode 100644
index 0000000000..f0abd4f4f9
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/measunit.h
@@ -0,0 +1,3953 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+**********************************************************************
+* Copyright (c) 2004-2016, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+* Author: Alan Liu
+* Created: April 26, 2004
+* Since: ICU 3.0
+**********************************************************************
+*/
+#ifndef __MEASUREUNIT_H__
+#define __MEASUREUNIT_H__
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_FORMATTING
+
+#include
+ * MeasureUnit example = MeasureUnit::forIdentifier("meter-per-second", status);
+ *
+ *
+ * @param identifier the CLDR Unit Identifier
+ * @param status Set error if the identifier is invalid.
+ * @return the corresponding MeasureUnit
+ * @stable ICU 67
+ */
+ static MeasureUnit forIdentifier(StringPiece identifier, UErrorCode& status);
+
+ /**
+ * Copy assignment operator.
+ * @stable ICU 3.0
+ */
+ MeasureUnit &operator=(const MeasureUnit &other);
+
+ /**
+ * Move assignment operator.
+ * @stable ICU 67
+ */
+ MeasureUnit &operator=(MeasureUnit &&other) noexcept;
+
+ /**
+ * Returns a polymorphic clone of this object. The result will
+ * have the same class as returned by getDynamicClassID().
+ * @stable ICU 3.0
+ */
+ virtual MeasureUnit* clone() const;
+
+ /**
+ * Destructor
+ * @stable ICU 3.0
+ */
+ virtual ~MeasureUnit();
+
+ /**
+ * Equality operator. Return true if this object is equal
+ * to the given object.
+ * @stable ICU 3.0
+ */
+ virtual bool operator==(const UObject& other) const;
+
+ /**
+ * Inequality operator. Return true if this object is not equal
+ * to the given object.
+ * @stable ICU 53
+ */
+ bool operator!=(const UObject& other) const {
+ return !(*this == other);
+ }
+
+ /**
+ * Get the type.
+ *
+ * If the unit does not have a type, the empty string is returned.
+ *
+ * @stable ICU 53
+ */
+ const char *getType() const;
+
+ /**
+ * Get the sub type.
+ *
+ * If the unit does not have a subtype, the empty string is returned.
+ *
+ * @stable ICU 53
+ */
+ const char *getSubtype() const;
+
+ /**
+ * Get CLDR Unit Identifier for this MeasureUnit, as defined in UTS 35.
+ *
+ * @return The string form of this unit, owned by this MeasureUnit.
+ * @stable ICU 67
+ */
+ const char* getIdentifier() const;
+
+ /**
+ * Compute the complexity of the unit. See UMeasureUnitComplexity for more information.
+ *
+ * @param status Set if an error occurs.
+ * @return The unit complexity.
+ * @stable ICU 67
+ */
+ UMeasureUnitComplexity getComplexity(UErrorCode& status) const;
+
+ /**
+ * Creates a MeasureUnit which is this SINGLE unit augmented with the specified prefix.
+ * For example, UMEASURE_PREFIX_KILO for "kilo", or UMEASURE_PREFIX_KIBI for "kibi".
+ *
+ * There is sufficient locale data to format all standard prefixes.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * @param prefix The prefix, from UMeasurePrefix.
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return A new SINGLE unit.
+ * @stable ICU 69
+ */
+ MeasureUnit withPrefix(UMeasurePrefix prefix, UErrorCode& status) const;
+
+ /**
+ * Returns the current SI or binary prefix of this SINGLE unit. For example,
+ * if the unit has the prefix "kilo", then UMEASURE_PREFIX_KILO is
+ * returned.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return The prefix of this SINGLE unit, from UMeasurePrefix.
+ * @see umeas_getPrefixBase
+ * @see umeas_getPrefixPower
+ * @stable ICU 69
+ */
+ UMeasurePrefix getPrefix(UErrorCode& status) const;
+
+#ifndef U_HIDE_DRAFT_API
+
+ /**
+ * Creates a new MeasureUnit with a specified constant denominator.
+ *
+ * This method is applicable only to COMPOUND and SINGLE units. If invoked on a
+ * MIXED unit, an error will be set in the status.
+ *
+ * NOTE: If the constant denominator is set to 0, it means that you are removing
+ * the constant denominator.
+ *
+ * @param denominator The constant denominator to set.
+ * @param status Set if this is not a COMPOUND or SINGLE unit or if another error occurs.
+ * @return A new MeasureUnit with the specified constant denominator.
+ * @draft ICU 77
+ */
+ MeasureUnit withConstantDenominator(uint64_t denominator, UErrorCode &status) const;
+
+ /**
+ * Retrieves the constant denominator for this COMPOUND unit.
+ *
+ * Examples:
+ * - For the unit "liter-per-1000-kiloliter", the constant denominator is 1000.
+ * - For the unit "liter-per-kilometer", the constant denominator is zero.
+ *
+ * This method is applicable only to COMPOUND and SINGLE units. If invoked on
+ * a MIXED unit, an error will be set in the status.
+ *
+ * NOTE: If no constant denominator exists, the method returns 0.
+ *
+ * @param status Set if this is not a COMPOUND or SINGLE unit or if another error occurs.
+ * @return The value of the constant denominator.
+ * @draft ICU 77
+ */
+ uint64_t getConstantDenominator(UErrorCode &status) const;
+
+#endif /* U_HIDE_DRAFT_API */
+
+ /**
+ * Creates a MeasureUnit which is this SINGLE unit augmented with the specified dimensionality
+ * (power). For example, if dimensionality is 2, the unit will be squared.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * For the base dimensionless unit, withDimensionality does nothing.
+ *
+ * @param dimensionality The dimensionality (power).
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return A new SINGLE unit.
+ * @stable ICU 67
+ */
+ MeasureUnit withDimensionality(int32_t dimensionality, UErrorCode& status) const;
+
+ /**
+ * Gets the dimensionality (power) of this MeasureUnit. For example, if the unit is square,
+ * then 2 is returned.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * For the base dimensionless unit, getDimensionality returns 0.
+ *
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return The dimensionality (power) of this simple unit.
+ * @stable ICU 67
+ */
+ int32_t getDimensionality(UErrorCode& status) const;
+
+ /**
+ * Gets the reciprocal of this MeasureUnit, with the numerator and denominator flipped.
+ *
+ * For example, if the receiver is "meter-per-second", the unit "second-per-meter" is returned.
+ *
+ * NOTE: Only works on SINGLE and COMPOUND units. If this is a MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * NOTE: An Error will be returned for units that have a constant denominator.
+ *
+ * @param status Set if this is a MIXED unit, has a constant denominator or if another error occurs.
+ * @return The reciprocal of the target unit.
+ * @stable ICU 67
+ */
+ MeasureUnit reciprocal(UErrorCode& status) const;
+
+ /**
+ * Gets the product of this unit with another unit. This is a way to build units from
+ * constituent parts.
+ *
+ * The numerator and denominator are preserved through this operation.
+ *
+ * For example, if the receiver is "kilowatt" and the argument is "hour-per-day", then the
+ * unit "kilowatt-hour-per-day" is returned.
+ *
+ * NOTE: Only works on SINGLE and COMPOUND units. If either unit (receiver and argument) is a
+ * MIXED unit, an error will occur. For more information, see UMeasureUnitComplexity.
+ *
+ * @param other The MeasureUnit to multiply with the target.
+ * @param status Set if this or other is a MIXED unit or if another error occurs.
+ * @return The product of the target unit with the provided unit.
+ * @stable ICU 67
+ */
+ MeasureUnit product(const MeasureUnit& other, UErrorCode& status) const;
+
+ /**
+ * Gets the list of SINGLE units contained within a MIXED or COMPOUND unit.
+ *
+ * Examples:
+ * - Given "meter-kilogram-per-second", three units will be returned: "meter",
+ * "kilogram", and "per-second".
+ * - Given "hour+minute+second", three units will be returned: "hour", "minute",
+ * and "second".
+ *
+ * If this is a SINGLE unit, an array of length 1 will be returned.
+ *
+ * NOTE: For units with a constant denominator, the returned single units will
+ * not include the constant denominator. To obtain the constant denominator,
+ * retrieve it from the original unit.
+ *
+ * @param status Set if an error occurs.
+ * @return A pair with the list of units as a LocalArray and the number of units in the list.
+ * @stable ICU 68
+ */
+ inline std::pair
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . Derived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 53
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
+ * method is to implement a simple version of RTTI, since not all C++
+ * compilers support genuine RTTI. Polymorphic operator==() and clone()
+ * methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 53
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * ICU use only.
+ * Returns associated array index for this measure unit.
+ * @internal
+ */
+ int32_t getOffset() const;
+#endif /* U_HIDE_INTERNAL_API */
+
+// All code between the "Start generated createXXX methods" comment and
+// the "End generated createXXX methods" comment is auto generated code
+// and must not be edited manually. For instructions on how to correctly
+// update this code, refer to:
+// docs/processes/release/tasks/updating-measure-unit.md
+//
+// Start generated createXXX methods
+
+ /**
+ * Returns by pointer, unit of acceleration: g-force.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGForce()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createGForce(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of acceleration: g-force.
+ * Also see {@link #createGForce()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGForce();
+
+ /**
+ * Returns by pointer, unit of acceleration: meter-per-square-second.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMeterPerSecondSquared()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of acceleration: meter-per-square-second.
+ * Also see {@link #createMeterPerSecondSquared()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMeterPerSecondSquared();
+
+ /**
+ * Returns by pointer, unit of angle: arc-minute.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getArcMinute()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createArcMinute(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of angle: arc-minute.
+ * Also see {@link #createArcMinute()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getArcMinute();
+
+ /**
+ * Returns by pointer, unit of angle: arc-second.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getArcSecond()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createArcSecond(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of angle: arc-second.
+ * Also see {@link #createArcSecond()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getArcSecond();
+
+ /**
+ * Returns by pointer, unit of angle: degree.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDegree()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createDegree(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of angle: degree.
+ * Also see {@link #createDegree()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getDegree();
+
+ /**
+ * Returns by pointer, unit of angle: radian.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getRadian()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createRadian(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of angle: radian.
+ * Also see {@link #createRadian()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getRadian();
+
+ /**
+ * Returns by pointer, unit of angle: revolution.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getRevolutionAngle()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createRevolutionAngle(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of angle: revolution.
+ * Also see {@link #createRevolutionAngle()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getRevolutionAngle();
+
+ /**
+ * Returns by pointer, unit of area: acre.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getAcre()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createAcre(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: acre.
+ * Also see {@link #createAcre()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getAcre();
+
+ /**
+ * Returns by pointer, unit of area: dunam.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDunam()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createDunam(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: dunam.
+ * Also see {@link #createDunam()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getDunam();
+
+ /**
+ * Returns by pointer, unit of area: hectare.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getHectare()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createHectare(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: hectare.
+ * Also see {@link #createHectare()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getHectare();
+
+ /**
+ * Returns by pointer, unit of area: square-centimeter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSquareCentimeter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createSquareCentimeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: square-centimeter.
+ * Also see {@link #createSquareCentimeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSquareCentimeter();
+
+ /**
+ * Returns by pointer, unit of area: square-foot.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSquareFoot()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createSquareFoot(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: square-foot.
+ * Also see {@link #createSquareFoot()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSquareFoot();
+
+ /**
+ * Returns by pointer, unit of area: square-inch.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSquareInch()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createSquareInch(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: square-inch.
+ * Also see {@link #createSquareInch()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSquareInch();
+
+ /**
+ * Returns by pointer, unit of area: square-kilometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSquareKilometer()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createSquareKilometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: square-kilometer.
+ * Also see {@link #createSquareKilometer()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSquareKilometer();
+
+ /**
+ * Returns by pointer, unit of area: square-meter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSquareMeter()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createSquareMeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: square-meter.
+ * Also see {@link #createSquareMeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSquareMeter();
+
+ /**
+ * Returns by pointer, unit of area: square-mile.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSquareMile()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createSquareMile(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: square-mile.
+ * Also see {@link #createSquareMile()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSquareMile();
+
+ /**
+ * Returns by pointer, unit of area: square-yard.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSquareYard()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createSquareYard(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of area: square-yard.
+ * Also see {@link #createSquareYard()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSquareYard();
+
+ /**
+ * Returns by pointer, unit of concentr: item.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getItem()}.
+ * @param status ICU error code.
+ * @stable ICU 70
+ */
+ static MeasureUnit *createItem(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: item.
+ * Also see {@link #createItem()}.
+ * @stable ICU 70
+ */
+ static MeasureUnit getItem();
+
+ /**
+ * Returns by pointer, unit of concentr: karat.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKarat()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKarat(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: karat.
+ * Also see {@link #createKarat()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKarat();
+
+ /**
+ * Returns by pointer, unit of concentr: milligram-ofglucose-per-deciliter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilligramOfglucosePerDeciliter()}.
+ * @param status ICU error code.
+ * @stable ICU 69
+ */
+ static MeasureUnit *createMilligramOfglucosePerDeciliter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: milligram-ofglucose-per-deciliter.
+ * Also see {@link #createMilligramOfglucosePerDeciliter()}.
+ * @stable ICU 69
+ */
+ static MeasureUnit getMilligramOfglucosePerDeciliter();
+
+ /**
+ * Returns by pointer, unit of concentr: milligram-per-deciliter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilligramPerDeciliter()}.
+ * @param status ICU error code.
+ * @stable ICU 57
+ */
+ static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: milligram-per-deciliter.
+ * Also see {@link #createMilligramPerDeciliter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilligramPerDeciliter();
+
+ /**
+ * Returns by pointer, unit of concentr: millimole-per-liter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMillimolePerLiter()}.
+ * @param status ICU error code.
+ * @stable ICU 57
+ */
+ static MeasureUnit *createMillimolePerLiter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: millimole-per-liter.
+ * Also see {@link #createMillimolePerLiter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMillimolePerLiter();
+
+ /**
+ * Returns by pointer, unit of concentr: mole.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMole()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createMole(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: mole.
+ * Also see {@link #createMole()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMole();
+
+ /**
+ * Returns by pointer, unit of concentr: percent.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPercent()}.
+ * @param status ICU error code.
+ * @stable ICU 63
+ */
+ static MeasureUnit *createPercent(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: percent.
+ * Also see {@link #createPercent()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPercent();
+
+ /**
+ * Returns by pointer, unit of concentr: permille.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPermille()}.
+ * @param status ICU error code.
+ * @stable ICU 63
+ */
+ static MeasureUnit *createPermille(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: permille.
+ * Also see {@link #createPermille()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPermille();
+
+ /**
+ * Returns by pointer, unit of concentr: permillion.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPartPerMillion()}.
+ * @param status ICU error code.
+ * @stable ICU 57
+ */
+ static MeasureUnit *createPartPerMillion(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: permillion.
+ * Also see {@link #createPartPerMillion()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPartPerMillion();
+
+ /**
+ * Returns by pointer, unit of concentr: permyriad.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPermyriad()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createPermyriad(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: permyriad.
+ * Also see {@link #createPermyriad()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPermyriad();
+
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Returns by pointer, unit of concentr: portion-per-1e9.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPortionPer1E9()}.
+ * @param status ICU error code.
+ * @draft ICU 77
+ */
+ static MeasureUnit *createPortionPer1E9(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of concentr: portion-per-1e9.
+ * Also see {@link #createPortionPer1E9()}.
+ * @draft ICU 77
+ */
+ static MeasureUnit getPortionPer1E9();
+#endif /* U_HIDE_DRAFT_API */
+
+ /**
+ * Returns by pointer, unit of consumption: liter-per-100-kilometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getLiterPer100Kilometers()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createLiterPer100Kilometers(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of consumption: liter-per-100-kilometer.
+ * Also see {@link #createLiterPer100Kilometers()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getLiterPer100Kilometers();
+
+ /**
+ * Returns by pointer, unit of consumption: liter-per-kilometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getLiterPerKilometer()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createLiterPerKilometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of consumption: liter-per-kilometer.
+ * Also see {@link #createLiterPerKilometer()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getLiterPerKilometer();
+
+ /**
+ * Returns by pointer, unit of consumption: mile-per-gallon.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilePerGallon()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMilePerGallon(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of consumption: mile-per-gallon.
+ * Also see {@link #createMilePerGallon()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilePerGallon();
+
+ /**
+ * Returns by pointer, unit of consumption: mile-per-gallon-imperial.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilePerGallonImperial()}.
+ * @param status ICU error code.
+ * @stable ICU 57
+ */
+ static MeasureUnit *createMilePerGallonImperial(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of consumption: mile-per-gallon-imperial.
+ * Also see {@link #createMilePerGallonImperial()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilePerGallonImperial();
+
+ /**
+ * Returns by pointer, unit of digital: bit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getBit()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createBit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: bit.
+ * Also see {@link #createBit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getBit();
+
+ /**
+ * Returns by pointer, unit of digital: byte.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getByte()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createByte(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: byte.
+ * Also see {@link #createByte()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getByte();
+
+ /**
+ * Returns by pointer, unit of digital: gigabit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGigabit()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createGigabit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: gigabit.
+ * Also see {@link #createGigabit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGigabit();
+
+ /**
+ * Returns by pointer, unit of digital: gigabyte.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGigabyte()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createGigabyte(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: gigabyte.
+ * Also see {@link #createGigabyte()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGigabyte();
+
+ /**
+ * Returns by pointer, unit of digital: kilobit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilobit()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKilobit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: kilobit.
+ * Also see {@link #createKilobit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilobit();
+
+ /**
+ * Returns by pointer, unit of digital: kilobyte.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilobyte()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKilobyte(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: kilobyte.
+ * Also see {@link #createKilobyte()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilobyte();
+
+ /**
+ * Returns by pointer, unit of digital: megabit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMegabit()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMegabit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: megabit.
+ * Also see {@link #createMegabit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMegabit();
+
+ /**
+ * Returns by pointer, unit of digital: megabyte.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMegabyte()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMegabyte(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: megabyte.
+ * Also see {@link #createMegabyte()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMegabyte();
+
+ /**
+ * Returns by pointer, unit of digital: petabyte.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPetabyte()}.
+ * @param status ICU error code.
+ * @stable ICU 63
+ */
+ static MeasureUnit *createPetabyte(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: petabyte.
+ * Also see {@link #createPetabyte()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPetabyte();
+
+ /**
+ * Returns by pointer, unit of digital: terabit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getTerabit()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createTerabit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: terabit.
+ * Also see {@link #createTerabit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getTerabit();
+
+ /**
+ * Returns by pointer, unit of digital: terabyte.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getTerabyte()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createTerabyte(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of digital: terabyte.
+ * Also see {@link #createTerabyte()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getTerabyte();
+
+ /**
+ * Returns by pointer, unit of duration: century.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCentury()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createCentury(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: century.
+ * Also see {@link #createCentury()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCentury();
+
+ /**
+ * Returns by pointer, unit of duration: day.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDay()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createDay(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: day.
+ * Also see {@link #createDay()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getDay();
+
+ /**
+ * Returns by pointer, unit of duration: day-person.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDayPerson()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createDayPerson(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: day-person.
+ * Also see {@link #createDayPerson()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getDayPerson();
+
+ /**
+ * Returns by pointer, unit of duration: decade.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDecade()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createDecade(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: decade.
+ * Also see {@link #createDecade()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getDecade();
+
+ /**
+ * Returns by pointer, unit of duration: hour.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getHour()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createHour(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: hour.
+ * Also see {@link #createHour()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getHour();
+
+ /**
+ * Returns by pointer, unit of duration: microsecond.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMicrosecond()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMicrosecond(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: microsecond.
+ * Also see {@link #createMicrosecond()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMicrosecond();
+
+ /**
+ * Returns by pointer, unit of duration: millisecond.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMillisecond()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMillisecond(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: millisecond.
+ * Also see {@link #createMillisecond()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMillisecond();
+
+ /**
+ * Returns by pointer, unit of duration: minute.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMinute()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMinute(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: minute.
+ * Also see {@link #createMinute()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMinute();
+
+ /**
+ * Returns by pointer, unit of duration: month.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMonth()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMonth(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: month.
+ * Also see {@link #createMonth()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMonth();
+
+ /**
+ * Returns by pointer, unit of duration: month-person.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMonthPerson()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createMonthPerson(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: month-person.
+ * Also see {@link #createMonthPerson()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMonthPerson();
+
+ /**
+ * Returns by pointer, unit of duration: nanosecond.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getNanosecond()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createNanosecond(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: nanosecond.
+ * Also see {@link #createNanosecond()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getNanosecond();
+
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Returns by pointer, unit of duration: night.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getNight()}.
+ * @param status ICU error code.
+ * @draft ICU 76
+ */
+ static MeasureUnit *createNight(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: night.
+ * Also see {@link #createNight()}.
+ * @draft ICU 76
+ */
+ static MeasureUnit getNight();
+#endif /* U_HIDE_DRAFT_API */
+
+ /**
+ * Returns by pointer, unit of duration: quarter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getQuarter()}.
+ * @param status ICU error code.
+ * @stable ICU 72
+ */
+ static MeasureUnit *createQuarter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: quarter.
+ * Also see {@link #createQuarter()}.
+ * @stable ICU 72
+ */
+ static MeasureUnit getQuarter();
+
+ /**
+ * Returns by pointer, unit of duration: second.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSecond()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createSecond(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: second.
+ * Also see {@link #createSecond()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSecond();
+
+ /**
+ * Returns by pointer, unit of duration: week.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getWeek()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createWeek(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: week.
+ * Also see {@link #createWeek()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getWeek();
+
+ /**
+ * Returns by pointer, unit of duration: week-person.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getWeekPerson()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createWeekPerson(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: week-person.
+ * Also see {@link #createWeekPerson()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getWeekPerson();
+
+ /**
+ * Returns by pointer, unit of duration: year.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getYear()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createYear(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: year.
+ * Also see {@link #createYear()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getYear();
+
+ /**
+ * Returns by pointer, unit of duration: year-person.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getYearPerson()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createYearPerson(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of duration: year-person.
+ * Also see {@link #createYearPerson()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getYearPerson();
+
+ /**
+ * Returns by pointer, unit of electric: ampere.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getAmpere()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createAmpere(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of electric: ampere.
+ * Also see {@link #createAmpere()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getAmpere();
+
+ /**
+ * Returns by pointer, unit of electric: milliampere.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilliampere()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMilliampere(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of electric: milliampere.
+ * Also see {@link #createMilliampere()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilliampere();
+
+ /**
+ * Returns by pointer, unit of electric: ohm.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getOhm()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createOhm(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of electric: ohm.
+ * Also see {@link #createOhm()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getOhm();
+
+ /**
+ * Returns by pointer, unit of electric: volt.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getVolt()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createVolt(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of electric: volt.
+ * Also see {@link #createVolt()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getVolt();
+
+ /**
+ * Returns by pointer, unit of energy: british-thermal-unit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getBritishThermalUnit()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createBritishThermalUnit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: british-thermal-unit.
+ * Also see {@link #createBritishThermalUnit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getBritishThermalUnit();
+
+ /**
+ * Returns by pointer, unit of energy: calorie.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCalorie()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCalorie(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: calorie.
+ * Also see {@link #createCalorie()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCalorie();
+
+ /**
+ * Returns by pointer, unit of energy: electronvolt.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getElectronvolt()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createElectronvolt(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: electronvolt.
+ * Also see {@link #createElectronvolt()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getElectronvolt();
+
+ /**
+ * Returns by pointer, unit of energy: foodcalorie.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getFoodcalorie()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createFoodcalorie(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: foodcalorie.
+ * Also see {@link #createFoodcalorie()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getFoodcalorie();
+
+ /**
+ * Returns by pointer, unit of energy: joule.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getJoule()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createJoule(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: joule.
+ * Also see {@link #createJoule()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getJoule();
+
+ /**
+ * Returns by pointer, unit of energy: kilocalorie.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilocalorie()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKilocalorie(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: kilocalorie.
+ * Also see {@link #createKilocalorie()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilocalorie();
+
+ /**
+ * Returns by pointer, unit of energy: kilojoule.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilojoule()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKilojoule(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: kilojoule.
+ * Also see {@link #createKilojoule()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilojoule();
+
+ /**
+ * Returns by pointer, unit of energy: kilowatt-hour.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilowattHour()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKilowattHour(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: kilowatt-hour.
+ * Also see {@link #createKilowattHour()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilowattHour();
+
+ /**
+ * Returns by pointer, unit of energy: therm-us.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getThermUs()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createThermUs(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of energy: therm-us.
+ * Also see {@link #createThermUs()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getThermUs();
+
+ /**
+ * Returns by pointer, unit of force: kilowatt-hour-per-100-kilometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilowattHourPer100Kilometer()}.
+ * @param status ICU error code.
+ * @stable ICU 70
+ */
+ static MeasureUnit *createKilowattHourPer100Kilometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of force: kilowatt-hour-per-100-kilometer.
+ * Also see {@link #createKilowattHourPer100Kilometer()}.
+ * @stable ICU 70
+ */
+ static MeasureUnit getKilowattHourPer100Kilometer();
+
+ /**
+ * Returns by pointer, unit of force: newton.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getNewton()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createNewton(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of force: newton.
+ * Also see {@link #createNewton()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getNewton();
+
+ /**
+ * Returns by pointer, unit of force: pound-force.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPoundForce()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createPoundForce(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of force: pound-force.
+ * Also see {@link #createPoundForce()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPoundForce();
+
+ /**
+ * Returns by pointer, unit of frequency: gigahertz.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGigahertz()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createGigahertz(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of frequency: gigahertz.
+ * Also see {@link #createGigahertz()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGigahertz();
+
+ /**
+ * Returns by pointer, unit of frequency: hertz.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getHertz()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createHertz(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of frequency: hertz.
+ * Also see {@link #createHertz()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getHertz();
+
+ /**
+ * Returns by pointer, unit of frequency: kilohertz.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilohertz()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKilohertz(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of frequency: kilohertz.
+ * Also see {@link #createKilohertz()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilohertz();
+
+ /**
+ * Returns by pointer, unit of frequency: megahertz.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMegahertz()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMegahertz(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of frequency: megahertz.
+ * Also see {@link #createMegahertz()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMegahertz();
+
+ /**
+ * Returns by pointer, unit of graphics: dot.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDot()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createDot(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: dot.
+ * Also see {@link #createDot()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getDot();
+
+ /**
+ * Returns by pointer, unit of graphics: dot-per-centimeter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDotPerCentimeter()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createDotPerCentimeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: dot-per-centimeter.
+ * Also see {@link #createDotPerCentimeter()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getDotPerCentimeter();
+
+ /**
+ * Returns by pointer, unit of graphics: dot-per-inch.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDotPerInch()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createDotPerInch(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: dot-per-inch.
+ * Also see {@link #createDotPerInch()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getDotPerInch();
+
+ /**
+ * Returns by pointer, unit of graphics: em.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getEm()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createEm(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: em.
+ * Also see {@link #createEm()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getEm();
+
+ /**
+ * Returns by pointer, unit of graphics: megapixel.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMegapixel()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createMegapixel(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: megapixel.
+ * Also see {@link #createMegapixel()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getMegapixel();
+
+ /**
+ * Returns by pointer, unit of graphics: pixel.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPixel()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createPixel(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: pixel.
+ * Also see {@link #createPixel()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getPixel();
+
+ /**
+ * Returns by pointer, unit of graphics: pixel-per-centimeter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPixelPerCentimeter()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createPixelPerCentimeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: pixel-per-centimeter.
+ * Also see {@link #createPixelPerCentimeter()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getPixelPerCentimeter();
+
+ /**
+ * Returns by pointer, unit of graphics: pixel-per-inch.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPixelPerInch()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createPixelPerInch(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of graphics: pixel-per-inch.
+ * Also see {@link #createPixelPerInch()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getPixelPerInch();
+
+ /**
+ * Returns by pointer, unit of length: astronomical-unit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getAstronomicalUnit()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createAstronomicalUnit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: astronomical-unit.
+ * Also see {@link #createAstronomicalUnit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getAstronomicalUnit();
+
+ /**
+ * Returns by pointer, unit of length: centimeter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCentimeter()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createCentimeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: centimeter.
+ * Also see {@link #createCentimeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCentimeter();
+
+ /**
+ * Returns by pointer, unit of length: decimeter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDecimeter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createDecimeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: decimeter.
+ * Also see {@link #createDecimeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getDecimeter();
+
+ /**
+ * Returns by pointer, unit of length: earth-radius.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getEarthRadius()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createEarthRadius(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: earth-radius.
+ * Also see {@link #createEarthRadius()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getEarthRadius();
+
+ /**
+ * Returns by pointer, unit of length: fathom.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getFathom()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createFathom(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: fathom.
+ * Also see {@link #createFathom()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getFathom();
+
+ /**
+ * Returns by pointer, unit of length: foot.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getFoot()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createFoot(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: foot.
+ * Also see {@link #createFoot()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getFoot();
+
+ /**
+ * Returns by pointer, unit of length: furlong.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getFurlong()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createFurlong(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: furlong.
+ * Also see {@link #createFurlong()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getFurlong();
+
+ /**
+ * Returns by pointer, unit of length: inch.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getInch()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createInch(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: inch.
+ * Also see {@link #createInch()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getInch();
+
+ /**
+ * Returns by pointer, unit of length: kilometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilometer()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createKilometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: kilometer.
+ * Also see {@link #createKilometer()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilometer();
+
+ /**
+ * Returns by pointer, unit of length: light-year.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getLightYear()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createLightYear(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: light-year.
+ * Also see {@link #createLightYear()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getLightYear();
+
+ /**
+ * Returns by pointer, unit of length: meter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMeter()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: meter.
+ * Also see {@link #createMeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMeter();
+
+ /**
+ * Returns by pointer, unit of length: micrometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMicrometer()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMicrometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: micrometer.
+ * Also see {@link #createMicrometer()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMicrometer();
+
+ /**
+ * Returns by pointer, unit of length: mile.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMile()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMile(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: mile.
+ * Also see {@link #createMile()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMile();
+
+ /**
+ * Returns by pointer, unit of length: mile-scandinavian.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMileScandinavian()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createMileScandinavian(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: mile-scandinavian.
+ * Also see {@link #createMileScandinavian()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMileScandinavian();
+
+ /**
+ * Returns by pointer, unit of length: millimeter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMillimeter()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMillimeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: millimeter.
+ * Also see {@link #createMillimeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMillimeter();
+
+ /**
+ * Returns by pointer, unit of length: nanometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getNanometer()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createNanometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: nanometer.
+ * Also see {@link #createNanometer()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getNanometer();
+
+ /**
+ * Returns by pointer, unit of length: nautical-mile.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getNauticalMile()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createNauticalMile(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: nautical-mile.
+ * Also see {@link #createNauticalMile()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getNauticalMile();
+
+ /**
+ * Returns by pointer, unit of length: parsec.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getParsec()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createParsec(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: parsec.
+ * Also see {@link #createParsec()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getParsec();
+
+ /**
+ * Returns by pointer, unit of length: picometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPicometer()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createPicometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: picometer.
+ * Also see {@link #createPicometer()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPicometer();
+
+ /**
+ * Returns by pointer, unit of length: point.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPoint()}.
+ * @param status ICU error code.
+ * @stable ICU 59
+ */
+ static MeasureUnit *createPoint(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: point.
+ * Also see {@link #createPoint()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPoint();
+
+ /**
+ * Returns by pointer, unit of length: solar-radius.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSolarRadius()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createSolarRadius(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: solar-radius.
+ * Also see {@link #createSolarRadius()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSolarRadius();
+
+ /**
+ * Returns by pointer, unit of length: yard.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getYard()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createYard(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of length: yard.
+ * Also see {@link #createYard()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getYard();
+
+ /**
+ * Returns by pointer, unit of light: candela.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCandela()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createCandela(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of light: candela.
+ * Also see {@link #createCandela()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getCandela();
+
+ /**
+ * Returns by pointer, unit of light: lumen.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getLumen()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createLumen(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of light: lumen.
+ * Also see {@link #createLumen()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getLumen();
+
+ /**
+ * Returns by pointer, unit of light: lux.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getLux()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createLux(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of light: lux.
+ * Also see {@link #createLux()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getLux();
+
+ /**
+ * Returns by pointer, unit of light: solar-luminosity.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSolarLuminosity()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createSolarLuminosity(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of light: solar-luminosity.
+ * Also see {@link #createSolarLuminosity()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSolarLuminosity();
+
+ /**
+ * Returns by pointer, unit of mass: carat.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCarat()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCarat(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: carat.
+ * Also see {@link #createCarat()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCarat();
+
+ /**
+ * Returns by pointer, unit of mass: dalton.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDalton()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createDalton(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: dalton.
+ * Also see {@link #createDalton()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getDalton();
+
+ /**
+ * Returns by pointer, unit of mass: earth-mass.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getEarthMass()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createEarthMass(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: earth-mass.
+ * Also see {@link #createEarthMass()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getEarthMass();
+
+ /**
+ * Returns by pointer, unit of mass: grain.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGrain()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createGrain(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: grain.
+ * Also see {@link #createGrain()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getGrain();
+
+ /**
+ * Returns by pointer, unit of mass: gram.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGram()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createGram(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: gram.
+ * Also see {@link #createGram()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGram();
+
+ /**
+ * Returns by pointer, unit of mass: kilogram.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilogram()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createKilogram(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: kilogram.
+ * Also see {@link #createKilogram()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilogram();
+
+ /**
+ * Returns by pointer, unit of mass: microgram.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMicrogram()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMicrogram(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: microgram.
+ * Also see {@link #createMicrogram()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMicrogram();
+
+ /**
+ * Returns by pointer, unit of mass: milligram.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilligram()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMilligram(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: milligram.
+ * Also see {@link #createMilligram()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilligram();
+
+ /**
+ * Returns by pointer, unit of mass: ounce.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getOunce()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createOunce(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: ounce.
+ * Also see {@link #createOunce()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getOunce();
+
+ /**
+ * Returns by pointer, unit of mass: ounce-troy.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getOunceTroy()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createOunceTroy(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: ounce-troy.
+ * Also see {@link #createOunceTroy()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getOunceTroy();
+
+ /**
+ * Returns by pointer, unit of mass: pound.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPound()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createPound(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: pound.
+ * Also see {@link #createPound()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPound();
+
+ /**
+ * Returns by pointer, unit of mass: solar-mass.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getSolarMass()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createSolarMass(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: solar-mass.
+ * Also see {@link #createSolarMass()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getSolarMass();
+
+ /**
+ * Returns by pointer, unit of mass: stone.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getStone()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createStone(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: stone.
+ * Also see {@link #createStone()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getStone();
+
+ /**
+ * Returns by pointer, unit of mass: ton.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getTon()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createTon(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: ton.
+ * Also see {@link #createTon()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getTon();
+
+ /**
+ * Returns by pointer, unit of mass: tonne.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getTonne()}.
+ * @param status ICU error code.
+ * @stable ICU 72
+ */
+ static MeasureUnit *createTonne(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: tonne.
+ * Also see {@link #createTonne()}.
+ * @stable ICU 72
+ */
+ static MeasureUnit getTonne();
+
+ /**
+ * Returns by pointer, unit of mass: metric-ton
+ * (renamed to tonne in CLDR 42 / ICU 72).
+ * Caller owns returned value and must free it.
+ * Note: In ICU 74 this will be deprecated in favor of
+ * createTonne(), which is currently draft but will
+ * become stable in ICU 74, and which uses the preferred naming.
+ * Also see {@link #getMetricTon()} and {@link #createTonne()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMetricTon(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of mass: metric-ton
+ * (renamed to tonne in CLDR 42 / ICU 72).
+ * Note: In ICU 74 this will be deprecated in favor of
+ * getTonne(), which is currently draft but will
+ * become stable in ICU 74, and which uses the preferred naming.
+ * Also see {@link #createMetricTon()} and {@link #getTonne()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMetricTon();
+
+ /**
+ * Returns by pointer, unit of power: gigawatt.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGigawatt()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createGigawatt(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of power: gigawatt.
+ * Also see {@link #createGigawatt()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGigawatt();
+
+ /**
+ * Returns by pointer, unit of power: horsepower.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getHorsepower()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createHorsepower(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of power: horsepower.
+ * Also see {@link #createHorsepower()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getHorsepower();
+
+ /**
+ * Returns by pointer, unit of power: kilowatt.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilowatt()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createKilowatt(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of power: kilowatt.
+ * Also see {@link #createKilowatt()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilowatt();
+
+ /**
+ * Returns by pointer, unit of power: megawatt.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMegawatt()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMegawatt(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of power: megawatt.
+ * Also see {@link #createMegawatt()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMegawatt();
+
+ /**
+ * Returns by pointer, unit of power: milliwatt.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilliwatt()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMilliwatt(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of power: milliwatt.
+ * Also see {@link #createMilliwatt()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilliwatt();
+
+ /**
+ * Returns by pointer, unit of power: watt.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getWatt()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createWatt(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of power: watt.
+ * Also see {@link #createWatt()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getWatt();
+
+ /**
+ * Returns by pointer, unit of pressure: atmosphere.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getAtmosphere()}.
+ * @param status ICU error code.
+ * @stable ICU 63
+ */
+ static MeasureUnit *createAtmosphere(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: atmosphere.
+ * Also see {@link #createAtmosphere()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getAtmosphere();
+
+ /**
+ * Returns by pointer, unit of pressure: bar.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getBar()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createBar(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: bar.
+ * Also see {@link #createBar()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getBar();
+
+ /**
+ * Returns by pointer, unit of pressure: gasoline-energy-density.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGasolineEnergyDensity()}.
+ * @param status ICU error code.
+ * @stable ICU 74
+ */
+ static MeasureUnit *createGasolineEnergyDensity(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: gasoline-energy-density.
+ * Also see {@link #createGasolineEnergyDensity()}.
+ * @stable ICU 74
+ */
+ static MeasureUnit getGasolineEnergyDensity();
+
+ /**
+ * Returns by pointer, unit of pressure: hectopascal.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getHectopascal()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createHectopascal(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: hectopascal.
+ * Also see {@link #createHectopascal()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getHectopascal();
+
+ /**
+ * Returns by pointer, unit of pressure: inch-ofhg.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getInchHg()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createInchHg(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: inch-ofhg.
+ * Also see {@link #createInchHg()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getInchHg();
+
+ /**
+ * Returns by pointer, unit of pressure: kilopascal.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilopascal()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createKilopascal(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: kilopascal.
+ * Also see {@link #createKilopascal()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilopascal();
+
+ /**
+ * Returns by pointer, unit of pressure: megapascal.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMegapascal()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createMegapascal(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: megapascal.
+ * Also see {@link #createMegapascal()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMegapascal();
+
+ /**
+ * Returns by pointer, unit of pressure: millibar.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMillibar()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMillibar(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: millibar.
+ * Also see {@link #createMillibar()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMillibar();
+
+ /**
+ * Returns by pointer, unit of pressure: millimeter-ofhg.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMillimeterOfMercury()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMillimeterOfMercury(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: millimeter-ofhg.
+ * Also see {@link #createMillimeterOfMercury()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMillimeterOfMercury();
+
+ /**
+ * Returns by pointer, unit of pressure: pascal.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPascal()}.
+ * @param status ICU error code.
+ * @stable ICU 65
+ */
+ static MeasureUnit *createPascal(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: pascal.
+ * Also see {@link #createPascal()}.
+ * @stable ICU 65
+ */
+ static MeasureUnit getPascal();
+
+ /**
+ * Returns by pointer, unit of pressure: pound-force-per-square-inch.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPoundPerSquareInch()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createPoundPerSquareInch(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of pressure: pound-force-per-square-inch.
+ * Also see {@link #createPoundPerSquareInch()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPoundPerSquareInch();
+
+ /**
+ * Returns by pointer, unit of speed: beaufort.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getBeaufort()}.
+ * @param status ICU error code.
+ * @stable ICU 73
+ */
+ static MeasureUnit *createBeaufort(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of speed: beaufort.
+ * Also see {@link #createBeaufort()}.
+ * @stable ICU 73
+ */
+ static MeasureUnit getBeaufort();
+
+ /**
+ * Returns by pointer, unit of speed: kilometer-per-hour.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKilometerPerHour()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createKilometerPerHour(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of speed: kilometer-per-hour.
+ * Also see {@link #createKilometerPerHour()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKilometerPerHour();
+
+ /**
+ * Returns by pointer, unit of speed: knot.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKnot()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createKnot(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of speed: knot.
+ * Also see {@link #createKnot()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKnot();
+
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Returns by pointer, unit of speed: light-speed.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getLightSpeed()}.
+ * @param status ICU error code.
+ * @draft ICU 76
+ */
+ static MeasureUnit *createLightSpeed(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of speed: light-speed.
+ * Also see {@link #createLightSpeed()}.
+ * @draft ICU 76
+ */
+ static MeasureUnit getLightSpeed();
+#endif /* U_HIDE_DRAFT_API */
+
+ /**
+ * Returns by pointer, unit of speed: meter-per-second.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMeterPerSecond()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMeterPerSecond(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of speed: meter-per-second.
+ * Also see {@link #createMeterPerSecond()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMeterPerSecond();
+
+ /**
+ * Returns by pointer, unit of speed: mile-per-hour.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilePerHour()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createMilePerHour(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of speed: mile-per-hour.
+ * Also see {@link #createMilePerHour()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilePerHour();
+
+ /**
+ * Returns by pointer, unit of temperature: celsius.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCelsius()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createCelsius(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of temperature: celsius.
+ * Also see {@link #createCelsius()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCelsius();
+
+ /**
+ * Returns by pointer, unit of temperature: fahrenheit.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getFahrenheit()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createFahrenheit(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of temperature: fahrenheit.
+ * Also see {@link #createFahrenheit()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getFahrenheit();
+
+ /**
+ * Returns by pointer, unit of temperature: generic.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGenericTemperature()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createGenericTemperature(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of temperature: generic.
+ * Also see {@link #createGenericTemperature()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGenericTemperature();
+
+ /**
+ * Returns by pointer, unit of temperature: kelvin.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getKelvin()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createKelvin(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of temperature: kelvin.
+ * Also see {@link #createKelvin()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getKelvin();
+
+ /**
+ * Returns by pointer, unit of torque: newton-meter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getNewtonMeter()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createNewtonMeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of torque: newton-meter.
+ * Also see {@link #createNewtonMeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getNewtonMeter();
+
+ /**
+ * Returns by pointer, unit of torque: pound-force-foot.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPoundFoot()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createPoundFoot(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of torque: pound-force-foot.
+ * Also see {@link #createPoundFoot()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPoundFoot();
+
+ /**
+ * Returns by pointer, unit of volume: acre-foot.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getAcreFoot()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createAcreFoot(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: acre-foot.
+ * Also see {@link #createAcreFoot()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getAcreFoot();
+
+ /**
+ * Returns by pointer, unit of volume: barrel.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getBarrel()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createBarrel(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: barrel.
+ * Also see {@link #createBarrel()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getBarrel();
+
+ /**
+ * Returns by pointer, unit of volume: bushel.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getBushel()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createBushel(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: bushel.
+ * Also see {@link #createBushel()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getBushel();
+
+ /**
+ * Returns by pointer, unit of volume: centiliter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCentiliter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCentiliter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: centiliter.
+ * Also see {@link #createCentiliter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCentiliter();
+
+ /**
+ * Returns by pointer, unit of volume: cubic-centimeter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCubicCentimeter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCubicCentimeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cubic-centimeter.
+ * Also see {@link #createCubicCentimeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCubicCentimeter();
+
+ /**
+ * Returns by pointer, unit of volume: cubic-foot.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCubicFoot()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCubicFoot(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cubic-foot.
+ * Also see {@link #createCubicFoot()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCubicFoot();
+
+ /**
+ * Returns by pointer, unit of volume: cubic-inch.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCubicInch()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCubicInch(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cubic-inch.
+ * Also see {@link #createCubicInch()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCubicInch();
+
+ /**
+ * Returns by pointer, unit of volume: cubic-kilometer.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCubicKilometer()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createCubicKilometer(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cubic-kilometer.
+ * Also see {@link #createCubicKilometer()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCubicKilometer();
+
+ /**
+ * Returns by pointer, unit of volume: cubic-meter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCubicMeter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCubicMeter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cubic-meter.
+ * Also see {@link #createCubicMeter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCubicMeter();
+
+ /**
+ * Returns by pointer, unit of volume: cubic-mile.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCubicMile()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createCubicMile(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cubic-mile.
+ * Also see {@link #createCubicMile()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCubicMile();
+
+ /**
+ * Returns by pointer, unit of volume: cubic-yard.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCubicYard()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCubicYard(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cubic-yard.
+ * Also see {@link #createCubicYard()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCubicYard();
+
+ /**
+ * Returns by pointer, unit of volume: cup.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCup()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createCup(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cup.
+ * Also see {@link #createCup()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCup();
+
+ /**
+ * Returns by pointer, unit of volume: cup-metric.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getCupMetric()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createCupMetric(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: cup-metric.
+ * Also see {@link #createCupMetric()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getCupMetric();
+
+ /**
+ * Returns by pointer, unit of volume: deciliter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDeciliter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createDeciliter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: deciliter.
+ * Also see {@link #createDeciliter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getDeciliter();
+
+ /**
+ * Returns by pointer, unit of volume: dessert-spoon.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDessertSpoon()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createDessertSpoon(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: dessert-spoon.
+ * Also see {@link #createDessertSpoon()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getDessertSpoon();
+
+ /**
+ * Returns by pointer, unit of volume: dessert-spoon-imperial.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDessertSpoonImperial()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createDessertSpoonImperial(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: dessert-spoon-imperial.
+ * Also see {@link #createDessertSpoonImperial()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getDessertSpoonImperial();
+
+ /**
+ * Returns by pointer, unit of volume: dram.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDram()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createDram(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: dram.
+ * Also see {@link #createDram()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getDram();
+
+ /**
+ * Returns by pointer, unit of volume: drop.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getDrop()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createDrop(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: drop.
+ * Also see {@link #createDrop()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getDrop();
+
+ /**
+ * Returns by pointer, unit of volume: fluid-ounce.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getFluidOunce()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createFluidOunce(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: fluid-ounce.
+ * Also see {@link #createFluidOunce()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getFluidOunce();
+
+ /**
+ * Returns by pointer, unit of volume: fluid-ounce-imperial.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getFluidOunceImperial()}.
+ * @param status ICU error code.
+ * @stable ICU 64
+ */
+ static MeasureUnit *createFluidOunceImperial(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: fluid-ounce-imperial.
+ * Also see {@link #createFluidOunceImperial()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getFluidOunceImperial();
+
+ /**
+ * Returns by pointer, unit of volume: gallon.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGallon()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createGallon(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: gallon.
+ * Also see {@link #createGallon()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGallon();
+
+ /**
+ * Returns by pointer, unit of volume: gallon-imperial.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getGallonImperial()}.
+ * @param status ICU error code.
+ * @stable ICU 57
+ */
+ static MeasureUnit *createGallonImperial(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: gallon-imperial.
+ * Also see {@link #createGallonImperial()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getGallonImperial();
+
+ /**
+ * Returns by pointer, unit of volume: hectoliter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getHectoliter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createHectoliter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: hectoliter.
+ * Also see {@link #createHectoliter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getHectoliter();
+
+ /**
+ * Returns by pointer, unit of volume: jigger.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getJigger()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createJigger(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: jigger.
+ * Also see {@link #createJigger()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getJigger();
+
+ /**
+ * Returns by pointer, unit of volume: liter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getLiter()}.
+ * @param status ICU error code.
+ * @stable ICU 53
+ */
+ static MeasureUnit *createLiter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: liter.
+ * Also see {@link #createLiter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getLiter();
+
+ /**
+ * Returns by pointer, unit of volume: megaliter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMegaliter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMegaliter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: megaliter.
+ * Also see {@link #createMegaliter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMegaliter();
+
+ /**
+ * Returns by pointer, unit of volume: milliliter.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getMilliliter()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createMilliliter(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: milliliter.
+ * Also see {@link #createMilliliter()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getMilliliter();
+
+ /**
+ * Returns by pointer, unit of volume: pinch.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPinch()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createPinch(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: pinch.
+ * Also see {@link #createPinch()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getPinch();
+
+ /**
+ * Returns by pointer, unit of volume: pint.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPint()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createPint(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: pint.
+ * Also see {@link #createPint()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPint();
+
+ /**
+ * Returns by pointer, unit of volume: pint-metric.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getPintMetric()}.
+ * @param status ICU error code.
+ * @stable ICU 56
+ */
+ static MeasureUnit *createPintMetric(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: pint-metric.
+ * Also see {@link #createPintMetric()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getPintMetric();
+
+ /**
+ * Returns by pointer, unit of volume: quart.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getQuart()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createQuart(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: quart.
+ * Also see {@link #createQuart()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getQuart();
+
+ /**
+ * Returns by pointer, unit of volume: quart-imperial.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getQuartImperial()}.
+ * @param status ICU error code.
+ * @stable ICU 68
+ */
+ static MeasureUnit *createQuartImperial(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: quart-imperial.
+ * Also see {@link #createQuartImperial()}.
+ * @stable ICU 68
+ */
+ static MeasureUnit getQuartImperial();
+
+ /**
+ * Returns by pointer, unit of volume: tablespoon.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getTablespoon()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createTablespoon(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: tablespoon.
+ * Also see {@link #createTablespoon()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getTablespoon();
+
+ /**
+ * Returns by pointer, unit of volume: teaspoon.
+ * Caller owns returned value and must free it.
+ * Also see {@link #getTeaspoon()}.
+ * @param status ICU error code.
+ * @stable ICU 54
+ */
+ static MeasureUnit *createTeaspoon(UErrorCode &status);
+
+ /**
+ * Returns by value, unit of volume: teaspoon.
+ * Also see {@link #createTeaspoon()}.
+ * @stable ICU 64
+ */
+ static MeasureUnit getTeaspoon();
+
+// End generated createXXX methods
+
+ protected:
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * For ICU use only.
+ * @internal
+ */
+ void initTime(const char *timeId);
+
+ /**
+ * For ICU use only.
+ * @internal
+ */
+ void initCurrency(StringPiece isoCurrency);
+
+#endif /* U_HIDE_INTERNAL_API */
+
+private:
+
+ // Used by new draft APIs in ICU 67. If non-null, fImpl is owned by the
+ // MeasureUnit.
+ MeasureUnitImpl* fImpl;
+
+ // An index into a static string list in measunit.cpp. If set to -1, fImpl
+ // is in use instead of fTypeId and fSubTypeId.
+ int16_t fSubTypeId;
+ // An index into a static string list in measunit.cpp. If set to -1, fImpl
+ // is in use instead of fTypeId and fSubTypeId.
+ int8_t fTypeId;
+
+ MeasureUnit(int32_t typeId, int32_t subTypeId);
+ MeasureUnit(MeasureUnitImpl&& impl);
+ void setTo(int32_t typeId, int32_t subTypeId);
+ static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status);
+
+ /**
+ * Sets output's typeId and subTypeId according to subType, if subType is a
+ * valid/known identifier.
+ *
+ * @return Whether subType is known to ICU. If false, output was not
+ * modified.
+ */
+ static bool findBySubType(StringPiece subType, MeasureUnit* output);
+
+ /** Internal version of public API */
+ LocalArray
+ * . Base* polymorphic_pointer = createPolymorphicObject();
+ * . if (polymorphic_pointer->getDynamicClassID() ==
+ * . erived::getStaticClassID()) ...
+ *
+ * @return The class ID for all objects of this class.
+ * @stable ICU 53
+ */
+ static UClassID U_EXPORT2 getStaticClassID();
+
+ /**
+ * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
+ * method is to implement a simple version of RTTI, since not all C++
+ * compilers support genuine RTTI. Polymorphic operator==() and clone()
+ * methods call this method.
+ *
+ * @return The class ID for this object. All objects of a
+ * given class have the same class ID. Objects of
+ * other classes have different class IDs.
+ * @stable ICU 53
+ */
+ virtual UClassID getDynamicClassID() const override;
+
+ protected:
+ /**
+ * Default constructor.
+ * @stable ICU 3.0
+ */
+ Measure();
+
+ private:
+ /**
+ * The numeric value of this object, e.g. 2.54 or 100.
+ */
+ Formattable number;
+
+ /**
+ * The unit of this object, e.g., "millimeter" or "JPY". This is
+ * owned by this object.
+ */
+ MeasureUnit* unit;
+};
+
+inline const Formattable& Measure::getNumber() const {
+ return number;
+}
+
+inline const MeasureUnit& Measure::getUnit() const {
+ return *unit;
+}
+
+U_NAMESPACE_END
+
+#endif // !UCONFIG_NO_FORMATTING
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+
+#endif // __MEASURE_H__
diff --git a/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/messageformat2.h b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/messageformat2.h
new file mode 100644
index 0000000000..926d14318d
--- /dev/null
+++ b/packages/php-wasm/compile/libintl/asyncify/dist/root/lib/include/unicode/messageformat2.h
@@ -0,0 +1,476 @@
+// © 2024 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+#include "unicode/utypes.h"
+
+#ifndef MESSAGEFORMAT2_H
+#define MESSAGEFORMAT2_H
+
+#if U_SHOW_CPLUSPLUS_API
+
+#if !UCONFIG_NO_NORMALIZATION
+
+#if !UCONFIG_NO_FORMATTING
+
+#if !UCONFIG_NO_MF2
+
+/**
+ * \file
+ * \brief C++ API: Formats messages using the draft MessageFormat 2.0.
+ */
+
+#include "unicode/messageformat2_arguments.h"
+#include "unicode/messageformat2_data_model.h"
+#include "unicode/messageformat2_function_registry.h"
+#include "unicode/normalizer2.h"
+#include "unicode/unistr.h"
+
+#ifndef U_HIDE_DEPRECATED_API
+
+U_NAMESPACE_BEGIN
+
+namespace message2 {
+
+ class Environment;
+ class MessageContext;
+ class StaticErrors;
+ class InternalValue;
+
+ /**
+ *