diff options
Diffstat (limited to 'deps/icu-small/source/i18n/unicode')
78 files changed, 483 insertions, 341 deletions
diff --git a/deps/icu-small/source/i18n/unicode/alphaindex.h b/deps/icu-small/source/i18n/unicode/alphaindex.h index e9e8739ed2..54bd29ff88 100644 --- a/deps/icu-small/source/i18n/unicode/alphaindex.h +++ b/deps/icu-small/source/i18n/unicode/alphaindex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -15,6 +15,7 @@ #include "unicode/utypes.h" #include "unicode/uobject.h" #include "unicode/locid.h" +#include "unicode/unistr.h" #if !UCONFIG_NO_COLLATION diff --git a/deps/icu-small/source/i18n/unicode/basictz.h b/deps/icu-small/source/i18n/unicode/basictz.h index 8da4a00bf8..eb62abaf0a 100644 --- a/deps/icu-small/source/i18n/unicode/basictz.h +++ b/deps/icu-small/source/i18n/unicode/basictz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/calendar.h b/deps/icu-small/source/i18n/unicode/calendar.h index b7da5f3c5b..e43c181c8a 100644 --- a/deps/icu-small/source/i18n/unicode/calendar.h +++ b/deps/icu-small/source/i18n/unicode/calendar.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/choicfmt.h b/deps/icu-small/source/i18n/unicode/choicfmt.h index ab3c28fe07..c9f0f1114f 100644 --- a/deps/icu-small/source/i18n/unicode/choicfmt.h +++ b/deps/icu-small/source/i18n/unicode/choicfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/coleitr.h b/deps/icu-small/source/i18n/unicode/coleitr.h index 628b461f94..bf0e1d51a4 100644 --- a/deps/icu-small/source/i18n/unicode/coleitr.h +++ b/deps/icu-small/source/i18n/unicode/coleitr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -47,6 +47,7 @@ U_NAMESPACE_BEGIN struct CollationData; +class CharacterIterator; class CollationIterator; class RuleBasedCollator; class UCollationPCE; diff --git a/deps/icu-small/source/i18n/unicode/coll.h b/deps/icu-small/source/i18n/unicode/coll.h index e41be2ee81..7e467df80e 100644 --- a/deps/icu-small/source/i18n/unicode/coll.h +++ b/deps/icu-small/source/i18n/unicode/coll.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -58,7 +58,7 @@ #include "unicode/uobject.h" #include "unicode/ucol.h" -#include "unicode/normlzr.h" +#include "unicode/unorm.h" #include "unicode/locid.h" #include "unicode/uniset.h" #include "unicode/umisc.h" @@ -158,7 +158,7 @@ class CollationKey; * @see CollationKey * @see CollationElementIterator * @see Locale -* @see Normalizer +* @see Normalizer2 * @version 2.0 11/15/01 */ @@ -393,8 +393,8 @@ public: * is less than, greater than or equal to another string array. * <p>Example of use: * <pre> - * . UChar ABC[] = {0x41, 0x42, 0x43, 0}; // = "ABC" - * . UChar abc[] = {0x61, 0x62, 0x63, 0}; // = "abc" + * . 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); @@ -420,8 +420,8 @@ public: * target * @deprecated ICU 2.6 use the overload with UErrorCode & */ - virtual EComparisonResult compare(const UChar* source, int32_t sourceLength, - const UChar* target, int32_t targetLength) + virtual EComparisonResult compare(const char16_t* source, int32_t sourceLength, + const char16_t* target, int32_t targetLength) const; /** @@ -440,8 +440,8 @@ public: * than target * @stable ICU 2.6 */ - virtual UCollationResult compare(const UChar* source, int32_t sourceLength, - const UChar* target, int32_t targetLength, + virtual UCollationResult compare(const char16_t* source, int32_t sourceLength, + const char16_t* target, int32_t targetLength, UErrorCode &status) const = 0; /** @@ -517,7 +517,7 @@ public: * @see CollationKey#compare * @stable ICU 2.0 */ - virtual CollationKey& getCollationKey(const UChar*source, + virtual CollationKey& getCollationKey(const char16_t*source, int32_t sourceLength, CollationKey& key, UErrorCode& status) const = 0; @@ -911,7 +911,7 @@ public: * the top of one of the supported reordering groups, * and it must not be beyond the last of those groups. * See setMaxVariable(). - * @param varTop one or more (if contraction) UChars to which the variable top should be set + * @param varTop one or more (if contraction) char16_ts to which the variable top should be set * @param len length of variable top string. If -1 it is considered to be zero terminated. * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br> * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br> @@ -920,7 +920,7 @@ public: * @return variable top primary weight * @deprecated ICU 53 Call setMaxVariable() instead. */ - virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status) = 0; + 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. @@ -929,7 +929,7 @@ public: * 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 UChars to which the variable top should be set + * @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: <br> * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br> * U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond @@ -1002,7 +1002,7 @@ public: int32_t resultLength) const = 0; /** - * Get the sort key as an array of bytes from a UChar buffer. + * 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(). * @@ -1020,7 +1020,7 @@ public: * @return Number of bytes needed for storing the sort key * @stable ICU 2.2 */ - virtual int32_t getSortKey(const UChar*source, int32_t sourceLength, + virtual int32_t getSortKey(const char16_t*source, int32_t sourceLength, uint8_t*result, int32_t resultLength) const = 0; /** diff --git a/deps/icu-small/source/i18n/unicode/compactdecimalformat.h b/deps/icu-small/source/i18n/unicode/compactdecimalformat.h index 1fcc5c581e..3fbe5da9ce 100644 --- a/deps/icu-small/source/i18n/unicode/compactdecimalformat.h +++ b/deps/icu-small/source/i18n/unicode/compactdecimalformat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/curramt.h b/deps/icu-small/source/i18n/unicode/curramt.h index 268d53c0b1..03ec856e3b 100644 --- a/deps/icu-small/source/i18n/unicode/curramt.h +++ b/deps/icu-small/source/i18n/unicode/curramt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -46,7 +46,7 @@ class U_I18N_API CurrencyAmount: public Measure { * is invalid, then this will be set to a failing value. * @stable ICU 3.0 */ - CurrencyAmount(const Formattable& amount, const UChar* isoCode, + CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode, UErrorCode &ec); /** @@ -59,7 +59,7 @@ class U_I18N_API CurrencyAmount: public Measure { * then this will be set to a failing value. * @stable ICU 3.0 */ - CurrencyAmount(double amount, const UChar* isoCode, + CurrencyAmount(double amount, ConstChar16Ptr isoCode, UErrorCode &ec); /** @@ -115,14 +115,14 @@ class U_I18N_API CurrencyAmount: public Measure { * Return the ISO currency code of this object. * @stable ICU 3.0 */ - inline const UChar* getISOCurrency() const; + inline const char16_t* getISOCurrency() const; }; inline const CurrencyUnit& CurrencyAmount::getCurrency() const { return (const CurrencyUnit&) getUnit(); } -inline const UChar* CurrencyAmount::getISOCurrency() const { +inline const char16_t* CurrencyAmount::getISOCurrency() const { return getCurrency().getISOCurrency(); } diff --git a/deps/icu-small/source/i18n/unicode/currpinf.h b/deps/icu-small/source/i18n/unicode/currpinf.h index 133de38fc2..1a327c5bae 100644 --- a/deps/icu-small/source/i18n/unicode/currpinf.h +++ b/deps/icu-small/source/i18n/unicode/currpinf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/currunit.h b/deps/icu-small/source/i18n/unicode/currunit.h index 313c92a6ac..b72dc5e68d 100644 --- a/deps/icu-small/source/i18n/unicode/currunit.h +++ b/deps/icu-small/source/i18n/unicode/currunit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -28,7 +28,7 @@ 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 UChar string that + * yen). This class is a thin wrapper over a char16_t string that * subclasses MeasureUnit, for use with Measure and MeasureFormat. * * @author Alan Liu @@ -44,7 +44,7 @@ class U_I18N_API CurrencyUnit: public MeasureUnit { * then this will be set to a failing value. * @stable ICU 3.0 */ - CurrencyUnit(const UChar* isoCode, UErrorCode &ec); + CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec); /** * Copy constructor @@ -93,16 +93,16 @@ class U_I18N_API CurrencyUnit: public MeasureUnit { * Return the ISO currency code of this object. * @stable ICU 3.0 */ - inline const UChar* getISOCurrency() const; + inline const char16_t* getISOCurrency() const; private: /** * The ISO 4217 code of this object. */ - UChar isoCode[4]; + char16_t isoCode[4]; }; -inline const UChar* CurrencyUnit::getISOCurrency() const { +inline const char16_t* CurrencyUnit::getISOCurrency() const { return isoCode; } diff --git a/deps/icu-small/source/i18n/unicode/datefmt.h b/deps/icu-small/source/i18n/unicode/datefmt.h index 6e3a78f291..d70d8d1dd5 100644 --- a/deps/icu-small/source/i18n/unicode/datefmt.h +++ b/deps/icu-small/source/i18n/unicode/datefmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/dcfmtsym.h b/deps/icu-small/source/i18n/unicode/dcfmtsym.h index 946227addb..3a502d0ec0 100644 --- a/deps/icu-small/source/i18n/unicode/dcfmtsym.h +++ b/deps/icu-small/source/i18n/unicode/dcfmtsym.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -35,6 +35,7 @@ #include "unicode/uobject.h" #include "unicode/locid.h" #include "unicode/unum.h" +#include "unicode/unistr.h" /** * \file @@ -392,7 +393,7 @@ public: * Returns that pattern stored in currecy info. Internal API for use by NumberFormat API. * @internal */ - inline const UChar* getCurrencyPattern(void) const; + inline const char16_t* getCurrencyPattern(void) const; #endif /* U_HIDE_INTERNAL_API */ private: @@ -423,7 +424,7 @@ private: char actualLocale[ULOC_FULLNAME_CAPACITY]; char validLocale[ULOC_FULLNAME_CAPACITY]; - const UChar* currPattern; + const char16_t* currPattern; UnicodeString currencySpcBeforeSym[UNUM_CURRENCY_SPACING_COUNT]; UnicodeString currencySpcAfterSym[UNUM_CURRENCY_SPACING_COUNT]; @@ -491,7 +492,7 @@ DecimalFormatSymbols::getLocale() const { } #ifndef U_HIDE_INTERNAL_API -inline const UChar* +inline const char16_t* DecimalFormatSymbols::getCurrencyPattern() const { return currPattern; } diff --git a/deps/icu-small/source/i18n/unicode/decimfmt.h b/deps/icu-small/source/i18n/unicode/decimfmt.h index 7339399f72..1deff5bf92 100644 --- a/deps/icu-small/source/i18n/unicode/decimfmt.h +++ b/deps/icu-small/source/i18n/unicode/decimfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -604,7 +604,7 @@ template class U_I18N_API EnumSet<UNumberFormatAttribute, * including prefix and suffix, determines the format width. For example, in * the pattern <code>"* #0 o''clock"</code>, the format width is 10. * - * <li>The width is counted in 16-bit code units (UChars). + * <li>The width is counted in 16-bit code units (char16_ts). * * <li>Some parameters which usually do not matter have meaning when padding is * used, because the pattern width is significant with padding. In the pattern @@ -1961,14 +1961,14 @@ public: * @param ec input-output error code * @stable ICU 3.0 */ - virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec); + virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec); /** * Sets the currency used to display currency amounts. See - * setCurrency(const UChar*, UErrorCode&). - * @deprecated ICU 3.0. Use setCurrency(const UChar*, UErrorCode&). + * setCurrency(const char16_t*, UErrorCode&). + * @deprecated ICU 3.0. Use setCurrency(const char16_t*, UErrorCode&). */ - virtual void setCurrency(const UChar* theCurrency); + virtual void setCurrency(const char16_t* theCurrency); /** * Sets the <tt>Currency Context</tt> object used to display currency. @@ -2108,7 +2108,7 @@ private: void parse(const UnicodeString& text, Formattable& result, ParsePosition& pos, - UChar* currency) const; + char16_t* currency) const; enum { fgStatusInfinite, @@ -2124,7 +2124,7 @@ private: int8_t type, ParsePosition& parsePosition, DigitList& digits, UBool* status, - UChar* currency) const; + char16_t* currency) const; // Mixed style parsing for currency. // It parses against the current currency pattern @@ -2135,7 +2135,7 @@ private: ParsePosition& parsePosition, DigitList& digits, UBool* status, - UChar* currency) const; + char16_t* currency) const; int32_t skipPadding(const UnicodeString& text, int32_t position) const; @@ -2146,7 +2146,7 @@ private: const UnicodeString* affixPat, UBool complexCurrencyParsing, int8_t type, - UChar* currency) const; + char16_t* currency) const; static UnicodeString& trimMarksFromAffix(const UnicodeString& affix, UnicodeString& trimmedAffix); @@ -2169,7 +2169,7 @@ private: const UnicodeString& input, int32_t pos, int8_t type, - UChar* currency) const; + char16_t* currency) const; static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch); @@ -2195,11 +2195,11 @@ private: void setupCurrencyAffixPatterns(UErrorCode& status); // get the currency rounding with respect to currency usage - double getCurrencyRounding(const UChar* currency, + double getCurrencyRounding(const char16_t* currency, UErrorCode* ec) const; // get the currency fraction with respect to currency usage - int getCurrencyFractionDigits(const UChar* currency, + int getCurrencyFractionDigits(const char16_t* currency, UErrorCode* ec) const; // hashtable operations @@ -2271,7 +2271,7 @@ protected: * have a capacity of at least 4 * @internal */ - virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const; + virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const; /** number of integer digits * @stable ICU 2.4 diff --git a/deps/icu-small/source/i18n/unicode/dtfmtsym.h b/deps/icu-small/source/i18n/unicode/dtfmtsym.h index 507868e2c3..ed7c189846 100644 --- a/deps/icu-small/source/i18n/unicode/dtfmtsym.h +++ b/deps/icu-small/source/i18n/unicode/dtfmtsym.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -25,6 +25,7 @@ #if !UCONFIG_NO_FORMATTING #include "unicode/calendar.h" +#include "unicode/strenum.h" #include "unicode/uobject.h" #include "unicode/locid.h" #include "unicode/udat.h" @@ -426,13 +427,13 @@ public: * doesn't specify any time separator, and always recognized when parsing. * @internal */ - static const UChar DEFAULT_TIME_SEPARATOR = 0x003a; // ':' + static const char16_t DEFAULT_TIME_SEPARATOR = 0x003a; // ':' /** * This alternate time separator is always recognized when parsing. * @internal */ - static const UChar ALTERNATE_TIME_SEPARATOR = 0x002e; // '.' + static const char16_t ALTERNATE_TIME_SEPARATOR = 0x002e; // '.' /** * Gets the time separator string. For example: ":". @@ -566,7 +567,7 @@ public: * @return the non-localized date-time pattern characters * @stable ICU 2.0 */ - static const UChar * U_EXPORT2 getPatternUChars(void); + static const char16_t * U_EXPORT2 getPatternUChars(void); /** * Gets localized date-time pattern characters. For example: 'u', 't', etc. @@ -977,7 +978,7 @@ private: * 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(UChar c); + static UDateFormatField U_EXPORT2 getPatternCharIndex(char16_t c); /** * Returns TRUE if f (with its pattern character repeated count times) is a numeric field. @@ -987,7 +988,7 @@ private: /** * Returns TRUE if c (repeated count times) is the pattern character for a numeric field. */ - static UBool U_EXPORT2 isNumericPatternChar(UChar c, int32_t count); + static UBool U_EXPORT2 isNumericPatternChar(char16_t c, int32_t count); public: #ifndef U_HIDE_INTERNAL_API /** diff --git a/deps/icu-small/source/i18n/unicode/dtitvfmt.h b/deps/icu-small/source/i18n/unicode/dtitvfmt.h index 68360b87df..5eaa559d0e 100644 --- a/deps/icu-small/source/i18n/unicode/dtitvfmt.h +++ b/deps/icu-small/source/i18n/unicode/dtitvfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 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 @@ -996,7 +996,7 @@ private: // from calendar field to pattern letter - static const UChar fgCalendarFieldToPatternLetter[]; + static const char16_t fgCalendarFieldToPatternLetter[]; /** diff --git a/deps/icu-small/source/i18n/unicode/dtitvinf.h b/deps/icu-small/source/i18n/unicode/dtitvinf.h index b31061e16a..e537bed0c9 100644 --- a/deps/icu-small/source/i18n/unicode/dtitvinf.h +++ b/deps/icu-small/source/i18n/unicode/dtitvinf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/dtptngen.h b/deps/icu-small/source/i18n/unicode/dtptngen.h index fd617ce3cd..6fd5f5fd30 100644 --- a/deps/icu-small/source/i18n/unicode/dtptngen.h +++ b/deps/icu-small/source/i18n/unicode/dtptngen.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -27,6 +27,7 @@ U_NAMESPACE_BEGIN */ +class CharString; class Hashtable; class FormatParser; class DateTimeMatcher; @@ -517,7 +518,7 @@ private: DateTimeMatcher *skipMatcher; Hashtable *fAvailableFormatKeyHash; UnicodeString emptyString; - UChar fDefaultHourFormatChar; + char16_t fDefaultHourFormatChar; int32_t fAllowedHourFormats[7]; // Actually an array of AllowedHourFormat enum type, ending with UNKNOWN. diff --git a/deps/icu-small/source/i18n/unicode/dtrule.h b/deps/icu-small/source/i18n/unicode/dtrule.h index 32d230ea77..24dfc69de1 100644 --- a/deps/icu-small/source/i18n/unicode/dtrule.h +++ b/deps/icu-small/source/i18n/unicode/dtrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/fieldpos.h b/deps/icu-small/source/i18n/unicode/fieldpos.h index 6091941106..78561a4de7 100644 --- a/deps/icu-small/source/i18n/unicode/fieldpos.h +++ b/deps/icu-small/source/i18n/unicode/fieldpos.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/fmtable.h b/deps/icu-small/source/i18n/unicode/fmtable.h index ac5daba893..766a71969d 100644 --- a/deps/icu-small/source/i18n/unicode/fmtable.h +++ b/deps/icu-small/source/i18n/unicode/fmtable.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/format.h b/deps/icu-small/source/i18n/unicode/format.h index 1484e9f00e..e64cc1c6eb 100644 --- a/deps/icu-small/source/i18n/unicode/format.h +++ b/deps/icu-small/source/i18n/unicode/format.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/fpositer.h b/deps/icu-small/source/i18n/unicode/fpositer.h index 694a1d8770..898b66ceea 100644 --- a/deps/icu-small/source/i18n/unicode/fpositer.h +++ b/deps/icu-small/source/i18n/unicode/fpositer.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/gender.h b/deps/icu-small/source/i18n/unicode/gender.h index 0294895184..467b64ec5e 100644 --- a/deps/icu-small/source/i18n/unicode/gender.h +++ b/deps/icu-small/source/i18n/unicode/gender.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/gregocal.h b/deps/icu-small/source/i18n/unicode/gregocal.h index 60ba0cc6ac..1d881e0be7 100644 --- a/deps/icu-small/source/i18n/unicode/gregocal.h +++ b/deps/icu-small/source/i18n/unicode/gregocal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 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. diff --git a/deps/icu-small/source/i18n/unicode/measfmt.h b/deps/icu-small/source/i18n/unicode/measfmt.h index 866d7d3227..dcd4f42343 100644 --- a/deps/icu-small/source/i18n/unicode/measfmt.h +++ b/deps/icu-small/source/i18n/unicode/measfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/measunit.h b/deps/icu-small/source/i18n/unicode/measunit.h index 9810b91194..1cb97ed549 100644 --- a/deps/icu-small/source/i18n/unicode/measunit.h +++ b/deps/icu-small/source/i18n/unicode/measunit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -345,35 +345,29 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createKarat(UErrorCode &status); -#ifndef U_HIDE_DRAFT_API /** * Returns unit of concentr: milligram-per-deciliter. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns unit of concentr: millimole-per-liter. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createMillimolePerLiter(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API /** * Returns unit of concentr: part-per-million. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createPartPerMillion(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ /** * Returns unit of consumption: liter-per-100kilometers. @@ -399,55 +393,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createMilePerGallon(UErrorCode &status); -#ifndef U_HIDE_DRAFT_API /** * Returns unit of consumption: mile-per-gallon-imperial. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createMilePerGallonImperial(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: east. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 - */ - static MeasureUnit *createEast(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: north. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 + /* + * The following were draft ICU 58, but have been withdrawn: + * static MeasureUnit *createEast(UErrorCode &status); + * static MeasureUnit *createNorth(UErrorCode &status); + * static MeasureUnit *createSouth(UErrorCode &status); + * static MeasureUnit *createWest(UErrorCode &status); */ - static MeasureUnit *createNorth(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: south. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 - */ - static MeasureUnit *createSouth(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API - /** - * Returns unit of coordinate: west. - * Caller owns returned value and must free it. - * @param status ICU error code. - * @draft ICU 58 - */ - static MeasureUnit *createWest(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ /** * Returns unit of digital: bit. @@ -873,6 +833,16 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createPicometer(UErrorCode &status); +#ifndef U_HIDE_DRAFT_API + /** + * Returns unit of length: point. + * Caller owns returned value and must free it. + * @param status ICU error code. + * @draft ICU 59 + */ + static MeasureUnit *createPoint(UErrorCode &status); +#endif /* U_HIDE_DRAFT_API */ + /** * Returns unit of length: yard. * Caller owns returned value and must free it. @@ -1249,15 +1219,13 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit *createGallon(UErrorCode &status); -#ifndef U_HIDE_DRAFT_API /** * Returns unit of volume: gallon-imperial. * Caller owns returned value and must free it. * @param status ICU error code. - * @draft ICU 57 + * @stable ICU 57 */ static MeasureUnit *createGallonImperial(UErrorCode &status); -#endif /* U_HIDE_DRAFT_API */ /** * Returns unit of volume: hectoliter. diff --git a/deps/icu-small/source/i18n/unicode/measure.h b/deps/icu-small/source/i18n/unicode/measure.h index 719bc6bc8f..71438d5c85 100644 --- a/deps/icu-small/source/i18n/unicode/measure.h +++ b/deps/icu-small/source/i18n/unicode/measure.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/msgfmt.h b/deps/icu-small/source/i18n/unicode/msgfmt.h index 1a9973872d..fef8010774 100644 --- a/deps/icu-small/source/i18n/unicode/msgfmt.h +++ b/deps/icu-small/source/i18n/unicode/msgfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* * Copyright (C) 2007-2013, International Business Machines Corporation and @@ -939,7 +939,7 @@ private: * @return the index of the list which matches the keyword s. */ static int32_t findKeyword( const UnicodeString& s, - const UChar * const *list); + const char16_t * const *list); /** * Thin wrapper around the format(... AppendableWrapper ...) variant. diff --git a/deps/icu-small/source/i18n/unicode/numfmt.h b/deps/icu-small/source/i18n/unicode/numfmt.h index 9e3d5d34ec..7147204a7c 100644 --- a/deps/icu-small/source/i18n/unicode/numfmt.h +++ b/deps/icu-small/source/i18n/unicode/numfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -931,7 +931,7 @@ public: * @param ec input-output error code * @stable ICU 3.0 */ - virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec); + virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec); /** * Gets the currency used to display currency @@ -940,7 +940,7 @@ public: * the currency in use, or a pointer to the empty string. * @stable ICU 2.6 */ - const UChar* getCurrency() const; + const char16_t* getCurrency() const; /** * Set a particular UDisplayContext value in the formatter, such as @@ -1018,7 +1018,7 @@ protected: * have a capacity of at least 4 * @internal */ - virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const; + virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const; #ifndef U_HIDE_INTERNAL_API /** @@ -1065,7 +1065,7 @@ private: UBool fLenient; // TRUE => lenient parse is enabled // ISO currency code - UChar fCurrency[4]; + char16_t fCurrency[4]; UDisplayContext fCapitalizationContext; diff --git a/deps/icu-small/source/i18n/unicode/numsys.h b/deps/icu-small/source/i18n/unicode/numsys.h index da181551c2..5f52721278 100644 --- a/deps/icu-small/source/i18n/unicode/numsys.h +++ b/deps/icu-small/source/i18n/unicode/numsys.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -193,7 +193,7 @@ private: void setAlgorithmic(UBool algorithmic); - void setDesc(UnicodeString desc); + void setDesc(const UnicodeString &desc); void setName(const char* name); diff --git a/deps/icu-small/source/i18n/unicode/plurfmt.h b/deps/icu-small/source/i18n/unicode/plurfmt.h index b10e4179b6..9a83e52550 100644 --- a/deps/icu-small/source/i18n/unicode/plurfmt.h +++ b/deps/icu-small/source/i18n/unicode/plurfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/plurrule.h b/deps/icu-small/source/i18n/unicode/plurrule.h index 146e6bea83..a14f392b7a 100644 --- a/deps/icu-small/source/i18n/unicode/plurrule.h +++ b/deps/icu-small/source/i18n/unicode/plurrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -29,6 +29,9 @@ #include "unicode/format.h" #include "unicode/upluralrules.h" +#ifndef U_HIDE_INTERNAL_API +#include "unicode/numfmt.h" +#endif /* U_HIDE_INTERNAL_API */ /** * Value returned by PluralRules::getUniqueKeywordValue() when there is no @@ -346,6 +349,22 @@ public: #ifndef U_HIDE_INTERNAL_API /** + * Given a number and a format, returns the keyword of the first applicable + * rule for this PluralRules object. + * Note: This internal preview interface may be removed in the future if + * an architecturally cleaner solution reaches stable status. + * @param obj The numeric object for which the rule should be determined. + * @param fmt The NumberFormat specifying how the number will be formatted + * (this can affect the plural form, e.g. "1 dollar" vs "1.0 dollars"). + * @param status Input/output parameter. If at entry this indicates a + * failure status, the method returns immediately; otherwise + * this is set to indicate the outcome of the call. + * @return The keyword of the selected rule. Undefined in the case of an error. + * @internal ICU 59 technology preview, may be removed in the future + */ + UnicodeString select(const Formattable& obj, const NumberFormat& fmt, UErrorCode& status) const; + + /** * @internal */ UnicodeString select(const FixedDecimal &number) const; diff --git a/deps/icu-small/source/i18n/unicode/rbnf.h b/deps/icu-small/source/i18n/unicode/rbnf.h index 14230f8982..b4cbb06732 100644 --- a/deps/icu-small/source/i18n/unicode/rbnf.h +++ b/deps/icu-small/source/i18n/unicode/rbnf.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -866,6 +866,52 @@ public: FieldPosition& pos, UErrorCode& status) const; +protected: + /** + * Format a decimal number. + * The number is a DigitList wrapper onto a floating point decimal number. + * The default implementation in NumberFormat converts the decimal number + * to a double and formats that. Subclasses of NumberFormat that want + * to specifically handle big decimal numbers must override this method. + * class DecimalFormat does so. + * + * @param number The number, a DigitList 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 + */ + virtual UnicodeString& format(const DigitList &number, + UnicodeString& appendTo, + FieldPositionIterator* posIter, + UErrorCode& status) const; + + /** + * Format a decimal number. + * The number is a DigitList wrapper onto a floating point decimal number. + * The default implementation in NumberFormat converts the decimal number + * to a double and formats that. Subclasses of NumberFormat that want + * to specifically handle big decimal numbers must override this method. + * class DecimalFormat does so. + * + * @param number The number, a DigitList 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 + */ + virtual UnicodeString& format(const DigitList &number, + UnicodeString& appendTo, + FieldPosition& pos, + UErrorCode& status) const; +public: + using NumberFormat::parse; /** @@ -1031,7 +1077,8 @@ private: NFRule * initializeDefaultNaNRule(UErrorCode &status); const NFRule * getDefaultNaNRule() const; PluralFormat *createPluralFormat(UPluralType pluralType, const UnicodeString &pattern, UErrorCode& status) const; - UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult) const; + UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult, UErrorCode& status) const; + UnicodeString& format(int64_t number, NFRuleSet *ruleSet, UnicodeString& toAppendTo, UErrorCode& status) const; private: NFRuleSet **ruleSets; diff --git a/deps/icu-small/source/i18n/unicode/rbtz.h b/deps/icu-small/source/i18n/unicode/rbtz.h index 20de34bb17..542a7c140c 100644 --- a/deps/icu-small/source/i18n/unicode/rbtz.h +++ b/deps/icu-small/source/i18n/unicode/rbtz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/regex.h b/deps/icu-small/source/i18n/unicode/regex.h index 96c64874a4..7a68039fe8 100644 --- a/deps/icu-small/source/i18n/unicode/regex.h +++ b/deps/icu-small/source/i18n/unicode/regex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: regex.h -* encoding: US-ASCII +* encoding: UTF-8 * indentation:4 * * created on: 2002oct22 @@ -350,17 +350,17 @@ public: private: /** * Cause a compilation error if an application accidentally attempts to - * create a matcher with a (UChar *) string as input rather than + * create a matcher with a (char16_t *) string as input rather than * a UnicodeString. Avoids a dangling reference to a temporary string. * <p> - * To efficiently work with UChar *strings, wrap the data in a UnicodeString + * To efficiently work with char16_t *strings, wrap the data in a UnicodeString * using one of the aliasing constructors, such as - * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code> + * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code> * or in a UText, using - * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code> + * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code> * */ - RegexMatcher *matcher(const UChar *input, + RegexMatcher *matcher(const char16_t *input, UErrorCode &status) const; public: @@ -748,17 +748,17 @@ public: private: /** * Cause a compilation error if an application accidentally attempts to - * create a matcher with a (UChar *) string as input rather than + * create a matcher with a (char16_t *) string as input rather than * a UnicodeString. Avoids a dangling reference to a temporary string. * <p> - * To efficiently work with UChar *strings, wrap the data in a UnicodeString + * To efficiently work with char16_t *strings, wrap the data in a UnicodeString * using one of the aliasing constructors, such as - * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code> + * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code> * or in a UText, using - * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code> + * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code> * */ - RegexMatcher(const UnicodeString ®exp, const UChar *input, + RegexMatcher(const UnicodeString ®exp, const char16_t *input, uint32_t flags, UErrorCode &status); public: @@ -1156,17 +1156,17 @@ public: private: /** * Cause a compilation error if an application accidentally attempts to - * reset a matcher with a (UChar *) string as input rather than + * reset a matcher with a (char16_t *) string as input rather than * a UnicodeString. Avoids a dangling reference to a temporary string. * <p> - * To efficiently work with UChar *strings, wrap the data in a UnicodeString + * To efficiently work with char16_t *strings, wrap the data in a UnicodeString * using one of the aliasing constructors, such as - * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code> + * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code> * or in a UText, using - * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code> + * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code> * */ - RegexMatcher &reset(const UChar *input); + RegexMatcher &reset(const char16_t *input); public: /** diff --git a/deps/icu-small/source/i18n/unicode/region.h b/deps/icu-small/source/i18n/unicode/region.h index 47829944a3..667c4051f0 100644 --- a/deps/icu-small/source/i18n/unicode/region.h +++ b/deps/icu-small/source/i18n/unicode/region.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/reldatefmt.h b/deps/icu-small/source/i18n/unicode/reldatefmt.h index 8e659e2bc8..abd43522c3 100644 --- a/deps/icu-small/source/i18n/unicode/reldatefmt.h +++ b/deps/icu-small/source/i18n/unicode/reldatefmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** @@ -230,6 +230,7 @@ typedef enum UDateDirection { U_NAMESPACE_BEGIN +class BreakIterator; class RelativeDateTimeCacheData; class SharedNumberFormat; class SharedPluralRules; @@ -414,7 +415,6 @@ public: UnicodeString& appendTo, UErrorCode& status) const; -#ifndef U_HIDE_DRAFT_API /** * Format a combination of URelativeDateTimeUnit and numeric offset * using a numeric style, e.g. "1 week ago", "in 1 week", @@ -430,7 +430,7 @@ public: * appended. * @param status ICU error code returned here. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString& formatNumeric( double offset, @@ -453,14 +453,13 @@ public: * appended. * @param status ICU error code returned here. * @return appendTo - * @draft ICU 57 + * @stable ICU 57 */ UnicodeString& format( double offset, URelativeDateTimeUnit unit, UnicodeString& appendTo, UErrorCode& status) const; -#endif /* U_HIDE_DRAFT_API */ /** * Combines a relative date string and a time string in this object's diff --git a/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h b/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h index 0b34755dc2..30edee7ecc 100644 --- a/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h +++ b/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/search.h b/deps/icu-small/source/i18n/unicode/search.h index 35a0552623..12dd5c7727 100644 --- a/deps/icu-small/source/i18n/unicode/search.h +++ b/deps/icu-small/source/i18n/unicode/search.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/selfmt.h b/deps/icu-small/source/i18n/unicode/selfmt.h index 37a8f2b821..08e9d444ee 100755 --- a/deps/icu-small/source/i18n/unicode/selfmt.h +++ b/deps/icu-small/source/i18n/unicode/selfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: diff --git a/deps/icu-small/source/i18n/unicode/simpletz.h b/deps/icu-small/source/i18n/unicode/simpletz.h index 7e41a4ab8a..1b23ab79d1 100644 --- a/deps/icu-small/source/i18n/unicode/simpletz.h +++ b/deps/icu-small/source/i18n/unicode/simpletz.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/smpdtfmt.h b/deps/icu-small/source/i18n/unicode/smpdtfmt.h index e6cf28d22b..4733e759aa 100644 --- a/deps/icu-small/source/i18n/unicode/smpdtfmt.h +++ b/deps/icu-small/source/i18n/unicode/smpdtfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 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 @@ -1170,7 +1170,7 @@ public: * @param field The UDateFormatField to get * @stable ICU 54 */ - const NumberFormat * getNumberFormatForField(UChar field) const; + const NumberFormat * getNumberFormatForField(char16_t field) const; #ifndef U_HIDE_INTERNAL_API /** @@ -1262,7 +1262,7 @@ private: * succeeds. */ void subFormat(UnicodeString &appendTo, - UChar ch, + char16_t ch, int32_t count, UDisplayContext capitalizationContext, int32_t fieldNum, @@ -1294,7 +1294,7 @@ private: * Return true if the given format character, occuring count * times, represents a numeric field. */ - static UBool isNumeric(UChar formatChar, int32_t count); + static UBool isNumeric(char16_t formatChar, int32_t count); /** * Returns TRUE if the patternOffset is at the start of a numeric field. @@ -1412,7 +1412,7 @@ private: * @return the new start position if matching succeeded; a negative number * indicating matching failure, otherwise. */ - int32_t subParse(const UnicodeString& text, int32_t& start, UChar ch, int32_t count, + int32_t subParse(const UnicodeString& text, int32_t& start, char16_t ch, int32_t count, UBool obeyCount, UBool allowNegative, UBool ambiguousYear[], int32_t& saveHebrewMonth, Calendar& cal, int32_t patLoc, MessageFormat * numericLeapMonthFormatter, UTimeZoneFormatTimeType *tzTimeType, SimpleDateFormatMutableNFs &mutableNFs, int32_t *dayPeriod=NULL) const; @@ -1523,12 +1523,12 @@ private: /** * Map calendar field letter into calendar field level. */ - static int32_t getLevelFromChar(UChar ch); + static int32_t getLevelFromChar(char16_t ch); /** * Tell if a character can be used to define a field in a format string. */ - static UBool isSyntaxChar(UChar ch); + static UBool isSyntaxChar(char16_t ch); /** * The formatting pattern for this formatter. diff --git a/deps/icu-small/source/i18n/unicode/sortkey.h b/deps/icu-small/source/i18n/unicode/sortkey.h index 6f1543da40..6895be7a2b 100644 --- a/deps/icu-small/source/i18n/unicode/sortkey.h +++ b/deps/icu-small/source/i18n/unicode/sortkey.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/stsearch.h b/deps/icu-small/source/i18n/unicode/stsearch.h index 1cae53d128..46bc51b30e 100644 --- a/deps/icu-small/source/i18n/unicode/stsearch.h +++ b/deps/icu-small/source/i18n/unicode/stsearch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/tblcoll.h b/deps/icu-small/source/i18n/unicode/tblcoll.h index c48ea38c13..24ba213b41 100644 --- a/deps/icu-small/source/i18n/unicode/tblcoll.h +++ b/deps/icu-small/source/i18n/unicode/tblcoll.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -308,8 +308,8 @@ public: * than target * @stable ICU 2.6 */ - virtual UCollationResult compare(const UChar* source, int32_t sourceLength, - const UChar* target, int32_t targetLength, + virtual UCollationResult compare(const char16_t* source, int32_t sourceLength, + const char16_t* target, int32_t targetLength, UErrorCode &status) const; /** @@ -377,7 +377,7 @@ public: * @see CollationKey * @stable ICU 2.0 */ - virtual CollationKey& getCollationKey(const UChar *source, + virtual CollationKey& getCollationKey(const char16_t *source, int32_t sourceLength, CollationKey& key, UErrorCode& status) const; @@ -552,7 +552,7 @@ public: * the top of one of the supported reordering groups, * and it must not be beyond the last of those groups. * See setMaxVariable(). - * @param varTop one or more (if contraction) UChars to which the variable top should be set + * @param varTop one or more (if contraction) char16_ts to which the variable top should be set * @param len length of variable top string. If -1 it is considered to be zero terminated. * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br> * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br> @@ -561,7 +561,7 @@ public: * @return variable top primary weight * @deprecated ICU 53 Call setMaxVariable() instead. */ - virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status); + virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status); /** * Sets the variable top to the primary weight of the specified string. @@ -570,7 +570,7 @@ public: * 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 UChars to which the variable top should be set + * @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: <br> * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br> * U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond @@ -631,7 +631,7 @@ public: int32_t resultLength) const; /** - * Get the sort key as an array of bytes from a UChar buffer. + * Get the sort key as an array of bytes from a char16_t buffer. * * Note that sort keys are often less efficient than simply doing comparison. * For more details, see the ICU User Guide. @@ -646,7 +646,7 @@ public: * @return Number of bytes needed for storing the sort key * @stable ICU 2.2 */ - virtual int32_t getSortKey(const UChar *source, int32_t sourceLength, + virtual int32_t getSortKey(const char16_t *source, int32_t sourceLength, uint8_t *result, int32_t resultLength) const; /** @@ -821,17 +821,17 @@ private: void adoptTailoring(CollationTailoring *t, UErrorCode &errorCode); // Both lengths must be <0 or else both must be >=0. - UCollationResult doCompare(const UChar *left, int32_t leftLength, - const UChar *right, int32_t rightLength, + UCollationResult doCompare(const char16_t *left, int32_t leftLength, + const char16_t *right, int32_t rightLength, UErrorCode &errorCode) const; UCollationResult doCompare(const uint8_t *left, int32_t leftLength, const uint8_t *right, int32_t rightLength, UErrorCode &errorCode) const; - void writeSortKey(const UChar *s, int32_t length, + void writeSortKey(const char16_t *s, int32_t length, SortKeyByteSink &sink, UErrorCode &errorCode) const; - void writeIdenticalLevel(const UChar *s, const UChar *limit, + void writeIdenticalLevel(const char16_t *s, const char16_t *limit, SortKeyByteSink &sink, UErrorCode &errorCode) const; const CollationSettings &getDefaultSettings() const; diff --git a/deps/icu-small/source/i18n/unicode/timezone.h b/deps/icu-small/source/i18n/unicode/timezone.h index 58c84d062b..d4cd7cb36d 100644 --- a/deps/icu-small/source/i18n/unicode/timezone.h +++ b/deps/icu-small/source/i18n/unicode/timezone.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 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 @@ -863,7 +863,7 @@ private: * @param id zone id string * @return the pointer of the ID resource, or NULL. */ - static const UChar* findID(const UnicodeString& id); + static const char16_t* findID(const UnicodeString& id); /** * Resolve a link in Olson tzdata. When the given id is known and it's not a link, @@ -873,7 +873,7 @@ private: * @param id zone id string * @return the dereferenced zone or NULL */ - static const UChar* dereferOlsonLink(const UnicodeString& id); + static const char16_t* dereferOlsonLink(const UnicodeString& id); /** * Returns the region code associated with the given zone, @@ -881,7 +881,7 @@ private: * @param id zone id string * @return the region associated with the given zone */ - static const UChar* getRegion(const UnicodeString& id); + static const char16_t* getRegion(const UnicodeString& id); public: #ifndef U_HIDE_INTERNAL_API @@ -893,7 +893,7 @@ private: * @return the region associated with the given zone * @internal */ - static const UChar* getRegion(const UnicodeString& id, UErrorCode& status); + static const char16_t* getRegion(const UnicodeString& id, UErrorCode& status); #endif /* U_HIDE_INTERNAL_API */ private: diff --git a/deps/icu-small/source/i18n/unicode/tmunit.h b/deps/icu-small/source/i18n/unicode/tmunit.h index a19a1f3c17..fa59f10473 100644 --- a/deps/icu-small/source/i18n/unicode/tmunit.h +++ b/deps/icu-small/source/i18n/unicode/tmunit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/tmutamt.h b/deps/icu-small/source/i18n/unicode/tmutamt.h index 887150121f..1717b7605f 100644 --- a/deps/icu-small/source/i18n/unicode/tmutamt.h +++ b/deps/icu-small/source/i18n/unicode/tmutamt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/tmutfmt.h b/deps/icu-small/source/i18n/unicode/tmutfmt.h index b90d4a096d..8f245859a6 100644 --- a/deps/icu-small/source/i18n/unicode/tmutfmt.h +++ b/deps/icu-small/source/i18n/unicode/tmutfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/translit.h b/deps/icu-small/source/i18n/unicode/translit.h index 1e49bfb969..dc31d97bc6 100644 --- a/deps/icu-small/source/i18n/unicode/translit.h +++ b/deps/icu-small/source/i18n/unicode/translit.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -1319,7 +1319,7 @@ inline int32_t Transliterator::getMaximumContextLength(void) const { inline void Transliterator::setID(const UnicodeString& id) { ID = id; // NUL-terminate the ID string, which is a non-aliased copy. - ID.append((UChar)0); + ID.append((char16_t)0); ID.truncate(ID.length()-1); } diff --git a/deps/icu-small/source/i18n/unicode/tzfmt.h b/deps/icu-small/source/i18n/unicode/tzfmt.h index dd86f1b48c..633cd8dc69 100644 --- a/deps/icu-small/source/i18n/unicode/tzfmt.h +++ b/deps/icu-small/source/i18n/unicode/tzfmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -942,7 +942,7 @@ private: * @param parsedLen the parsed length, or 0 on failure. * @return the parsed offset in milliseconds. */ - int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, UChar separator, + int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, char16_t separator, int32_t& parsedLen) const; /** @@ -982,7 +982,7 @@ private: * @param maxFields The maximum fields * @return The offset string */ - static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, UChar sep, + static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, char16_t sep, OffsetFields minFields, OffsetFields maxFields, UnicodeString& result); /** @@ -1012,7 +1012,7 @@ private: * @param maxFields The maximum Fields to be parsed * @return Parsed offset, 0 or positive number. */ - static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, UChar sep, + static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, char16_t sep, OffsetFields minFields, OffsetFields maxFields); /** diff --git a/deps/icu-small/source/i18n/unicode/tznames.h b/deps/icu-small/source/i18n/unicode/tznames.h index 8861a7d026..60f0e5e4a1 100644 --- a/deps/icu-small/source/i18n/unicode/tznames.h +++ b/deps/icu-small/source/i18n/unicode/tznames.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/tzrule.h b/deps/icu-small/source/i18n/unicode/tzrule.h index 5e020bc1a3..171486f1c7 100644 --- a/deps/icu-small/source/i18n/unicode/tzrule.h +++ b/deps/icu-small/source/i18n/unicode/tzrule.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/tztrans.h b/deps/icu-small/source/i18n/unicode/tztrans.h index b2e09999bb..1276d67c31 100644 --- a/deps/icu-small/source/i18n/unicode/tztrans.h +++ b/deps/icu-small/source/i18n/unicode/tztrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/ucal.h b/deps/icu-small/source/i18n/unicode/ucal.h index 18522f6475..10d8bc5274 100644 --- a/deps/icu-small/source/i18n/unicode/ucal.h +++ b/deps/icu-small/source/i18n/unicode/ucal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -425,8 +425,8 @@ enum UCalendarDateFields { */ UCAL_IS_LEAP_MONTH, - // Do not conditionalize with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of Calendar, DateFormat, and other objects + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of Calendar, DateFormat, and other objects */ /** * One more than the highest normal UCalendarDateFields value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. diff --git a/deps/icu-small/source/i18n/unicode/ucol.h b/deps/icu-small/source/i18n/unicode/ucol.h index 0b3fab90b1..b5bacbfcb4 100644 --- a/deps/icu-small/source/i18n/unicode/ucol.h +++ b/deps/icu-small/source/i18n/unicode/ucol.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -131,7 +131,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UCOL_ATTRIBUTE_VALUE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UColAttributeValue; /** @@ -204,7 +204,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UCOL_REORDER_CODE_LIMIT = 0x1005 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UColReorderCode; /** @@ -342,8 +342,8 @@ typedef enum { */ UCOL_NUMERIC_COLLATION = UCOL_STRENGTH + 2, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of RuleBasedCollator object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of RuleBasedCollator object. */ /** * One more than the highest normal UColAttribute value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. @@ -1067,7 +1067,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UCOL_BOUND_VALUE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UColBoundMode; /** diff --git a/deps/icu-small/source/i18n/unicode/ucoleitr.h b/deps/icu-small/source/i18n/unicode/ucoleitr.h index 89fd9e85cf..1d644fc259 100644 --- a/deps/icu-small/source/i18n/unicode/ucoleitr.h +++ b/deps/icu-small/source/i18n/unicode/ucoleitr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/ucsdet.h b/deps/icu-small/source/i18n/unicode/ucsdet.h index a926d2f22c..7a8564f9ea 100644 --- a/deps/icu-small/source/i18n/unicode/ucsdet.h +++ b/deps/icu-small/source/i18n/unicode/ucsdet.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucsdet.h - * encoding: US-ASCII + * encoding: UTF-8 * indentation:4 * * created on: 2005Aug04 @@ -45,6 +45,10 @@ * in a single language, and a minimum of a few hundred bytes worth of plain text * in the language are needed. The detection process will attempt to * ignore html or xml style markup that could otherwise obscure the content. + * <p> + * An alternative to the ICU Charset Detector is the + * Compact Encoding Detector, https://github.com/google/compact_enc_det. + * It often gives more accurate results, especially with short input samples. */ @@ -395,7 +399,7 @@ ucsdet_getDetectableCharsets(const UCharsetDetector *ucsd, UErrorCode *status); /** * Enable or disable individual charset encoding. * A name of charset encoding must be included in the names returned by - * {@link #getAllDetectableCharsets()}. + * {@link #ucsdet_getAllDetectableCharsets()}. * * @param ucsd a Charset detector. * @param encoding encoding the name of charset encoding. diff --git a/deps/icu-small/source/i18n/unicode/udat.h b/deps/icu-small/source/i18n/unicode/udat.h index cacfbe8500..90aff20df2 100644 --- a/deps/icu-small/source/i18n/unicode/udat.h +++ b/deps/icu-small/source/i18n/unicode/udat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -763,21 +763,19 @@ typedef enum UDateFormatField { UDAT_RELATED_YEAR_FIELD = 34, #endif /* U_HIDE_INTERNAL_API */ -#ifndef U_HIDE_DRAFT_API /** * FieldPosition selector for 'b' field alignment. * Displays midnight and noon for 12am and 12pm, respectively, if available; * otherwise fall back to AM / PM. - * @draft ICU 57 + * @stable ICU 57 */ UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35, /* FieldPosition selector for 'B' field alignment. * Displays flexible day periods, such as "in the morning", if available. - * @draft ICU 57 + * @stable ICU 57 */ UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36, -#endif /* U_HIDE_DRAFT_API */ #ifndef U_HIDE_INTERNAL_API /** @@ -797,7 +795,7 @@ typedef enum UDateFormatField { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UDAT_FIELD_COUNT = 38 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UDateFormatField; @@ -819,7 +817,7 @@ typedef enum UDateFormatField { * of error (e.g., the input field is UDAT_FIELD_COUNT). * @stable ICU 4.4 */ -U_STABLE UCalendarDateFields U_EXPORT2 +U_CAPI UCalendarDateFields U_EXPORT2 udat_toCalendarDateField(UDateFormatField field); @@ -851,7 +849,7 @@ udat_toCalendarDateField(UDateFormatField field); * an error occurred. * @stable ICU 2.0 */ -U_STABLE UDateFormat* U_EXPORT2 +U_CAPI UDateFormat* U_EXPORT2 udat_open(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, const char *locale, @@ -868,7 +866,7 @@ udat_open(UDateFormatStyle timeStyle, * @param format The formatter to close. * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_close(UDateFormat* format); @@ -902,8 +900,8 @@ typedef enum UDateFormatBooleanAttribute { */ UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of DateFormat object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of DateFormat object. */ /** * One more than the highest normal UDateFormatBooleanAttribute value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. @@ -921,7 +919,7 @@ typedef enum UDateFormatBooleanAttribute { * @return The value of attr. * @stable ICU 53 */ -U_STABLE UBool U_EXPORT2 +U_CAPI UBool U_EXPORT2 udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status); /** @@ -934,7 +932,7 @@ udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute att * @param status A pointer to an UErrorCode to receive any errors * @stable ICU 53 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status); @@ -966,7 +964,7 @@ U_NAMESPACE_END * @return A pointer to a UDateFormat identical to fmt. * @stable ICU 2.0 */ -U_STABLE UDateFormat* U_EXPORT2 +U_CAPI UDateFormat* U_EXPORT2 udat_clone(const UDateFormat *fmt, UErrorCode *status); @@ -988,7 +986,7 @@ udat_clone(const UDateFormat *fmt, * @see UFieldPosition * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_format( const UDateFormat* format, UDate dateToFormat, UChar* result, @@ -1018,7 +1016,7 @@ udat_format( const UDateFormat* format, * @see UFieldPosition * @stable ICU 55 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_formatCalendar( const UDateFormat* format, UCalendar* calendar, UChar* result, @@ -1053,7 +1051,7 @@ udat_formatCalendar( const UDateFormat* format, * @see UFieldPositionIterator * @stable ICU 55 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_formatForFields( const UDateFormat* format, UDate dateToFormat, UChar* result, @@ -1091,7 +1089,7 @@ udat_formatForFields( const UDateFormat* format, * @see UFieldPositionIterator * @stable ICU 55 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_formatCalendarForFields( const UDateFormat* format, UCalendar* calendar, UChar* result, @@ -1125,7 +1123,7 @@ udat_formatCalendarForFields( const UDateFormat* format, * @see udat_format * @stable ICU 2.0 */ -U_STABLE UDate U_EXPORT2 +U_CAPI UDate U_EXPORT2 udat_parse(const UDateFormat* format, const UChar* text, int32_t textLength, @@ -1153,7 +1151,7 @@ udat_parse(const UDateFormat* format, * @see udat_format * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_parseCalendar(const UDateFormat* format, UCalendar* calendar, const UChar* text, @@ -1170,7 +1168,7 @@ udat_parseCalendar(const UDateFormat* format, * @see udat_setLenient * @stable ICU 2.0 */ -U_STABLE UBool U_EXPORT2 +U_CAPI UBool U_EXPORT2 udat_isLenient(const UDateFormat* fmt); /** @@ -1182,7 +1180,7 @@ udat_isLenient(const UDateFormat* fmt); * @see dat_isLenient * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setLenient( UDateFormat* fmt, UBool isLenient); @@ -1195,7 +1193,7 @@ udat_setLenient( UDateFormat* fmt, * @see udat_setCalendar * @stable ICU 2.0 */ -U_STABLE const UCalendar* U_EXPORT2 +U_CAPI const UCalendar* U_EXPORT2 udat_getCalendar(const UDateFormat* fmt); /** @@ -1207,7 +1205,7 @@ udat_getCalendar(const UDateFormat* fmt); * @see udat_setCalendar * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setCalendar( UDateFormat* fmt, const UCalendar* calendarToSet); @@ -1220,7 +1218,7 @@ udat_setCalendar( UDateFormat* fmt, * @see udat_setNumberFormat * @stable ICU 2.0 */ -U_STABLE const UNumberFormat* U_EXPORT2 +U_CAPI const UNumberFormat* U_EXPORT2 udat_getNumberFormat(const UDateFormat* fmt); /** @@ -1232,7 +1230,7 @@ udat_getNumberFormat(const UDateFormat* fmt); * @see udat_setNumberFormatForField * @stable ICU 54 */ -U_STABLE const UNumberFormat* U_EXPORT2 +U_CAPI const UNumberFormat* U_EXPORT2 udat_getNumberFormatForField(const UDateFormat* fmt, UChar field); /** @@ -1250,7 +1248,7 @@ udat_getNumberFormatForField(const UDateFormat* fmt, UChar field); * @see udat_getNumberFormatForField * @stable ICU 54 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_adoptNumberFormatForFields( UDateFormat* fmt, const UChar* fields, UNumberFormat* numberFormatToSet, @@ -1267,7 +1265,7 @@ udat_adoptNumberFormatForFields( UDateFormat* fmt, * @see udat_setNumberFormatForField * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setNumberFormat( UDateFormat* fmt, const UNumberFormat* numberFormatToSet); /** @@ -1279,7 +1277,7 @@ udat_setNumberFormat( UDateFormat* fmt, * @see udat_getNumberFormat * @stable ICU 54 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_adoptNumberFormat( UDateFormat* fmt, UNumberFormat* numberFormatToAdopt); /** @@ -1291,7 +1289,7 @@ udat_adoptNumberFormat( UDateFormat* fmt, * @see udat_countAvailable * @stable ICU 2.0 */ -U_STABLE const char* U_EXPORT2 +U_CAPI const char* U_EXPORT2 udat_getAvailable(int32_t localeIndex); /** @@ -1302,7 +1300,7 @@ udat_getAvailable(int32_t localeIndex); * @see udat_getAvailable * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_countAvailable(void); /** @@ -1315,7 +1313,7 @@ udat_countAvailable(void); * @see udat_Set2DigitYearStart * @stable ICU 2.0 */ -U_STABLE UDate U_EXPORT2 +U_CAPI UDate U_EXPORT2 udat_get2DigitYearStart( const UDateFormat *fmt, UErrorCode *status); @@ -1329,7 +1327,7 @@ udat_get2DigitYearStart( const UDateFormat *fmt, * @see udat_Set2DigitYearStart * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_set2DigitYearStart( UDateFormat *fmt, UDate d, UErrorCode *status); @@ -1346,7 +1344,7 @@ udat_set2DigitYearStart( UDateFormat *fmt, * @see udat_applyPattern * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_toPattern( const UDateFormat *fmt, UBool localized, UChar *result, @@ -1363,7 +1361,7 @@ udat_toPattern( const UDateFormat *fmt, * @see udat_toPattern * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_applyPattern( UDateFormat *format, UBool localized, const UChar *pattern, @@ -1489,7 +1487,7 @@ typedef struct UDateFormatSymbols UDateFormatSymbols; * @see udat_setSymbols * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_getSymbols(const UDateFormat *fmt, UDateFormatSymbolType type, int32_t symbolIndex, @@ -1509,7 +1507,7 @@ udat_getSymbols(const UDateFormat *fmt, * @see udat_setSymbols * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 udat_countSymbols( const UDateFormat *fmt, UDateFormatSymbolType type); @@ -1528,7 +1526,7 @@ udat_countSymbols( const UDateFormat *fmt, * @see udat_countSymbols * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setSymbols( UDateFormat *format, UDateFormatSymbolType type, int32_t symbolIndex, @@ -1545,7 +1543,7 @@ udat_setSymbols( UDateFormat *format, * @return the locale name * @stable ICU 2.8 */ -U_STABLE const char* U_EXPORT2 +U_CAPI const char* U_EXPORT2 udat_getLocaleByType(const UDateFormat *fmt, ULocDataLocaleType type, UErrorCode* status); @@ -1558,7 +1556,7 @@ udat_getLocaleByType(const UDateFormat *fmt, * @param status A pointer to an UErrorCode to receive any errors * @stable ICU 51 */ -U_DRAFT void U_EXPORT2 +U_CAPI void U_EXPORT2 udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status); /** @@ -1570,7 +1568,7 @@ udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status); * @return The UDisplayContextValue for the specified type. * @stable ICU 53 */ -U_STABLE UDisplayContext U_EXPORT2 +U_CAPI UDisplayContext U_EXPORT2 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status); #ifndef U_HIDE_INTERNAL_API diff --git a/deps/icu-small/source/i18n/unicode/udateintervalformat.h b/deps/icu-small/source/i18n/unicode/udateintervalformat.h index 81bff16d6e..70cbadeb57 100644 --- a/deps/icu-small/source/i18n/unicode/udateintervalformat.h +++ b/deps/icu-small/source/i18n/unicode/udateintervalformat.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/udatpg.h b/deps/icu-small/source/i18n/unicode/udatpg.h index 365d51c493..9e3bdd4114 100644 --- a/deps/icu-small/source/i18n/unicode/udatpg.h +++ b/deps/icu-small/source/i18n/unicode/udatpg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -8,7 +8,7 @@ * ******************************************************************************* * file name: udatpg.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -86,8 +86,8 @@ typedef enum UDateTimePatternField { /** @stable ICU 3.8 */ UDATPG_ZONE_FIELD, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of DateTimePatternGenerator object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of DateTimePatternGenerator object. */ /** * One more than the highest normal UDateTimePatternField value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. diff --git a/deps/icu-small/source/i18n/unicode/ufieldpositer.h b/deps/icu-small/source/i18n/unicode/ufieldpositer.h index 8dfa3df5a4..3ae73b6d84 100644 --- a/deps/icu-small/source/i18n/unicode/ufieldpositer.h +++ b/deps/icu-small/source/i18n/unicode/ufieldpositer.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/uformattable.h b/deps/icu-small/source/i18n/unicode/uformattable.h index e4683d56c3..9ba2a36901 100644 --- a/deps/icu-small/source/i18n/unicode/uformattable.h +++ b/deps/icu-small/source/i18n/unicode/uformattable.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** @@ -57,7 +57,7 @@ typedef enum UFormattableType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UFMT_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UFormattableType; diff --git a/deps/icu-small/source/i18n/unicode/ugender.h b/deps/icu-small/source/i18n/unicode/ugender.h index c1e591ed28..d015a2300c 100644 --- a/deps/icu-small/source/i18n/unicode/ugender.h +++ b/deps/icu-small/source/i18n/unicode/ugender.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/ulocdata.h b/deps/icu-small/source/i18n/unicode/ulocdata.h index ecf6fdcb3f..de8d8539c6 100644 --- a/deps/icu-small/source/i18n/unicode/ulocdata.h +++ b/deps/icu-small/source/i18n/unicode/ulocdata.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -8,7 +8,7 @@ * * ****************************************************************************** * file name: ulocdata.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -55,7 +55,7 @@ typedef enum ULocaleDataExemplarSetType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ ULOCDATA_ES_COUNT=4 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } ULocaleDataExemplarSetType; /** The possible types of delimiters. @@ -76,7 +76,7 @@ typedef enum ULocaleDataDelimiterType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ ULOCDATA_DELIMITER_COUNT = 4 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } ULocaleDataDelimiterType; /** @@ -207,7 +207,7 @@ typedef enum UMeasurementSystem { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UMS_LIMIT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UMeasurementSystem; /** diff --git a/deps/icu-small/source/i18n/unicode/umsg.h b/deps/icu-small/source/i18n/unicode/umsg.h index 0beb39d5ab..6818820612 100644 --- a/deps/icu-small/source/i18n/unicode/umsg.h +++ b/deps/icu-small/source/i18n/unicode/umsg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: @@ -8,7 +8,7 @@ ******************************************************************** * * file name: umsg.h - * encoding: US-ASCII + * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/unicode/unirepl.h b/deps/icu-small/source/i18n/unicode/unirepl.h index 37815a9a24..8fb25d4689 100644 --- a/deps/icu-small/source/i18n/unicode/unirepl.h +++ b/deps/icu-small/source/i18n/unicode/unirepl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/unum.h b/deps/icu-small/source/i18n/unicode/unum.h index 7c652e09cf..5fc65486fc 100644 --- a/deps/icu-small/source/i18n/unicode/unum.h +++ b/deps/icu-small/source/i18n/unicode/unum.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -25,6 +25,7 @@ #include "unicode/parseerr.h" #include "unicode/uformattable.h" #include "unicode/udisplaycontext.h" +#include "unicode/ufieldpositer.h" /** * \file @@ -249,7 +250,7 @@ typedef enum UNumberFormatStyle { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FORMAT_STYLE_COUNT=17, -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ /** * Default format @@ -326,8 +327,8 @@ enum UCurrencySpacing { /** @stable ICU 4.8 */ UNUM_CURRENCY_INSERT, - // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - // it is needed for layout of DecimalFormatSymbols object. + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of DecimalFormatSymbols object. */ /** * One more than the highest normal UCurrencySpacing value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. @@ -371,7 +372,7 @@ typedef enum UNumberFormatFields { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FIELD_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UNumberFormatFields; @@ -553,6 +554,59 @@ unum_formatDouble( const UNumberFormat* fmt, UFieldPosition *pos, /* 0 if ignore */ UErrorCode* status); +#ifndef U_HIDE_DRAFT_API +/** +* Format a double using a UNumberFormat according to the UNumberFormat's locale, +* and initialize a UFieldPositionIterator that enumerates the subcomponents of +* the resulting string. +* +* @param format +* The formatter to use. +* @param number +* The number to format. +* @param result +* A pointer to a buffer to receive the NULL-terminated formatted +* number. If the formatted number fits into dest but cannot be +* NULL-terminated (length == resultLength) then the error code is set +* to U_STRING_NOT_TERMINATED_WARNING. If the formatted number doesn't +* fit into result then the error code is set to +* U_BUFFER_OVERFLOW_ERROR. +* @param resultLength +* The maximum size of result. +* @param fpositer +* A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open} +* (may be NULL if field position information is not needed, but in this +* case it's preferable to use {@link #unum_formatDouble}). Iteration +* information already present in the UFieldPositionIterator is deleted, +* and the iterator is reset to apply to the fields in the formatted +* string created by this function call. The field values and indexes +* returned by {@link #ufieldpositer_next} represent fields denoted by +* the UNumberFormatFields enum. Fields are not returned in a guaranteed +* order. Fields cannot overlap, but they may nest. For example, 1234 +* could format as "1,234" which might consist of a grouping separator +* field for ',' and an integer field encompassing the entire string. +* @param status +* A pointer to an UErrorCode to receive any errors +* @return +* The total buffer size needed; if greater than resultLength, the +* output was truncated. +* @see unum_formatDouble +* @see unum_parse +* @see unum_parseDouble +* @see UFieldPositionIterator +* @see UNumberFormatFields +* @draft ICU 59 +*/ +U_DRAFT int32_t U_EXPORT2 +unum_formatDoubleForFields(const UNumberFormat* format, + double number, + UChar* result, + int32_t resultLength, + UFieldPositionIterator* fpositer, + UErrorCode* status); + +#endif /* U_HIDE_DRAFT_API */ + /** * Format a decimal number using a UNumberFormat. * The number will be formatted according to the UNumberFormat's locale. @@ -1291,7 +1345,7 @@ typedef enum UNumberFormatSymbol { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FORMAT_SYMBOL_COUNT = 28 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UNumberFormatSymbol; /** diff --git a/deps/icu-small/source/i18n/unicode/unumsys.h b/deps/icu-small/source/i18n/unicode/unumsys.h index 396d55d6b7..2c794c23d3 100644 --- a/deps/icu-small/source/i18n/unicode/unumsys.h +++ b/deps/icu-small/source/i18n/unicode/unumsys.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** diff --git a/deps/icu-small/source/i18n/unicode/upluralrules.h b/deps/icu-small/source/i18n/unicode/upluralrules.h index 52e34d8d25..99d93a4e05 100644 --- a/deps/icu-small/source/i18n/unicode/upluralrules.h +++ b/deps/icu-small/source/i18n/unicode/upluralrules.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -15,6 +15,10 @@ #if !UCONFIG_NO_FORMATTING #include "unicode/localpointer.h" +#include "unicode/uenum.h" +#ifndef U_HIDE_INTERNAL_API +#include "unicode/unum.h" +#endif /* U_HIDE_INTERNAL_API */ /** * \file @@ -60,7 +64,7 @@ enum UPluralType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UPLURAL_TYPE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ }; /** * @stable ICU 50 @@ -83,7 +87,7 @@ typedef struct UPluralRules UPluralRules; /**< C typedef for struct UPluralRule * @return A UPluralRules for the specified locale, or NULL if an error occurred. * @stable ICU 4.8 */ -U_STABLE UPluralRules* U_EXPORT2 +U_CAPI UPluralRules* U_EXPORT2 uplrules_open(const char *locale, UErrorCode *status); /** @@ -95,7 +99,7 @@ uplrules_open(const char *locale, UErrorCode *status); * @return A UPluralRules for the specified locale, or NULL if an error occurred. * @stable ICU 50 */ -U_DRAFT UPluralRules* U_EXPORT2 +U_CAPI UPluralRules* U_EXPORT2 uplrules_openForType(const char *locale, UPluralType type, UErrorCode *status); /** @@ -103,7 +107,7 @@ uplrules_openForType(const char *locale, UPluralType type, UErrorCode *status); * @param uplrules The UPluralRules object to close. * @stable ICU 4.8 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 uplrules_close(UPluralRules *uplrules); @@ -138,12 +142,55 @@ U_NAMESPACE_END * @return The length of keyword. * @stable ICU 4.8 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 uplrules_select(const UPluralRules *uplrules, double number, UChar *keyword, int32_t capacity, UErrorCode *status); +#ifndef U_HIDE_INTERNAL_API +/** + * Given a number, returns the keyword of the first rule that applies to the + * number, according to the UPluralRules object and given the number format + * specified by the UNumberFormat object. + * Note: This internal preview interface may be removed in the future if + * an architecturally cleaner solution reaches stable status. + * @param uplrules The UPluralRules object specifying the rules. + * @param number The number for which the rule has to be determined. + * @param fmt The UNumberFormat specifying how the number will be formatted + * (this can affect the plural form, e.g. "1 dollar" vs "1.0 dollars"). + * If this is NULL, the function behaves like uplrules_select. + * @param keyword The keyword of the rule that applies to number. + * @param capacity The capacity of the keyword buffer. + * @param status A pointer to a UErrorCode to receive any errors. + * @return The length of keyword. + * @internal ICU 59 technology preview, may be removed in the future + */ +U_INTERNAL int32_t U_EXPORT2 +uplrules_selectWithFormat(const UPluralRules *uplrules, + double number, + const UNumberFormat *fmt, + UChar *keyword, int32_t capacity, + UErrorCode *status); + +#endif /* U_HIDE_INTERNAL_API */ + +#ifndef U_HIDE_DRAFT_API +/** + * Creates a string enumeration of all plural rule keywords used in this + * UPluralRules object. The rule "other" is always present by default. + * @param uplrules The UPluralRules object specifying the rules for + * a given locale. + * @param status A pointer to a UErrorCode to receive any errors. + * @return a string enumeration over plural rule keywords, or NULL + * upon error. The caller is responsible for closing the result. + * @draft ICU 59 + */ +U_DRAFT UEnumeration* U_EXPORT2 +uplrules_getKeywords(const UPluralRules *uplrules, + UErrorCode *status); +#endif /* U_HIDE_DRAFT_API */ + #endif /* #if !UCONFIG_NO_FORMATTING */ #endif diff --git a/deps/icu-small/source/i18n/unicode/uregex.h b/deps/icu-small/source/i18n/unicode/uregex.h index 7806a74afc..69c0eead95 100644 --- a/deps/icu-small/source/i18n/unicode/uregex.h +++ b/deps/icu-small/source/i18n/unicode/uregex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ********************************************************************** * file name: uregex.h -* encoding: US-ASCII +* encoding: UTF-8 * indentation:4 * * created on: 2004mar09 diff --git a/deps/icu-small/source/i18n/unicode/uregion.h b/deps/icu-small/source/i18n/unicode/uregion.h index b5d03691ca..9d0c1e99de 100644 --- a/deps/icu-small/source/i18n/unicode/uregion.h +++ b/deps/icu-small/source/i18n/unicode/uregion.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -113,7 +113,7 @@ typedef enum URegionType { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ URGN_LIMIT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } URegionType; #if !UCONFIG_NO_FORMATTING diff --git a/deps/icu-small/source/i18n/unicode/ureldatefmt.h b/deps/icu-small/source/i18n/unicode/ureldatefmt.h index fad8ffd9e1..0eff80a16b 100644 --- a/deps/icu-small/source/i18n/unicode/ureldatefmt.h +++ b/deps/icu-small/source/i18n/unicode/ureldatefmt.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ***************************************************************************************** @@ -34,7 +34,7 @@ * for determining which unit to use, such as deciding between "in 7 days" * and "in 1 week". * - * @draft ICU 57 + * @stable ICU 57 */ /** @@ -66,104 +66,103 @@ typedef enum UDateRelativeDateTimeFormatterStyle { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UDAT_STYLE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } UDateRelativeDateTimeFormatterStyle; -#ifndef U_HIDE_DRAFT_API /** * Represents the unit for formatting a relative date. e.g "in 5 days" * or "next year" - * @draft ICU 57 + * @stable ICU 57 */ typedef enum URelativeDateTimeUnit { /** * Specifies that relative unit is year, e.g. "last year", * "in 5 years". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_YEAR, /** * Specifies that relative unit is quarter, e.g. "last quarter", * "in 5 quarters". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_QUARTER, /** * Specifies that relative unit is month, e.g. "last month", * "in 5 months". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_MONTH, /** * Specifies that relative unit is week, e.g. "last week", * "in 5 weeks". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_WEEK, /** * Specifies that relative unit is day, e.g. "yesterday", * "in 5 days". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_DAY, /** * Specifies that relative unit is hour, e.g. "1 hour ago", * "in 5 hours". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_HOUR, /** * Specifies that relative unit is minute, e.g. "1 minute ago", * "in 5 minutes". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_MINUTE, /** * Specifies that relative unit is second, e.g. "1 second ago", * "in 5 seconds". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_SECOND, /** * Specifies that relative unit is Sunday, e.g. "last Sunday", * "this Sunday", "next Sunday", "in 5 Sundays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_SUNDAY, /** * Specifies that relative unit is Monday, e.g. "last Monday", * "this Monday", "next Monday", "in 5 Mondays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_MONDAY, /** * Specifies that relative unit is Tuesday, e.g. "last Tuesday", * "this Tuesday", "next Tuesday", "in 5 Tuesdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_TUESDAY, /** * Specifies that relative unit is Wednesday, e.g. "last Wednesday", * "this Wednesday", "next Wednesday", "in 5 Wednesdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_WEDNESDAY, /** * Specifies that relative unit is Thursday, e.g. "last Thursday", * "this Thursday", "next Thursday", "in 5 Thursdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_THURSDAY, /** * Specifies that relative unit is Friday, e.g. "last Friday", * "this Friday", "next Friday", "in 5 Fridays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_FRIDAY, /** * Specifies that relative unit is Saturday, e.g. "last Saturday", * "this Saturday", "next Saturday", "in 5 Saturdays". - * @draft ICU 57 + * @stable ICU 57 */ UDAT_REL_UNIT_SATURDAY, #ifndef U_HIDE_DEPRECATED_API @@ -172,18 +171,15 @@ typedef enum URelativeDateTimeUnit { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UDAT_REL_UNIT_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } URelativeDateTimeUnit; -#endif /* U_HIDE_DRAFT_API */ - -#ifndef U_HIDE_DRAFT_API /** * Opaque URelativeDateTimeFormatter object for use in C programs. - * @draft ICU 57 + * @stable ICU 57 */ struct URelativeDateTimeFormatter; -typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C typedef for struct URelativeDateTimeFormatter. @draft ICU 57 */ +typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C typedef for struct URelativeDateTimeFormatter. @stable ICU 57 */ /** @@ -216,9 +212,9 @@ typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C ty * @return * A pointer to a URelativeDateTimeFormatter object for the specified locale, * or NULL if an error occurred. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT URelativeDateTimeFormatter* U_EXPORT2 +U_STABLE URelativeDateTimeFormatter* U_EXPORT2 ureldatefmt_open( const char* locale, UNumberFormat* nfToAdopt, UDateRelativeDateTimeFormatterStyle width, @@ -229,9 +225,9 @@ ureldatefmt_open( const char* locale, * Close a URelativeDateTimeFormatter object. Once closed it may no longer be used. * @param reldatefmt * The URelativeDateTimeFormatter object to close. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT void U_EXPORT2 +U_STABLE void U_EXPORT2 ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt); #if U_SHOW_CPLUSPLUS_API @@ -245,7 +241,7 @@ U_NAMESPACE_BEGIN * * @see LocalPointerBase * @see LocalPointer - * @draft ICU 57 + * @stable ICU 57 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close); @@ -279,9 +275,9 @@ U_NAMESPACE_END * @return * The length of the formatted result; may be greater * than resultCapacity, in which case an error is returned. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt, double offset, URelativeDateTimeUnit unit, @@ -315,9 +311,9 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt, * @return * The length of the formatted result; may be greater * than resultCapacity, in which case an error is returned. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt, double offset, URelativeDateTimeUnit unit, @@ -352,9 +348,9 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt, * @return * The length of the formatted result; may be greater than resultCapacity, * in which case an error is returned. - * @draft ICU 57 + * @stable ICU 57 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt, const UChar * relativeDateString, int32_t relativeDateStringLen, @@ -364,8 +360,6 @@ ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt, int32_t resultCapacity, UErrorCode* status ); -#endif /* U_HIDE_DRAFT_API */ - #endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */ #endif diff --git a/deps/icu-small/source/i18n/unicode/usearch.h b/deps/icu-small/source/i18n/unicode/usearch.h index dcdb7fe420..600f9142b4 100644 --- a/deps/icu-small/source/i18n/unicode/usearch.h +++ b/deps/icu-small/source/i18n/unicode/usearch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** @@ -196,7 +196,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ USEARCH_ATTRIBUTE_COUNT = 3 -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } USearchAttribute; /** @@ -272,7 +272,7 @@ typedef enum { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ USEARCH_ATTRIBUTE_VALUE_COUNT -#endif // U_HIDE_DEPRECATED_API +#endif /* U_HIDE_DEPRECATED_API */ } USearchAttributeValue; /* open and close ------------------------------------------------------ */ diff --git a/deps/icu-small/source/i18n/unicode/uspoof.h b/deps/icu-small/source/i18n/unicode/uspoof.h index 40b73380c5..6c2ac5e109 100644 --- a/deps/icu-small/source/i18n/unicode/uspoof.h +++ b/deps/icu-small/source/i18n/unicode/uspoof.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* *************************************************************************** @@ -6,7 +6,7 @@ * and others. All Rights Reserved. *************************************************************************** * file name: uspoof.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * diff --git a/deps/icu-small/source/i18n/unicode/utmscale.h b/deps/icu-small/source/i18n/unicode/utmscale.h index 6b4b389ac8..2392c6414e 100644 --- a/deps/icu-small/source/i18n/unicode/utmscale.h +++ b/deps/icu-small/source/i18n/unicode/utmscale.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -283,10 +283,14 @@ typedef enum UDateTimeScale { */ UDTS_UNIX_MICROSECONDS_TIME, +#ifndef U_HIDE_DEPRECATED_API /** * The first unused time scale value. The limit of this enum + * @deprecated ICU 59 The numeric value may change over time, see ICU ticket #12420. */ UDTS_MAX_SCALE +#endif /* U_HIDE_DEPRECATED_API */ + } UDateTimeScale; /** @@ -423,12 +427,15 @@ typedef enum UTimeScaleValue { #endif /* U_HIDE_INTERNAL_API */ +#ifndef U_HIDE_DEPRECATED_API /** * The number of time scale values, in other words limit of this enum. * * @see utmscale_getTimeScaleValue + * @deprecated ICU 59 The numeric value may change over time, see ICU ticket #12420. */ UTSV_MAX_SCALE_VALUE=11 +#endif /* U_HIDE_DEPRECATED_API */ } UTimeScaleValue; diff --git a/deps/icu-small/source/i18n/unicode/utrans.h b/deps/icu-small/source/i18n/unicode/utrans.h index 661ee5d385..a4158726ca 100644 --- a/deps/icu-small/source/i18n/unicode/utrans.h +++ b/deps/icu-small/source/i18n/unicode/utrans.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* diff --git a/deps/icu-small/source/i18n/unicode/vtzone.h b/deps/icu-small/source/i18n/unicode/vtzone.h index 1682a3d526..5d16177868 100644 --- a/deps/icu-small/source/i18n/unicode/vtzone.h +++ b/deps/icu-small/source/i18n/unicode/vtzone.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* |