diff --git a/.eslintrc.js b/.eslintrc.js
index ba94036b0f50bc..f59f65f8065c58 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -129,6 +129,7 @@ module.exports = {
'no-dupe-else-if': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
+ 'no-else-return': ['error', { allowElseIf: true }],
'no-empty-character-class': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
@@ -189,34 +190,6 @@ module.exports = {
// as well to lib/.eslintrc.yaml.
'no-restricted-syntax': [
'error',
- {
- selector: "CallExpression[callee.property.name='deepStrictEqual'][arguments.2.type='Literal']",
- message: 'Do not use a literal for the third argument of assert.deepStrictEqual()',
- },
- {
- selector: "CallExpression[callee.property.name='doesNotThrow']",
- message: 'Do not use `assert.doesNotThrow()`. Write the code without the wrapper and add a comment instead.',
- },
- {
- selector: "CallExpression[callee.property.name='doesNotReject']",
- message: 'Do not use `assert.doesNotReject()`. Write the code without the wrapper and add a comment instead.',
- },
- {
- selector: "CallExpression[callee.property.name='rejects'][arguments.length<2]",
- message: '`assert.rejects()` must be invoked with at least two arguments.',
- },
- {
- selector: "CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']",
- message: 'Do not use a literal for the third argument of assert.strictEqual()',
- },
- {
- selector: "CallExpression[callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])",
- message: 'Use an object as second argument of `assert.throws()`.',
- },
- {
- selector: "CallExpression[callee.property.name='throws'][arguments.length<2]",
- message: '`assert.throws()` must be invoked with at least two arguments.',
- },
{
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
message: '`setTimeout()` must be invoked with at least two arguments.',
@@ -229,22 +202,6 @@ module.exports = {
selector: 'ThrowStatement > CallExpression[callee.name=/Error$/]',
message: 'Use `new` keyword when throwing an `Error`.',
},
- {
- selector: "CallExpression[callee.property.name='notDeepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])",
- message: 'The first argument should be the `actual`, not the `expected` value.',
- },
- {
- selector: "CallExpression[callee.property.name='notStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])",
- message: 'The first argument should be the `actual`, not the `expected` value.',
- },
- {
- selector: "CallExpression[callee.property.name='deepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])",
- message: 'The first argument should be the `actual`, not the `expected` value.',
- },
- {
- selector: "CallExpression[callee.property.name='strictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])",
- message: 'The first argument should be the `actual`, not the `expected` value.',
- },
{
selector: "CallExpression[callee.name='isNaN']",
message: 'Use Number.isNaN() instead of the global isNaN() function.',
diff --git a/.github/ISSUE_TEMPLATE/3-api-ref-docs-problem.md b/.github/ISSUE_TEMPLATE/3-api-ref-docs-problem.md
new file mode 100644
index 00000000000000..3ec3959eb67173
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/3-api-ref-docs-problem.md
@@ -0,0 +1,54 @@
+---
+name: "\U0001F4D7 Open an issue regarding the Node.js API reference docs"
+about: Let us know about any problematic API reference documents
+title: "doc: "
+labels: doc
+---
+
+# 📗 API Reference Docs Problem
+
+
+
+
+
+- **Version**: ✍️
+- **Platform**: ✍️
+- **Subsystem**: ✍️
+
+## Location
+
+_Section of the site where the content exists_
+
+Affected URL(s):
+- https://nodejs.org/api/✍️
+
+## Problem description
+
+_Concise explanation of what you found to be problematic_
+
+
+
+✍️
+
+---
+
+
+
+- [ ] I would like to work on this issue and submit a pull request.
diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml
index 4b0bc052f0c190..cfe0ca4ab70334 100644
--- a/.github/workflows/test-linux.yml
+++ b/.github/workflows/test-linux.yml
@@ -18,6 +18,6 @@ jobs:
- name: Environment Information
run: npx envinfo
- name: Build
- run: make build-ci -j2 V=1
+ run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn"
- name: Test
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p dots"
diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml
index 8bb0ab6d71001e..c78ab45e4b2398 100644
--- a/.github/workflows/test-macos.yml
+++ b/.github/workflows/test-macos.yml
@@ -18,6 +18,6 @@ jobs:
- name: Environment Information
run: npx envinfo
- name: Build
- run: make build-ci -j8 V=1
+ run: make build-ci -j8 V=1 CONFIG_FLAGS="--error-on-warn"
- name: Test
run: make run-ci -j8 V=1 TEST_CI_ARGS="-p dots"
diff --git a/BUILDING.md b/BUILDING.md
index a7dc040f5f385e..13caddbdc13e98 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -249,6 +249,8 @@ Installation via Linux package manager can be achieved with:
FreeBSD and OpenBSD users may also need to install `libexecinfo`.
+Python 3 users may also need to install `python3-distutils`.
+
#### macOS prerequisites
* Xcode Command Line Tools >= 10 for macOS
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8bec924fac1fc6..f7b21ae6d6a2d4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,7 +31,8 @@ release.
* The calendar fields we support for interval formatting are:
- * year, month, date, day-of-week, am-pm, hour, hour-of-day, minute, and second
+ * year, month, date, day-of-week, am-pm, hour, hour-of-day, minute, second,
+ * and millisecond.
* (though we do not currently have specific intervalFormat date for skeletons
- * with seconds).
+ * with seconds and millisecond).
* Those calendar fields can be defined in the following order:
- * year > month > date > hour (in day) > minute > second
+ * year > month > date > hour (in day) > minute > second > millisecond
*
* The largest different calendar fields between 2 calendars is the
* first different calendar field in above order.
@@ -503,7 +502,6 @@ class U_I18N_API DateIntervalFormat : public Format {
FieldPosition& fieldPosition,
UErrorCode& status) const ;
-#ifndef U_HIDE_DRAFT_API
/**
* Format a DateInterval to produce a FormattedDateInterval.
*
@@ -512,12 +510,11 @@ class U_I18N_API DateIntervalFormat : public Format {
* @param dtInterval DateInterval to be formatted.
* @param status Set if an error occurs.
* @return A FormattedDateInterval containing the format result.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedDateInterval formatToValue(
const DateInterval& dtInterval,
UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Format 2 Calendars to produce a string.
@@ -548,7 +545,6 @@ class U_I18N_API DateIntervalFormat : public Format {
FieldPosition& fieldPosition,
UErrorCode& status) const ;
-#ifndef U_HIDE_DRAFT_API
/**
* Format 2 Calendars to produce a FormattedDateInterval.
*
@@ -563,13 +559,12 @@ class U_I18N_API DateIntervalFormat : public Format {
* to be formatted into date interval string
* @param status Set if an error occurs.
* @return A FormattedDateInterval containing the format result.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedDateInterval formatToValue(
Calendar& fromCalendar,
Calendar& toCalendar,
UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Date interval parsing is not supported. Please do not use.
diff --git a/deps/icu-small/source/i18n/unicode/dtitvinf.h b/deps/icu-small/source/i18n/unicode/dtitvinf.h
index 3c666231abd060..50e19abb4ce2cb 100644
--- a/deps/icu-small/source/i18n/unicode/dtitvinf.h
+++ b/deps/icu-small/source/i18n/unicode/dtitvinf.h
@@ -137,8 +137,8 @@ U_NAMESPACE_BEGIN
* After a DateIntervalInfo object is created, clients may modify
* the interval patterns using setIntervalPattern function as so desired.
* Currently, users can only set interval patterns when the following
- * calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH,
- * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, and MINUTE.
+ * calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH,
+ * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND.
* Interval patterns when other calendar fields are different is not supported.
*
* DateIntervalInfo objects are cloneable.
@@ -245,7 +245,7 @@ class U_I18N_API DateIntervalInfo U_FINAL : public UObject {
* Restriction:
* Currently, users can only set interval patterns when the following
* calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH,
- * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, and MINUTE.
+ * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND and MILLISECOND.
* Interval patterns when other calendar fields are different are
* not supported.
*
@@ -348,7 +348,7 @@ class U_I18N_API DateIntervalInfo U_FINAL : public UObject {
/**
* Following is for saving the interval patterns.
* We only support interval patterns on
- * ERA, YEAR, MONTH, DAY, AM_PM, HOUR, and MINUTE
+ * ERA, YEAR, MONTH, DAY, AM_PM, HOUR, MINUTE, SECOND and MILLISECOND.
*/
enum IntervalPatternIndex
{
@@ -360,6 +360,7 @@ class U_I18N_API DateIntervalInfo U_FINAL : public UObject {
kIPI_HOUR,
kIPI_MINUTE,
kIPI_SECOND,
+ kIPI_MILLISECOND,
kIPI_MAX_INDEX
};
public:
@@ -453,8 +454,8 @@ class U_I18N_API DateIntervalInfo U_FINAL : public UObject {
* hash table.
*
* Since we only support the following calendar fields:
- * ERA, YEAR, MONTH, DATE, DAY_OF_MONTH, DAY_OF_WEEK,
- * AM_PM, HOUR, HOUR_OF_DAY, and MINUTE,
+ * ERA, YEAR, MONTH, DATE, DAY_OF_MONTH, DAY_OF_WEEK,
+ * AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND.
* We reserve only 4 interval patterns for a skeleton.
*
* @param field calendar field
diff --git a/deps/icu-small/source/i18n/unicode/dtptngen.h b/deps/icu-small/source/i18n/unicode/dtptngen.h
index a71938b31cf5d8..f79c6d45dc6b29 100644
--- a/deps/icu-small/source/i18n/unicode/dtptngen.h
+++ b/deps/icu-small/source/i18n/unicode/dtptngen.h
@@ -483,6 +483,26 @@ class U_I18N_API DateTimePatternGenerator : public UObject {
*/
const UnicodeString& getDecimal() const;
+#if !UCONFIG_NO_FORMATTING
+
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Get the default hour cycle for a locale. Uses the locale that the
+ * DateTimePatternGenerator was initially created with.
+ *
+ * Cannot be used on an empty DateTimePatternGenerator instance.
+ *
+ * @param status Output param set to success/failure code on exit, which
+ * which must not indicate a failure before the function call.
+ * Set to U_UNSUPPORTED_ERROR if used on an empty instance.
+ * @return the default hour cycle.
+ * @draft ICU 67
+ */
+ UDateFormatHourCycle getDefaultHourCycle(UErrorCode& status) const;
+#endif /* U_HIDE_DRAFT_API */
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
diff --git a/deps/icu-small/source/i18n/unicode/formattedvalue.h b/deps/icu-small/source/i18n/unicode/formattedvalue.h
index 1b130bbdd9d44c..4469b6328e7cb9 100644
--- a/deps/icu-small/source/i18n/unicode/formattedvalue.h
+++ b/deps/icu-small/source/i18n/unicode/formattedvalue.h
@@ -25,11 +25,6 @@ U_NAMESPACE_BEGIN
* of APIs throughout ICU use these classes for expressing their localized output.
*/
-
-// The following cannot have #ifndef U_HIDE_DRAFT_API because
-// class FormattedValue depends on it, and FormattedValue cannot be
-// hidden becauseclass FormattedNumber (stable ICU 60) depends on it.
-#ifndef U_FORCE_HIDE_DRAFT_API
/**
* Represents a span of a string containing a given field.
*
@@ -41,7 +36,7 @@ U_NAMESPACE_BEGIN
*
* This class is not intended for public subclassing.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
class U_I18N_API ConstrainedFieldPosition : public UMemory {
public:
@@ -51,21 +46,20 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
*
* By default, the ConstrainedFieldPosition has no iteration constraints.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
ConstrainedFieldPosition();
- /** @draft ICU 64 */
+ /** @stable ICU 64 */
~ConstrainedFieldPosition();
-#ifndef U_HIDE_DRAFT_API
/**
* Resets this ConstrainedFieldPosition to its initial state, as if it were newly created:
*
* - Removes any constraints that may have been set on the instance.
* - Resets the iteration position.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
void reset();
@@ -89,7 +83,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* does not generally have well-defined behavior.
*
* @param category The field category to fix when iterating.
- * @draft ICU 64
+ * @stable ICU 64
*/
void constrainCategory(int32_t category);
@@ -114,7 +108,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
*
* @param category The field category to fix when iterating.
* @param field The field to fix when iterating.
- * @draft ICU 64
+ * @stable ICU 64
*/
void constrainField(int32_t category, int32_t field);
@@ -125,7 +119,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* FormattedValue#nextPosition returns TRUE.
*
* @return The field category saved in the instance.
- * @draft ICU 64
+ * @stable ICU 64
*/
inline int32_t getCategory() const {
return fCategory;
@@ -138,7 +132,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* FormattedValue#nextPosition returns TRUE.
*
* @return The field saved in the instance.
- * @draft ICU 64
+ * @stable ICU 64
*/
inline int32_t getField() const {
return fField;
@@ -150,7 +144,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* The return value is well-defined only after FormattedValue#nextPosition returns TRUE.
*
* @return The start index saved in the instance.
- * @draft ICU 64
+ * @stable ICU 64
*/
inline int32_t getStart() const {
return fStart;
@@ -162,7 +156,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* The return value is well-defined only after FormattedValue#nextPosition returns TRUE.
*
* @return The end index saved in the instance.
- * @draft ICU 64
+ * @stable ICU 64
*/
inline int32_t getLimit() const {
return fLimit;
@@ -181,7 +175,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* Users of FormattedValue should not need to call this method.
*
* @return The current iteration context from {@link #setInt64IterationContext}.
- * @draft ICU 64
+ * @stable ICU 64
*/
inline int64_t getInt64IterationContext() const {
return fContext;
@@ -193,7 +187,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* Intended to be used by FormattedValue implementations.
*
* @param context The new iteration context.
- * @draft ICU 64
+ * @stable ICU 64
*/
void setInt64IterationContext(int64_t context);
@@ -205,7 +199,7 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
*
* @param category The category to test.
* @param field The field to test.
- * @draft ICU 64
+ * @stable ICU 64
*/
UBool matchesField(int32_t category, int32_t field) const;
@@ -221,39 +215,32 @@ class U_I18N_API ConstrainedFieldPosition : public UMemory {
* @param field The new field.
* @param start The new inclusive start index.
* @param limit The new exclusive end index.
- * @draft ICU 64
+ * @stable ICU 64
*/
void setState(
int32_t category,
int32_t field,
int32_t start,
int32_t limit);
-#endif /* U_HIDE_DRAFT_API */
private:
int64_t fContext = 0LL;
int32_t fField = 0;
int32_t fStart = 0;
int32_t fLimit = 0;
-#ifndef U_HIDE_DRAFT_API
int32_t fCategory = UFIELD_CATEGORY_UNDEFINED;
-#else /* U_HIDE_DRAFT_API */
- int32_t fCategory = 0;
-#endif /* U_HIDE_DRAFT_API */
int8_t fConstraint = 0;
};
-// The following cannot have #ifndef U_HIDE_DRAFT_API because
-// class FormattedNumber (stable ICU 60) depends on it.
/**
* An abstract formatted value: a string with associated field attributes.
* Many formatters format to classes implementing FormattedValue.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
class U_I18N_API FormattedValue /* not : public UObject because this is an interface/mixin class */ {
public:
- /** @draft ICU 64 */
+ /** @stable ICU 64 */
virtual ~FormattedValue();
/**
@@ -264,7 +251,7 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @param status Set if an error occurs.
* @return a UnicodeString containing the formatted string.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
virtual UnicodeString toString(UErrorCode& status) const = 0;
@@ -280,7 +267,7 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @param status Set if an error occurs.
* @return a temporary UnicodeString containing the formatted string.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
virtual UnicodeString toTempString(UErrorCode& status) const = 0;
@@ -292,7 +279,7 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @param status Set if an error occurs.
* @return The same Appendable, for chaining.
*
- * @draft ICU 64
+ * @stable ICU 64
* @see Appendable
*/
virtual Appendable& appendTo(Appendable& appendable, UErrorCode& status) const = 0;
@@ -317,11 +304,10 @@ class U_I18N_API FormattedValue /* not : public UObject because this is an inter
* @return TRUE if a new occurrence of the field was found;
* FALSE otherwise or if an error was set.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
virtual UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const = 0;
};
-#endif // U_FORCE_HIDE_DRAFT_API
U_NAMESPACE_END
diff --git a/deps/icu-small/source/i18n/unicode/listformatter.h b/deps/icu-small/source/i18n/unicode/listformatter.h
index 88fc46cf37b2a3..a969a8744dcf58 100644
--- a/deps/icu-small/source/i18n/unicode/listformatter.h
+++ b/deps/icu-small/source/i18n/unicode/listformatter.h
@@ -26,10 +26,10 @@
#include "unicode/unistr.h"
#include "unicode/locid.h"
#include "unicode/formattedvalue.h"
+#include "unicode/ulistformatter.h"
U_NAMESPACE_BEGIN
-class FieldPositionIterator;
class FieldPositionHandler;
class FormattedListData;
class ListFormatter;
@@ -50,9 +50,11 @@ struct ListFormatData : public UMemory {
UnicodeString startPattern;
UnicodeString middlePattern;
UnicodeString endPattern;
+ Locale locale;
- ListFormatData(const UnicodeString& two, const UnicodeString& start, const UnicodeString& middle, const UnicodeString& end) :
- twoPattern(two), startPattern(start), middlePattern(middle), endPattern(end) {}
+ ListFormatData(const UnicodeString& two, const UnicodeString& start, const UnicodeString& middle, const UnicodeString& end,
+ const Locale& loc) :
+ twoPattern(two), startPattern(start), middlePattern(middle), endPattern(end), locale(loc) {}
};
/** \endcond */
@@ -64,7 +66,6 @@ struct ListFormatData : public UMemory {
#if !UCONFIG_NO_FORMATTING
-#ifndef U_HIDE_DRAFT_API
/**
* An immutable class containing the result of a list formatting operation.
*
@@ -79,25 +80,25 @@ struct ListFormatData : public UMemory {
*
* Not intended for public subclassing.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
class U_I18N_API FormattedList : public UMemory, public FormattedValue {
public:
/**
* Default constructor; makes an empty FormattedList.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedList() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
/**
* Move constructor: Leaves the source FormattedList in an undefined state.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedList(FormattedList&& src) U_NOEXCEPT;
/**
* Destruct an instance of FormattedList.
- * @draft ICU 64
+ * @stable ICU 64
*/
virtual ~FormattedList() U_OVERRIDE;
@@ -109,7 +110,7 @@ class U_I18N_API FormattedList : public UMemory, public FormattedValue {
/**
* Move assignment: Leaves the source FormattedList in an undefined state.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedList& operator=(FormattedList&& src) U_NOEXCEPT;
@@ -134,7 +135,6 @@ class U_I18N_API FormattedList : public UMemory, public FormattedValue {
: fData(nullptr), fErrorCode(errorCode) {}
friend class ListFormatter;
};
-#endif /* U_HIDE_DRAFT_API */
#endif // !UCONFIG_NO_FORMATTING
@@ -185,10 +185,29 @@ class U_I18N_API ListFormatter : public UObject{
*/
static ListFormatter* createInstance(const Locale& locale, UErrorCode& errorCode);
+#ifndef U_HIDE_DRAFT_API
+#if !UCONFIG_NO_FORMATTING
+ /**
+ * Creates a ListFormatter for the given locale, list type, and style.
+ *
+ * @param locale The locale.
+ * @param type The type of list formatting to use.
+ * @param width The width of formatting to use.
+ * @param errorCode ICU error code, set if no data available for the given locale.
+ * @return A ListFormatter object created from internal data derived from CLDR data.
+ * @draft ICU 67
+ */
+ static ListFormatter* createInstance(
+ const Locale& locale, UListFormatterType type, UListFormatterWidth width, UErrorCode& errorCode);
+#endif /* !UCONFIG_NO_FORMATTING */
+#endif /* U_HIDE_DRAFT_API */
+
#ifndef U_HIDE_INTERNAL_API
/**
* Creates a ListFormatter appropriate for a locale and style.
*
+ * TODO(ICU-20888): Remove this in ICU 68.
+ *
* @param locale The locale.
* @param style the style, either "standard", "or", "unit", "unit-narrow", or "unit-short"
* @param errorCode ICU error code, set if no data available for the given locale.
@@ -220,29 +239,7 @@ class U_I18N_API ListFormatter : public UObject{
UnicodeString& format(const UnicodeString items[], int32_t n_items,
UnicodeString& appendTo, UErrorCode& errorCode) const;
-#ifndef U_HIDE_DRAFT_API
- /**
- * Format a list of strings.
- *
- * @param items An array of strings to be combined and formatted.
- * @param n_items Length of the array items.
- * @param appendTo The string to which the formatted result will be
- * appended.
- * @param posIter On return, can be used to iterate over positions of
- * fields generated by this format call. Field values are
- * defined in UListFormatterField. Can be NULL.
- * @param errorCode ICU error code returned here.
- * @return Formatted string combining the elements of items,
- * appended to appendTo.
- * @draft ICU 63
- */
- UnicodeString& format(const UnicodeString items[], int32_t n_items,
- UnicodeString & appendTo, FieldPositionIterator* posIter,
- UErrorCode& errorCode) const;
-#endif // U_HIDE_DRAFT_API
-
#if !UCONFIG_NO_FORMATTING
-#ifndef U_HIDE_DRAFT_API
/**
* Formats a list of strings to a FormattedList, which exposes field
* position information. The FormattedList contains more information than
@@ -252,13 +249,12 @@ class U_I18N_API ListFormatter : public UObject{
* @param n_items Length of the array items.
* @param errorCode ICU error code returned here.
* @return A FormattedList containing field information.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedList formatStringsToValue(
const UnicodeString items[],
int32_t n_items,
UErrorCode& errorCode) const;
-#endif /* U_HIDE_DRAFT_API */
#endif // !UCONFIG_NO_FORMATTING
#ifndef U_HIDE_INTERNAL_API
diff --git a/deps/icu-small/source/i18n/unicode/measunit.h b/deps/icu-small/source/i18n/unicode/measunit.h
index 08f337cb5bb630..8b65497e12eb63 100644
--- a/deps/icu-small/source/i18n/unicode/measunit.h
+++ b/deps/icu-small/source/i18n/unicode/measunit.h
@@ -20,6 +20,7 @@
#if !UCONFIG_NO_FORMATTING
#include "unicode/unistr.h"
+#include "unicode/localpointer.h"
/**
* \file
@@ -29,6 +30,202 @@
U_NAMESPACE_BEGIN
class StringEnumeration;
+struct MeasureUnitImpl;
+
+#ifndef U_HIDE_DRAFT_API
+/**
+ * Enumeration for unit complexity. There are three levels:
+ *
+ * - SINGLE: A single unit, optionally with a power and/or SI prefix. Examples: hectare,
+ * square-kilometer, kilojoule, per-second.
+ * - COMPOUND: A unit composed of the product of multiple single units. Examples:
+ * meter-per-second, kilowatt-hour, kilogram-meter-per-square-second.
+ * - MIXED: A unit composed of the sum of multiple single units. Examples: foot+inch,
+ * hour+minute+second, degree+arcminute+arcsecond.
+ *
+ * The complexity determines which operations are available. For example, you cannot set the power
+ * or SI prefix of a compound unit.
+ *
+ * @draft ICU 67
+ */
+enum UMeasureUnitComplexity {
+ /**
+ * A single unit, like kilojoule.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_UNIT_SINGLE,
+
+ /**
+ * A compound unit, like meter-per-second.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_UNIT_COMPOUND,
+
+ /**
+ * A mixed unit, like hour+minute.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_UNIT_MIXED
+};
+
+/**
+ * Enumeration for SI prefixes, such as "kilo".
+ *
+ * @draft ICU 67
+ */
+typedef enum UMeasureSIPrefix {
+
+ /**
+ * SI prefix: yotta, 10^24.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_YOTTA = 24,
+
+ /**
+ * SI prefix: zetta, 10^21.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_ZETTA = 21,
+
+ /**
+ * SI prefix: exa, 10^18.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_EXA = 18,
+
+ /**
+ * SI prefix: peta, 10^15.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_PETA = 15,
+
+ /**
+ * SI prefix: tera, 10^12.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_TERA = 12,
+
+ /**
+ * SI prefix: giga, 10^9.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_GIGA = 9,
+
+ /**
+ * SI prefix: mega, 10^6.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_MEGA = 6,
+
+ /**
+ * SI prefix: kilo, 10^3.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_KILO = 3,
+
+ /**
+ * SI prefix: hecto, 10^2.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_HECTO = 2,
+
+ /**
+ * SI prefix: deka, 10^1.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_DEKA = 1,
+
+ /**
+ * The absence of an SI prefix.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_ONE = 0,
+
+ /**
+ * SI prefix: deci, 10^-1.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_DECI = -1,
+
+ /**
+ * SI prefix: centi, 10^-2.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_CENTI = -2,
+
+ /**
+ * SI prefix: milli, 10^-3.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_MILLI = -3,
+
+ /**
+ * SI prefix: micro, 10^-6.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_MICRO = -6,
+
+ /**
+ * SI prefix: nano, 10^-9.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_NANO = -9,
+
+ /**
+ * SI prefix: pico, 10^-12.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_PICO = -12,
+
+ /**
+ * SI prefix: femto, 10^-15.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_FEMTO = -15,
+
+ /**
+ * SI prefix: atto, 10^-18.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_ATTO = -18,
+
+ /**
+ * SI prefix: zepto, 10^-21.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_ZEPTO = -21,
+
+ /**
+ * SI prefix: yocto, 10^-24.
+ *
+ * @draft ICU 67
+ */
+ UMEASURE_SI_PREFIX_YOCTO = -24
+} UMeasureSIPrefix;
+#endif // U_HIDE_DRAFT_API
/**
* A unit such as length, mass, volume, currency, etc. A unit is
@@ -53,12 +250,42 @@ class U_I18N_API MeasureUnit: public UObject {
*/
MeasureUnit(const MeasureUnit &other);
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Move constructor.
+ * @draft ICU 67
+ */
+ MeasureUnit(MeasureUnit &&other) noexcept;
+
+ /**
+ * Construct a MeasureUnit from a CLDR Unit Identifier, defined in UTS 35.
+ * Validates and canonicalizes the identifier.
+ *
+ *
+ * MeasureUnit example = MeasureUnit::forIdentifier("furlong-per-nanosecond")
+ *
+ *
+ * @param identifier The CLDR Unit Identifier
+ * @param status Set if the identifier is invalid.
+ * @draft ICU 67
+ */
+ static MeasureUnit forIdentifier(StringPiece identifier, UErrorCode& status);
+#endif // U_HIDE_DRAFT_API
+
/**
- * Assignment operator.
+ * Copy assignment operator.
* @stable ICU 3.0
*/
MeasureUnit &operator=(const MeasureUnit &other);
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Move assignment operator.
+ * @draft ICU 67
+ */
+ MeasureUnit &operator=(MeasureUnit &&other) noexcept;
+#endif // U_HIDE_DRAFT_API
+
/**
* Returns a polymorphic clone of this object. The result will
* have the same class as returned by getDynamicClassID().
@@ -90,16 +317,156 @@ class U_I18N_API MeasureUnit: public UObject {
/**
* Get the type.
+ *
+ * If the unit does not have a type, the empty string is returned.
+ *
* @stable ICU 53
*/
const char *getType() const;
/**
* Get the sub type.
+ *
+ * If the unit does not have a subtype, the empty string is returned.
+ *
* @stable ICU 53
*/
const char *getSubtype() const;
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Get the CLDR Unit Identifier for this MeasureUnit, as defined in UTS 35.
+ *
+ * @return The string form of this unit, owned by this MeasureUnit.
+ * @draft ICU 67
+ */
+ const char* getIdentifier() const;
+
+ /**
+ * Compute the complexity of the unit. See UMeasureUnitComplexity for more information.
+ *
+ * @param status Set if an error occurs.
+ * @return The unit complexity.
+ * @draft ICU 67
+ */
+ UMeasureUnitComplexity getComplexity(UErrorCode& status) const;
+
+ /**
+ * Creates a MeasureUnit which is this SINGLE unit augmented with the specified SI prefix.
+ * For example, UMEASURE_SI_PREFIX_KILO for "kilo".
+ *
+ * There is sufficient locale data to format all standard SI prefixes.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * @param prefix The SI prefix, from UMeasureSIPrefix.
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return A new SINGLE unit.
+ * @draft ICU 67
+ */
+ MeasureUnit withSIPrefix(UMeasureSIPrefix prefix, UErrorCode& status) const;
+
+ /**
+ * Gets the current SI prefix of this SINGLE unit. For example, if the unit has the SI prefix
+ * "kilo", then UMEASURE_SI_PREFIX_KILO is returned.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return The SI prefix of this SINGLE unit, from UMeasureSIPrefix.
+ * @draft ICU 67
+ */
+ UMeasureSIPrefix getSIPrefix(UErrorCode& status) const;
+
+ /**
+ * Creates a MeasureUnit which is this SINGLE unit augmented with the specified dimensionality
+ * (power). For example, if dimensionality is 2, the unit will be squared.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * For the base dimensionless unit, withDimensionality does nothing.
+ *
+ * @param dimensionality The dimensionality (power).
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return A new SINGLE unit.
+ * @draft ICU 67
+ */
+ MeasureUnit withDimensionality(int32_t dimensionality, UErrorCode& status) const;
+
+ /**
+ * Gets the dimensionality (power) of this MeasureUnit. For example, if the unit is square,
+ * then 2 is returned.
+ *
+ * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * For the base dimensionless unit, getDimensionality returns 0.
+ *
+ * @param status Set if this is not a SINGLE unit or if another error occurs.
+ * @return The dimensionality (power) of this simple unit.
+ * @draft ICU 67
+ */
+ int32_t getDimensionality(UErrorCode& status) const;
+
+ /**
+ * Gets the reciprocal of this MeasureUnit, with the numerator and denominator flipped.
+ *
+ * For example, if the receiver is "meter-per-second", the unit "second-per-meter" is returned.
+ *
+ * NOTE: Only works on SINGLE and COMPOUND units. If this is a MIXED unit, an error will
+ * occur. For more information, see UMeasureUnitComplexity.
+ *
+ * @param status Set if this is a MIXED unit or if another error occurs.
+ * @return The reciprocal of the target unit.
+ * @draft ICU 67
+ */
+ MeasureUnit reciprocal(UErrorCode& status) const;
+
+ /**
+ * Gets the product of this unit with another unit. This is a way to build units from
+ * constituent parts.
+ *
+ * The numerator and denominator are preserved through this operation.
+ *
+ * For example, if the receiver is "kilowatt" and the argument is "hour-per-day", then the
+ * unit "kilowatt-hour-per-day" is returned.
+ *
+ * NOTE: Only works on SINGLE and COMPOUND units. If either unit (receivee and argument) is a
+ * MIXED unit, an error will occur. For more information, see UMeasureUnitComplexity.
+ *
+ * @param other The MeasureUnit to multiply with the target.
+ * @param status Set if this or other is a MIXED unit or if another error occurs.
+ * @return The product of the target unit with the provided unit.
+ * @draft ICU 67
+ */
+ MeasureUnit product(const MeasureUnit& other, UErrorCode& status) const;
+#endif // U_HIDE_DRAFT_API
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * Gets the list of SINGLE units contained within a MIXED of COMPOUND unit.
+ *
+ * Examples:
+ * - Given "meter-kilogram-per-second", three units will be returned: "meter",
+ * "kilogram", and "per-second".
+ * - Given "hour+minute+second", three units will be returned: "hour", "minute",
+ * and "second".
+ *
+ * If this is a SINGLE unit, an array of length 1 will be returned.
+ *
+ * TODO(ICU-21021): Finalize this API and propose it as draft.
+ *
+ * @param outCount The number of elements in the return array.
+ * @param status Set if an error occurs.
+ * @return An array of single units, owned by the caller.
+ * @internal ICU 67 Technical Preview
+ */
+ LocalArray splitToSingleUnits(int32_t& outCount, UErrorCode& status) const;
+#endif // U_HIDE_INTERNAL_API
+
/**
* getAvailable gets all of the available units.
* If there are too many units to fit into destCapacity then the
@@ -219,17 +586,15 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGForce(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of acceleration: g-force.
* Also see {@link #createGForce()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGForce();
-#endif /* U_HIDE_DRAFT_API */
/**
- * Returns by pointer, unit of acceleration: meter-per-second-squared.
+ * Returns by pointer, unit of acceleration: meter-per-square-second.
* Caller owns returned value and must free it.
* Also see {@link #getMeterPerSecondSquared()}.
* @param status ICU error code.
@@ -237,14 +602,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
- * Returns by value, unit of acceleration: meter-per-second-squared.
+ * Returns by value, unit of acceleration: meter-per-square-second.
* Also see {@link #createMeterPerSecondSquared()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMeterPerSecondSquared();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of angle: arc-minute.
@@ -255,14 +618,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createArcMinute(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of angle: arc-minute.
* Also see {@link #createArcMinute()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getArcMinute();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of angle: arc-second.
@@ -273,14 +634,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createArcSecond(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of angle: arc-second.
* Also see {@link #createArcSecond()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getArcSecond();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of angle: degree.
@@ -291,14 +650,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createDegree(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of angle: degree.
* Also see {@link #createDegree()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getDegree();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of angle: radian.
@@ -309,14 +666,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createRadian(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of angle: radian.
* Also see {@link #createRadian()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getRadian();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of angle: revolution.
@@ -327,14 +682,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createRevolutionAngle(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of angle: revolution.
* Also see {@link #createRevolutionAngle()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getRevolutionAngle();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: acre.
@@ -345,32 +698,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createAcre(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: acre.
* Also see {@link #createAcre()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getAcre();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of area: dunam.
* Caller owns returned value and must free it.
* Also see {@link #getDunam()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createDunam(UErrorCode &status);
/**
* Returns by value, unit of area: dunam.
* Also see {@link #createDunam()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getDunam();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: hectare.
@@ -381,14 +730,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createHectare(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: hectare.
* Also see {@link #createHectare()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getHectare();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: square-centimeter.
@@ -399,14 +746,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSquareCentimeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: square-centimeter.
* Also see {@link #createSquareCentimeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSquareCentimeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: square-foot.
@@ -417,14 +762,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSquareFoot(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: square-foot.
* Also see {@link #createSquareFoot()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSquareFoot();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: square-inch.
@@ -435,14 +778,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSquareInch(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: square-inch.
* Also see {@link #createSquareInch()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSquareInch();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: square-kilometer.
@@ -453,14 +794,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSquareKilometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: square-kilometer.
* Also see {@link #createSquareKilometer()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSquareKilometer();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: square-meter.
@@ -471,14 +810,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSquareMeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: square-meter.
* Also see {@link #createSquareMeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSquareMeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: square-mile.
@@ -489,14 +826,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSquareMile(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: square-mile.
* Also see {@link #createSquareMile()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSquareMile();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of area: square-yard.
@@ -507,14 +842,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSquareYard(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of area: square-yard.
* Also see {@link #createSquareYard()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSquareYard();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of concentr: karat.
@@ -525,14 +858,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKarat(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of concentr: karat.
* Also see {@link #createKarat()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKarat();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of concentr: milligram-per-deciliter.
@@ -543,14 +874,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of concentr: milligram-per-deciliter.
* Also see {@link #createMilligramPerDeciliter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilligramPerDeciliter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of concentr: millimole-per-liter.
@@ -561,35 +890,31 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMillimolePerLiter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of concentr: millimole-per-liter.
* Also see {@link #createMillimolePerLiter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMillimolePerLiter();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of concentr: mole.
* Caller owns returned value and must free it.
* Also see {@link #getMole()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createMole(UErrorCode &status);
/**
* Returns by value, unit of concentr: mole.
* Also see {@link #createMole()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMole();
-#endif /* U_HIDE_DRAFT_API */
/**
- * Returns by pointer, unit of concentr: part-per-million.
+ * Returns by pointer, unit of concentr: permillion.
* Caller owns returned value and must free it.
* Also see {@link #getPartPerMillion()}.
* @param status ICU error code.
@@ -597,14 +922,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPartPerMillion(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
- * Returns by value, unit of concentr: part-per-million.
+ * Returns by value, unit of concentr: permillion.
* Also see {@link #createPartPerMillion()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPartPerMillion();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of concentr: percent.
@@ -615,14 +938,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPercent(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of concentr: percent.
* Also see {@link #createPercent()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPercent();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of concentr: permille.
@@ -633,35 +954,31 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPermille(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of concentr: permille.
* Also see {@link #createPermille()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPermille();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of concentr: permyriad.
* Caller owns returned value and must free it.
* Also see {@link #getPermyriad()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createPermyriad(UErrorCode &status);
/**
* Returns by value, unit of concentr: permyriad.
* Also see {@link #createPermyriad()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPermyriad();
-#endif /* U_HIDE_DRAFT_API */
/**
- * Returns by pointer, unit of consumption: liter-per-100kilometers.
+ * Returns by pointer, unit of consumption: liter-per-100-kilometer.
* Caller owns returned value and must free it.
* Also see {@link #getLiterPer100Kilometers()}.
* @param status ICU error code.
@@ -669,14 +986,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createLiterPer100Kilometers(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
- * Returns by value, unit of consumption: liter-per-100kilometers.
+ * Returns by value, unit of consumption: liter-per-100-kilometer.
* Also see {@link #createLiterPer100Kilometers()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getLiterPer100Kilometers();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of consumption: liter-per-kilometer.
@@ -687,14 +1002,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createLiterPerKilometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of consumption: liter-per-kilometer.
* Also see {@link #createLiterPerKilometer()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getLiterPerKilometer();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of consumption: mile-per-gallon.
@@ -705,14 +1018,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilePerGallon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of consumption: mile-per-gallon.
* Also see {@link #createMilePerGallon()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilePerGallon();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of consumption: mile-per-gallon-imperial.
@@ -723,14 +1034,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilePerGallonImperial(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of consumption: mile-per-gallon-imperial.
* Also see {@link #createMilePerGallonImperial()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilePerGallonImperial();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: bit.
@@ -741,14 +1050,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createBit(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: bit.
* Also see {@link #createBit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getBit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: byte.
@@ -759,14 +1066,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createByte(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: byte.
* Also see {@link #createByte()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getByte();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: gigabit.
@@ -777,14 +1082,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGigabit(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: gigabit.
* Also see {@link #createGigabit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGigabit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: gigabyte.
@@ -795,14 +1098,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGigabyte(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: gigabyte.
* Also see {@link #createGigabyte()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGigabyte();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: kilobit.
@@ -813,14 +1114,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilobit(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: kilobit.
* Also see {@link #createKilobit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilobit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: kilobyte.
@@ -831,14 +1130,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilobyte(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: kilobyte.
* Also see {@link #createKilobyte()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilobyte();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: megabit.
@@ -849,14 +1146,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMegabit(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: megabit.
* Also see {@link #createMegabit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMegabit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: megabyte.
@@ -867,14 +1162,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMegabyte(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: megabyte.
* Also see {@link #createMegabyte()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMegabyte();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: petabyte.
@@ -885,14 +1178,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPetabyte(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: petabyte.
* Also see {@link #createPetabyte()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPetabyte();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: terabit.
@@ -903,14 +1194,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createTerabit(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: terabit.
* Also see {@link #createTerabit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getTerabit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of digital: terabyte.
@@ -921,14 +1210,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createTerabyte(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of digital: terabyte.
* Also see {@link #createTerabyte()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getTerabyte();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: century.
@@ -939,14 +1226,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCentury(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: century.
* Also see {@link #createCentury()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCentury();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: day.
@@ -957,32 +1242,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createDay(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: day.
* Also see {@link #createDay()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getDay();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of duration: day-person.
* Caller owns returned value and must free it.
* Also see {@link #getDayPerson()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createDayPerson(UErrorCode &status);
/**
* Returns by value, unit of duration: day-person.
* Also see {@link #createDayPerson()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getDayPerson();
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
@@ -1011,14 +1292,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createHour(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: hour.
* Also see {@link #createHour()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getHour();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: microsecond.
@@ -1029,14 +1308,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMicrosecond(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: microsecond.
* Also see {@link #createMicrosecond()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMicrosecond();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: millisecond.
@@ -1047,14 +1324,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMillisecond(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: millisecond.
* Also see {@link #createMillisecond()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMillisecond();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: minute.
@@ -1065,14 +1340,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMinute(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: minute.
* Also see {@link #createMinute()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMinute();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: month.
@@ -1083,32 +1356,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMonth(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: month.
* Also see {@link #createMonth()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMonth();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of duration: month-person.
* Caller owns returned value and must free it.
* Also see {@link #getMonthPerson()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createMonthPerson(UErrorCode &status);
/**
* Returns by value, unit of duration: month-person.
* Also see {@link #createMonthPerson()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMonthPerson();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: nanosecond.
@@ -1119,14 +1388,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createNanosecond(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: nanosecond.
* Also see {@link #createNanosecond()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getNanosecond();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: second.
@@ -1137,14 +1404,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createSecond(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: second.
* Also see {@link #createSecond()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSecond();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: week.
@@ -1155,32 +1420,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createWeek(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: week.
* Also see {@link #createWeek()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getWeek();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of duration: week-person.
* Caller owns returned value and must free it.
* Also see {@link #getWeekPerson()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createWeekPerson(UErrorCode &status);
/**
* Returns by value, unit of duration: week-person.
* Also see {@link #createWeekPerson()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getWeekPerson();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of duration: year.
@@ -1191,32 +1452,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createYear(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of duration: year.
* Also see {@link #createYear()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getYear();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of duration: year-person.
* Caller owns returned value and must free it.
* Also see {@link #getYearPerson()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createYearPerson(UErrorCode &status);
/**
* Returns by value, unit of duration: year-person.
* Also see {@link #createYearPerson()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getYearPerson();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of electric: ampere.
@@ -1227,14 +1484,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createAmpere(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of electric: ampere.
* Also see {@link #createAmpere()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getAmpere();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of electric: milliampere.
@@ -1245,14 +1500,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilliampere(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of electric: milliampere.
* Also see {@link #createMilliampere()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilliampere();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of electric: ohm.
@@ -1263,14 +1516,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createOhm(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of electric: ohm.
* Also see {@link #createOhm()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getOhm();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of electric: volt.
@@ -1281,32 +1532,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createVolt(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of electric: volt.
* Also see {@link #createVolt()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getVolt();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of energy: british-thermal-unit.
* Caller owns returned value and must free it.
* Also see {@link #getBritishThermalUnit()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createBritishThermalUnit(UErrorCode &status);
/**
* Returns by value, unit of energy: british-thermal-unit.
* Also see {@link #createBritishThermalUnit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getBritishThermalUnit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of energy: calorie.
@@ -1317,32 +1564,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCalorie(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of energy: calorie.
* Also see {@link #createCalorie()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCalorie();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of energy: electronvolt.
* Caller owns returned value and must free it.
* Also see {@link #getElectronvolt()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createElectronvolt(UErrorCode &status);
/**
* Returns by value, unit of energy: electronvolt.
* Also see {@link #createElectronvolt()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getElectronvolt();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of energy: foodcalorie.
@@ -1353,14 +1596,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createFoodcalorie(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of energy: foodcalorie.
* Also see {@link #createFoodcalorie()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getFoodcalorie();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of energy: joule.
@@ -1371,14 +1612,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createJoule(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of energy: joule.
* Also see {@link #createJoule()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getJoule();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of energy: kilocalorie.
@@ -1389,14 +1628,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilocalorie(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of energy: kilocalorie.
* Also see {@link #createKilocalorie()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilocalorie();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of energy: kilojoule.
@@ -1407,14 +1644,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilojoule(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of energy: kilojoule.
* Also see {@link #createKilojoule()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilojoule();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of energy: kilowatt-hour.
@@ -1425,14 +1660,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilowattHour(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of energy: kilowatt-hour.
* Also see {@link #createKilowattHour()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilowattHour();
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
@@ -1452,41 +1685,37 @@ class U_I18N_API MeasureUnit: public UObject {
static MeasureUnit getThermUs();
#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of force: newton.
* Caller owns returned value and must free it.
* Also see {@link #getNewton()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createNewton(UErrorCode &status);
/**
* Returns by value, unit of force: newton.
* Also see {@link #createNewton()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getNewton();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of force: pound-force.
* Caller owns returned value and must free it.
* Also see {@link #getPoundForce()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createPoundForce(UErrorCode &status);
/**
* Returns by value, unit of force: pound-force.
* Also see {@link #createPoundForce()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPoundForce();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of frequency: gigahertz.
@@ -1497,14 +1726,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGigahertz(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of frequency: gigahertz.
* Also see {@link #createGigahertz()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGigahertz();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of frequency: hertz.
@@ -1515,14 +1742,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createHertz(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of frequency: hertz.
* Also see {@link #createHertz()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getHertz();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of frequency: kilohertz.
@@ -1533,14 +1758,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilohertz(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of frequency: kilohertz.
* Also see {@link #createKilohertz()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilohertz();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of frequency: megahertz.
@@ -1551,14 +1774,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMegahertz(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of frequency: megahertz.
* Also see {@link #createMegahertz()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMegahertz();
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
@@ -1695,14 +1916,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createAstronomicalUnit(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: astronomical-unit.
* Also see {@link #createAstronomicalUnit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getAstronomicalUnit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: centimeter.
@@ -1713,14 +1932,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCentimeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: centimeter.
* Also see {@link #createCentimeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCentimeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: decimeter.
@@ -1731,14 +1948,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createDecimeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: decimeter.
* Also see {@link #createDecimeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getDecimeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: fathom.
@@ -1749,14 +1964,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createFathom(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: fathom.
* Also see {@link #createFathom()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getFathom();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: foot.
@@ -1767,14 +1980,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createFoot(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: foot.
* Also see {@link #createFoot()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getFoot();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: furlong.
@@ -1785,14 +1996,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createFurlong(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: furlong.
* Also see {@link #createFurlong()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getFurlong();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: inch.
@@ -1803,14 +2012,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createInch(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: inch.
* Also see {@link #createInch()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getInch();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: kilometer.
@@ -1821,14 +2028,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: kilometer.
* Also see {@link #createKilometer()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilometer();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: light-year.
@@ -1839,14 +2044,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createLightYear(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: light-year.
* Also see {@link #createLightYear()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getLightYear();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: meter.
@@ -1857,14 +2060,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: meter.
* Also see {@link #createMeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: micrometer.
@@ -1875,14 +2076,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMicrometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: micrometer.
* Also see {@link #createMicrometer()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMicrometer();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: mile.
@@ -1893,14 +2092,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMile(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: mile.
* Also see {@link #createMile()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMile();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: mile-scandinavian.
@@ -1911,14 +2108,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMileScandinavian(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: mile-scandinavian.
* Also see {@link #createMileScandinavian()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMileScandinavian();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: millimeter.
@@ -1929,14 +2124,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMillimeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: millimeter.
* Also see {@link #createMillimeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMillimeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: nanometer.
@@ -1947,14 +2140,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createNanometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: nanometer.
* Also see {@link #createNanometer()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getNanometer();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: nautical-mile.
@@ -1965,14 +2156,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createNauticalMile(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: nautical-mile.
* Also see {@link #createNauticalMile()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getNauticalMile();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: parsec.
@@ -1983,14 +2172,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createParsec(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: parsec.
* Also see {@link #createParsec()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getParsec();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: picometer.
@@ -2001,14 +2188,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPicometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: picometer.
* Also see {@link #createPicometer()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPicometer();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: point.
@@ -2019,32 +2204,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPoint(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: point.
* Also see {@link #createPoint()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPoint();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of length: solar-radius.
* Caller owns returned value and must free it.
* Also see {@link #getSolarRadius()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createSolarRadius(UErrorCode &status);
/**
* Returns by value, unit of length: solar-radius.
* Also see {@link #createSolarRadius()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSolarRadius();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of length: yard.
@@ -2055,14 +2236,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createYard(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of length: yard.
* Also see {@link #createYard()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getYard();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of light: lux.
@@ -2073,32 +2252,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createLux(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of light: lux.
* Also see {@link #createLux()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getLux();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of light: solar-luminosity.
* Caller owns returned value and must free it.
* Also see {@link #getSolarLuminosity()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createSolarLuminosity(UErrorCode &status);
/**
* Returns by value, unit of light: solar-luminosity.
* Also see {@link #createSolarLuminosity()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSolarLuminosity();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: carat.
@@ -2109,50 +2284,44 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCarat(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: carat.
* Also see {@link #createCarat()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCarat();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of mass: dalton.
* Caller owns returned value and must free it.
* Also see {@link #getDalton()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createDalton(UErrorCode &status);
/**
* Returns by value, unit of mass: dalton.
* Also see {@link #createDalton()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getDalton();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of mass: earth-mass.
* Caller owns returned value and must free it.
* Also see {@link #getEarthMass()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createEarthMass(UErrorCode &status);
/**
* Returns by value, unit of mass: earth-mass.
* Also see {@link #createEarthMass()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getEarthMass();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: gram.
@@ -2163,14 +2332,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGram(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: gram.
* Also see {@link #createGram()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGram();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: kilogram.
@@ -2181,14 +2348,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilogram(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: kilogram.
* Also see {@link #createKilogram()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilogram();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: metric-ton.
@@ -2199,14 +2364,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMetricTon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: metric-ton.
* Also see {@link #createMetricTon()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMetricTon();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: microgram.
@@ -2217,14 +2380,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMicrogram(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: microgram.
* Also see {@link #createMicrogram()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMicrogram();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: milligram.
@@ -2235,14 +2396,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilligram(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: milligram.
* Also see {@link #createMilligram()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilligram();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: ounce.
@@ -2253,14 +2412,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createOunce(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: ounce.
* Also see {@link #createOunce()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getOunce();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: ounce-troy.
@@ -2271,14 +2428,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createOunceTroy(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: ounce-troy.
* Also see {@link #createOunceTroy()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getOunceTroy();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: pound.
@@ -2289,32 +2444,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPound(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: pound.
* Also see {@link #createPound()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPound();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of mass: solar-mass.
* Caller owns returned value and must free it.
* Also see {@link #getSolarMass()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createSolarMass(UErrorCode &status);
/**
* Returns by value, unit of mass: solar-mass.
* Also see {@link #createSolarMass()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getSolarMass();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: stone.
@@ -2325,14 +2476,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createStone(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: stone.
* Also see {@link #createStone()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getStone();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of mass: ton.
@@ -2343,14 +2492,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createTon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of mass: ton.
* Also see {@link #createTon()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getTon();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of power: gigawatt.
@@ -2361,14 +2508,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGigawatt(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of power: gigawatt.
* Also see {@link #createGigawatt()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGigawatt();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of power: horsepower.
@@ -2379,14 +2524,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createHorsepower(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of power: horsepower.
* Also see {@link #createHorsepower()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getHorsepower();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of power: kilowatt.
@@ -2397,14 +2540,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilowatt(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of power: kilowatt.
* Also see {@link #createKilowatt()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilowatt();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of power: megawatt.
@@ -2415,14 +2556,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMegawatt(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of power: megawatt.
* Also see {@link #createMegawatt()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMegawatt();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of power: milliwatt.
@@ -2433,14 +2572,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilliwatt(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of power: milliwatt.
* Also see {@link #createMilliwatt()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilliwatt();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of power: watt.
@@ -2451,14 +2588,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createWatt(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of power: watt.
* Also see {@link #createWatt()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getWatt();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of pressure: atmosphere.
@@ -2469,14 +2604,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createAtmosphere(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of pressure: atmosphere.
* Also see {@link #createAtmosphere()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getAtmosphere();
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
@@ -2505,17 +2638,15 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createHectopascal(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of pressure: hectopascal.
* Also see {@link #createHectopascal()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getHectopascal();
-#endif /* U_HIDE_DRAFT_API */
/**
- * Returns by pointer, unit of pressure: inch-hg.
+ * Returns by pointer, unit of pressure: inch-ofhg.
* Caller owns returned value and must free it.
* Also see {@link #getInchHg()}.
* @param status ICU error code.
@@ -2523,50 +2654,44 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createInchHg(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
- * Returns by value, unit of pressure: inch-hg.
+ * Returns by value, unit of pressure: inch-ofhg.
* Also see {@link #createInchHg()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getInchHg();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of pressure: kilopascal.
* Caller owns returned value and must free it.
* Also see {@link #getKilopascal()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createKilopascal(UErrorCode &status);
/**
* Returns by value, unit of pressure: kilopascal.
* Also see {@link #createKilopascal()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilopascal();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of pressure: megapascal.
* Caller owns returned value and must free it.
* Also see {@link #getMegapascal()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createMegapascal(UErrorCode &status);
/**
* Returns by value, unit of pressure: megapascal.
* Also see {@link #createMegapascal()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMegapascal();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of pressure: millibar.
@@ -2577,17 +2702,15 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMillibar(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of pressure: millibar.
* Also see {@link #createMillibar()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMillibar();
-#endif /* U_HIDE_DRAFT_API */
/**
- * Returns by pointer, unit of pressure: millimeter-of-mercury.
+ * Returns by pointer, unit of pressure: millimeter-ofhg.
* Caller owns returned value and must free it.
* Also see {@link #getMillimeterOfMercury()}.
* @param status ICU error code.
@@ -2595,14 +2718,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMillimeterOfMercury(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
- * Returns by value, unit of pressure: millimeter-of-mercury.
+ * Returns by value, unit of pressure: millimeter-ofhg.
* Also see {@link #createMillimeterOfMercury()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMillimeterOfMercury();
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DRAFT_API
/**
@@ -2623,7 +2744,7 @@ class U_I18N_API MeasureUnit: public UObject {
#endif /* U_HIDE_DRAFT_API */
/**
- * Returns by pointer, unit of pressure: pound-per-square-inch.
+ * Returns by pointer, unit of pressure: pound-force-per-square-inch.
* Caller owns returned value and must free it.
* Also see {@link #getPoundPerSquareInch()}.
* @param status ICU error code.
@@ -2631,14 +2752,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPoundPerSquareInch(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
- * Returns by value, unit of pressure: pound-per-square-inch.
+ * Returns by value, unit of pressure: pound-force-per-square-inch.
* Also see {@link #createPoundPerSquareInch()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPoundPerSquareInch();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of speed: kilometer-per-hour.
@@ -2649,14 +2768,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKilometerPerHour(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of speed: kilometer-per-hour.
* Also see {@link #createKilometerPerHour()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKilometerPerHour();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of speed: knot.
@@ -2667,14 +2784,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKnot(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of speed: knot.
* Also see {@link #createKnot()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKnot();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of speed: meter-per-second.
@@ -2685,14 +2800,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMeterPerSecond(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of speed: meter-per-second.
* Also see {@link #createMeterPerSecond()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMeterPerSecond();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of speed: mile-per-hour.
@@ -2703,14 +2816,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilePerHour(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of speed: mile-per-hour.
* Also see {@link #createMilePerHour()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilePerHour();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of temperature: celsius.
@@ -2721,14 +2832,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCelsius(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of temperature: celsius.
* Also see {@link #createCelsius()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCelsius();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of temperature: fahrenheit.
@@ -2739,14 +2848,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createFahrenheit(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of temperature: fahrenheit.
* Also see {@link #createFahrenheit()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getFahrenheit();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of temperature: generic.
@@ -2757,14 +2864,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGenericTemperature(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of temperature: generic.
* Also see {@link #createGenericTemperature()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGenericTemperature();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of temperature: kelvin.
@@ -2775,50 +2880,44 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKelvin(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of temperature: kelvin.
* Also see {@link #createKelvin()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getKelvin();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of torque: newton-meter.
* Caller owns returned value and must free it.
* Also see {@link #getNewtonMeter()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createNewtonMeter(UErrorCode &status);
/**
* Returns by value, unit of torque: newton-meter.
* Also see {@link #createNewtonMeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getNewtonMeter();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
- * Returns by pointer, unit of torque: pound-foot.
+ * Returns by pointer, unit of torque: pound-force-foot.
* Caller owns returned value and must free it.
* Also see {@link #getPoundFoot()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createPoundFoot(UErrorCode &status);
/**
- * Returns by value, unit of torque: pound-foot.
+ * Returns by value, unit of torque: pound-force-foot.
* Also see {@link #createPoundFoot()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPoundFoot();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: acre-foot.
@@ -2829,32 +2928,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createAcreFoot(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: acre-foot.
* Also see {@link #createAcreFoot()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getAcreFoot();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of volume: barrel.
* Caller owns returned value and must free it.
* Also see {@link #getBarrel()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createBarrel(UErrorCode &status);
/**
* Returns by value, unit of volume: barrel.
* Also see {@link #createBarrel()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getBarrel();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: bushel.
@@ -2865,14 +2960,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createBushel(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: bushel.
* Also see {@link #createBushel()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getBushel();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: centiliter.
@@ -2883,14 +2976,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCentiliter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: centiliter.
* Also see {@link #createCentiliter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCentiliter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cubic-centimeter.
@@ -2901,14 +2992,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCubicCentimeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cubic-centimeter.
* Also see {@link #createCubicCentimeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCubicCentimeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cubic-foot.
@@ -2919,14 +3008,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCubicFoot(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cubic-foot.
* Also see {@link #createCubicFoot()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCubicFoot();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cubic-inch.
@@ -2937,14 +3024,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCubicInch(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cubic-inch.
* Also see {@link #createCubicInch()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCubicInch();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cubic-kilometer.
@@ -2955,14 +3040,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCubicKilometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cubic-kilometer.
* Also see {@link #createCubicKilometer()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCubicKilometer();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cubic-meter.
@@ -2973,14 +3056,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCubicMeter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cubic-meter.
* Also see {@link #createCubicMeter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCubicMeter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cubic-mile.
@@ -2991,14 +3072,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCubicMile(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cubic-mile.
* Also see {@link #createCubicMile()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCubicMile();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cubic-yard.
@@ -3009,14 +3088,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCubicYard(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cubic-yard.
* Also see {@link #createCubicYard()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCubicYard();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cup.
@@ -3027,14 +3104,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCup(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cup.
* Also see {@link #createCup()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCup();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: cup-metric.
@@ -3045,14 +3120,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createCupMetric(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: cup-metric.
* Also see {@link #createCupMetric()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getCupMetric();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: deciliter.
@@ -3063,14 +3136,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createDeciliter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: deciliter.
* Also see {@link #createDeciliter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getDeciliter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: fluid-ounce.
@@ -3081,32 +3152,28 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createFluidOunce(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: fluid-ounce.
* Also see {@link #createFluidOunce()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getFluidOunce();
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of volume: fluid-ounce-imperial.
* Caller owns returned value and must free it.
* Also see {@link #getFluidOunceImperial()}.
* @param status ICU error code.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit *createFluidOunceImperial(UErrorCode &status);
/**
* Returns by value, unit of volume: fluid-ounce-imperial.
* Also see {@link #createFluidOunceImperial()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getFluidOunceImperial();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: gallon.
@@ -3117,14 +3184,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGallon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: gallon.
* Also see {@link #createGallon()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGallon();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: gallon-imperial.
@@ -3135,14 +3200,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGallonImperial(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: gallon-imperial.
* Also see {@link #createGallonImperial()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getGallonImperial();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: hectoliter.
@@ -3153,14 +3216,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createHectoliter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: hectoliter.
* Also see {@link #createHectoliter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getHectoliter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: liter.
@@ -3171,14 +3232,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createLiter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: liter.
* Also see {@link #createLiter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getLiter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: megaliter.
@@ -3189,14 +3248,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMegaliter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: megaliter.
* Also see {@link #createMegaliter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMegaliter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: milliliter.
@@ -3207,14 +3264,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilliliter(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: milliliter.
* Also see {@link #createMilliliter()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getMilliliter();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: pint.
@@ -3225,14 +3280,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPint(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: pint.
* Also see {@link #createPint()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPint();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: pint-metric.
@@ -3243,14 +3296,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPintMetric(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: pint-metric.
* Also see {@link #createPintMetric()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getPintMetric();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: quart.
@@ -3261,14 +3312,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createQuart(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: quart.
* Also see {@link #createQuart()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getQuart();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: tablespoon.
@@ -3279,14 +3328,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createTablespoon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: tablespoon.
* Also see {@link #createTablespoon()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getTablespoon();
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns by pointer, unit of volume: teaspoon.
@@ -3297,14 +3344,12 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createTeaspoon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns by value, unit of volume: teaspoon.
* Also see {@link #createTeaspoon()}.
- * @draft ICU 64
+ * @stable ICU 64
*/
static MeasureUnit getTeaspoon();
-#endif /* U_HIDE_DRAFT_API */
// End generated createXXX methods
@@ -3322,7 +3367,7 @@ class U_I18N_API MeasureUnit: public UObject {
* For ICU use only.
* @internal
*/
- void initCurrency(const char *isoCurrency);
+ void initCurrency(StringPiece isoCurrency);
/**
* For ICU use only.
@@ -3333,16 +3378,34 @@ class U_I18N_API MeasureUnit: public UObject {
#endif /* U_HIDE_INTERNAL_API */
private:
- int32_t fTypeId;
- int32_t fSubTypeId;
- char fCurrency[4];
- MeasureUnit(int32_t typeId, int32_t subTypeId) : fTypeId(typeId), fSubTypeId(subTypeId) {
- fCurrency[0] = 0;
- }
+ // Used by new draft APIs in ICU 67. If non-null, fImpl is owned by the
+ // MeasureUnit.
+ MeasureUnitImpl* fImpl;
+
+ // An index into a static string list in measunit.cpp. If set to -1, fImpl
+ // is in use instead of fTypeId and fSubTypeId.
+ int16_t fSubTypeId;
+ // An index into a static string list in measunit.cpp. If set to -1, fImpl
+ // is in use instead of fTypeId and fSubTypeId.
+ int8_t fTypeId;
+
+ MeasureUnit(int32_t typeId, int32_t subTypeId);
+ MeasureUnit(MeasureUnitImpl&& impl);
void setTo(int32_t typeId, int32_t subTypeId);
int32_t getOffset() const;
static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status);
+
+ /**
+ * Sets output's typeId and subTypeId according to subType, if subType is a
+ * valid/known identifier.
+ *
+ * @return Whether subType is known to ICU. If false, output was not
+ * modified.
+ */
+ static bool findBySubType(StringPiece subType, MeasureUnit* output);
+
+ friend struct MeasureUnitImpl;
};
U_NAMESPACE_END
diff --git a/deps/icu-small/source/i18n/unicode/numberformatter.h b/deps/icu-small/source/i18n/unicode/numberformatter.h
index 42d4687ed3feb3..615cf49f7b7539 100644
--- a/deps/icu-small/source/i18n/unicode/numberformatter.h
+++ b/deps/icu-small/source/i18n/unicode/numberformatter.h
@@ -155,6 +155,8 @@ class DecNum;
class NumberRangeFormatterImpl;
struct RangeMacroProps;
struct UFormattedNumberImpl;
+class MutablePatternModifier;
+class ImmutablePatternModifier;
/**
* Used for NumberRangeFormatter and implemented in numrange_fluent.cpp.
@@ -980,9 +982,13 @@ class U_I18N_API IntegerWidth : public UMemory {
friend struct impl::MacroProps;
friend struct impl::MicroProps;
- // To allow NumberFormatterImpl to access isBogus() and perform other operations:
+ // To allow NumberFormatterImpl to access isBogus():
friend class impl::NumberFormatterImpl;
+ // To allow the use of this class when formatting:
+ friend class impl::MutablePatternModifier;
+ friend class impl::ImmutablePatternModifier;
+
// So that NumberPropertyMapper can create instances
friend class impl::NumberPropertyMapper;
@@ -1409,9 +1415,6 @@ struct U_I18N_API MacroProps : public UMemory {
/** @internal */
const PluralRules* rules = nullptr; // no ownership
- /** @internal */
- const CurrencySymbols* currencySymbols = nullptr; // no ownership
-
/** @internal */
int32_t threshold = kInternalDefaultThreshold;
@@ -1433,6 +1436,16 @@ struct U_I18N_API MacroProps : public UMemory {
} // namespace impl
+#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
+// Ignore MSVC warning 4661. This is generated for NumberFormatterSettings<>::toSkeleton() as this method
+// is defined elsewhere (in number_skeletons.cpp). The compiler is warning that the explicit template instantiation
+// inside this single translation unit (CPP file) is incomplete, and thus it isn't sure if the template class is
+// fully defined. However, since each translation unit explicitly instantiates all the necessary template classes,
+// they will all be passed to the linker, and the linker will still find and export all the class members.
+#pragma warning(push)
+#pragma warning(disable: 4661)
+#endif
+
/**
* An abstract base class for specifying settings related to number formatting. This class is implemented by
* {@link UnlocalizedNumberFormatter} and {@link LocalizedNumberFormatter}. This class is not intended for
@@ -2082,7 +2095,6 @@ class U_I18N_API NumberFormatterSettings {
*/
UnicodeString toSkeleton(UErrorCode& status) const;
-#ifndef U_HIDE_DRAFT_API
/**
* Returns the current (Un)LocalizedNumberFormatter as a LocalPointer
* wrapping a heap-allocated copy of the current object.
@@ -2092,7 +2104,7 @@ class U_I18N_API NumberFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberFormatter pointer, or a wrapped
* nullptr on failure.
- * @draft ICU 64
+ * @stable ICU 64
*/
LocalPointer clone() const &;
@@ -2101,10 +2113,9 @@ class U_I18N_API NumberFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberFormatter pointer, or a wrapped
* nullptr on failure.
- * @draft ICU 64
+ * @stable ICU 64
*/
LocalPointer clone() &&;
-#endif /* U_HIDE_DRAFT_API */
/**
* Sets the UErrorCode if an error occurred in the fluent chain.
@@ -2399,6 +2410,11 @@ class U_I18N_API LocalizedNumberFormatter
friend class UnlocalizedNumberFormatter;
};
+#if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
+// Warning 4661.
+#pragma warning(pop)
+#endif
+
/**
* The result of a number formatting operation. This class allows the result to be exported in several data types,
* including a UnicodeString and a FieldPositionIterator.
@@ -2410,15 +2426,12 @@ class U_I18N_API LocalizedNumberFormatter
class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
public:
- // Default constructor cannot have #ifndef U_HIDE_DRAFT_API
-#ifndef U_FORCE_HIDE_DRAFT_API
/**
* Default constructor; makes an empty FormattedNumber.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedNumber()
: fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
-#endif // U_FORCE_HIDE_DRAFT_API
/**
* Move constructor: Leaves the source FormattedNumber in an undefined state.
@@ -2472,60 +2485,6 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
/** @copydoc FormattedValue::nextPosition() */
UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const U_OVERRIDE;
-#ifndef U_HIDE_DRAFT_API
- /**
- * Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
- * field in the output string. This allows you to determine the locations of, for example,
- * the integer part, fraction part, or symbols.
- *
- * This is a simpler but less powerful alternative to {@link #nextPosition}.
- *
- * If a field occurs just once, calling this method will find that occurrence and return it. If a
- * field occurs multiple times, this method may be called repeatedly with the following pattern:
- *
- *
- * FieldPosition fpos(UNUM_GROUPING_SEPARATOR_FIELD);
- * while (formattedNumber.nextFieldPosition(fpos, status)) {
- * // do something with fpos.
- * }
- *
- *
- * This method is useful if you know which field to query. If you want all available field position
- * information, use {@link #nextPosition} or {@link #getAllFieldPositions}.
- *
- * @param fieldPosition
- * Input+output variable. On input, the "field" property determines which field to look
- * up, and the "beginIndex" and "endIndex" properties determine where to begin the search.
- * On output, the "beginIndex" is set to the beginning of the first occurrence of the
- * field with either begin or end indices after the input indices; "endIndex" is set to
- * the end of that occurrence of the field (exclusive index). If a field position is not
- * found, the method returns FALSE and the FieldPosition may or may not be changed.
- * @param status
- * Set if an error occurs while populating the FieldPosition.
- * @return TRUE if a new occurrence of the field was found; FALSE otherwise.
- * @draft ICU 62
- * @see UNumberFormatFields
- */
- UBool nextFieldPosition(FieldPosition& fieldPosition, UErrorCode& status) const;
-
- /**
- * Export the formatted number to a FieldPositionIterator. This allows you to determine which characters in
- * the output string correspond to which fields, such as the integer part, fraction part, and sign.
- *
- * This is an alternative to the more powerful #nextPosition() API.
- *
- * If information on only one field is needed, use #nextPosition() or #nextFieldPosition() instead.
- *
- * @param iterator
- * The FieldPositionIterator to populate with all of the fields present in the formatted number.
- * @param status
- * Set if an error occurs while populating the FieldPositionIterator.
- * @draft ICU 62
- * @see UNumberFormatFields
- */
- void getAllFieldPositions(FieldPositionIterator &iterator, UErrorCode &status) const;
-#endif /* U_HIDE_DRAFT_API */
-
#ifndef U_HIDE_DRAFT_API
/**
* Export the formatted number as a "numeric string" conforming to the
@@ -2646,7 +2605,6 @@ class U_I18N_API NumberFormatter final {
*/
static UnlocalizedNumberFormatter forSkeleton(const UnicodeString& skeleton, UErrorCode& status);
-#ifndef U_HIDE_DRAFT_API
/**
* Call this method at the beginning of a NumberFormatter fluent chain to create an instance based
* on a given number skeleton string.
@@ -2662,11 +2620,10 @@ class U_I18N_API NumberFormatter final {
* @param status
* Set to U_NUMBER_SKELETON_SYNTAX_ERROR if the skeleton was invalid.
* @return An UnlocalizedNumberFormatter, to be used for chaining.
- * @draft ICU 64
+ * @stable ICU 64
*/
static UnlocalizedNumberFormatter forSkeleton(const UnicodeString& skeleton,
UParseError& perror, UErrorCode& status);
-#endif
/**
* Use factory methods instead of the constructor to create a NumberFormatter.
diff --git a/deps/icu-small/source/i18n/unicode/numberrangeformatter.h b/deps/icu-small/source/i18n/unicode/numberrangeformatter.h
index e3a72aa8b21257..59f14d8be53189 100644
--- a/deps/icu-small/source/i18n/unicode/numberrangeformatter.h
+++ b/deps/icu-small/source/i18n/unicode/numberrangeformatter.h
@@ -449,7 +449,6 @@ class U_I18N_API NumberRangeFormatterSettings {
*/
Derived identityFallback(UNumberRangeIdentityFallback identityFallback) &&;
-#ifndef U_HIDE_DRAFT_API
/**
* Returns the current (Un)LocalizedNumberRangeFormatter as a LocalPointer
* wrapping a heap-allocated copy of the current object.
@@ -459,7 +458,7 @@ class U_I18N_API NumberRangeFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberRangeFormatter pointer, or a wrapped
* nullptr on failure.
- * @draft ICU 64
+ * @stable ICU 64
*/
LocalPointer clone() const &;
@@ -468,10 +467,9 @@ class U_I18N_API NumberRangeFormatterSettings {
*
* @return A wrapped (Un)LocalizedNumberRangeFormatter pointer, or a wrapped
* nullptr on failure.
- * @draft ICU 64
+ * @stable ICU 64
*/
LocalPointer clone() &&;
-#endif /* U_HIDE_DRAFT_API */
/**
* Sets the UErrorCode if an error occurred in the fluent chain.
@@ -728,52 +726,6 @@ class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue {
UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const U_OVERRIDE;
#ifndef U_HIDE_DRAFT_API
- /**
- * Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
- * field in the output string. This allows you to determine the locations of, for example,
- * the integer part, fraction part, or symbols.
- *
- * If both sides of the range have the same field, the field will occur twice, once before the
- * range separator and once after the range separator, if applicable.
- *
- * If a field occurs just once, calling this method will find that occurrence and return it. If a
- * field occurs multiple times, this method may be called repeatedly with the following pattern:
- *
- *
- * FieldPosition fpos(UNUM_INTEGER_FIELD);
- * while (formattedNumberRange.nextFieldPosition(fpos, status)) {
- * // do something with fpos.
- * }
- *
- *
- * This method is useful if you know which field to query. If you want all available field position
- * information, use #getAllFieldPositions().
- *
- * @param fieldPosition
- * Input+output variable. See {@link FormattedNumber#nextFieldPosition}.
- * @param status
- * Set if an error occurs while populating the FieldPosition.
- * @return TRUE if a new occurrence of the field was found; FALSE otherwise.
- * @draft ICU 63
- * @see UNumberFormatFields
- */
- UBool nextFieldPosition(FieldPosition& fieldPosition, UErrorCode& status) const;
-
- /**
- * Export the formatted number range to a FieldPositionIterator. This allows you to determine which characters in
- * the output string correspond to which fields, such as the integer part, fraction part, and sign.
- *
- * If information on only one field is needed, use #nextFieldPosition() instead.
- *
- * @param iterator
- * The FieldPositionIterator to populate with all of the fields present in the formatted number.
- * @param status
- * Set if an error occurs while populating the FieldPositionIterator.
- * @draft ICU 63
- * @see UNumberFormatFields
- */
- void getAllFieldPositions(FieldPositionIterator &iterator, UErrorCode &status) const;
-
/**
* Export the first formatted number as a decimal number. This endpoint
* is useful for obtaining the exact number being printed after scaling
diff --git a/deps/icu-small/source/i18n/unicode/numfmt.h b/deps/icu-small/source/i18n/unicode/numfmt.h
index fbd4fb4e5655b3..a882b6d2e5667d 100644
--- a/deps/icu-small/source/i18n/unicode/numfmt.h
+++ b/deps/icu-small/source/i18n/unicode/numfmt.h
@@ -239,12 +239,10 @@ class U_I18N_API NumberFormat : public Format {
kPermillField = UNUM_PERMILL_FIELD,
/** @stable ICU 2.0 */
kSignField = UNUM_SIGN_FIELD,
-#ifndef U_HIDE_DRAFT_API
- /** @draft ICU 64 */
+ /** @stable ICU 64 */
kMeasureUnitField = UNUM_MEASURE_UNIT_FIELD,
- /** @draft ICU 64 */
+ /** @stable ICU 64 */
kCompactField = UNUM_COMPACT_FIELD,
-#endif // U_HIDE_DRAFT_API
/**
* These constants are provided for backwards compatibility only.
diff --git a/deps/icu-small/source/i18n/unicode/numsys.h b/deps/icu-small/source/i18n/unicode/numsys.h
index 4fb7f044eddb76..88c172bd422a51 100644
--- a/deps/icu-small/source/i18n/unicode/numsys.h
+++ b/deps/icu-small/source/i18n/unicode/numsys.h
@@ -73,6 +73,12 @@ class U_I18N_API NumberingSystem : public UObject {
*/
NumberingSystem(const NumberingSystem& other);
+ /**
+ * Copy assignment.
+ * @stable ICU 4.2
+ */
+ NumberingSystem& operator=(const NumberingSystem& other) = default;
+
/**
* Destructor.
* @stable ICU 4.2
diff --git a/deps/icu-small/source/i18n/unicode/plurrule.h b/deps/icu-small/source/i18n/unicode/plurrule.h
index a1553567caf8f5..408efbcc4a84f8 100644
--- a/deps/icu-small/source/i18n/unicode/plurrule.h
+++ b/deps/icu-small/source/i18n/unicode/plurrule.h
@@ -350,7 +350,6 @@ class U_I18N_API PluralRules : public UObject {
*/
UnicodeString select(double number) const;
-#ifndef U_HIDE_DRAFT_API
/**
* Given a formatted number, returns the keyword of the first rule
* that applies to the number. This function can be used with
@@ -364,10 +363,9 @@ class U_I18N_API PluralRules : public UObject {
* @param status Set if an error occurs while selecting plural keyword.
* This could happen if the FormattedNumber is invalid.
* @return The keyword of the selected rule.
- * @draft ICU 64
+ * @stable ICU 64
*/
UnicodeString select(const number::FormattedNumber& number, UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API
/**
diff --git a/deps/icu-small/source/i18n/unicode/regex.h b/deps/icu-small/source/i18n/unicode/regex.h
index a003e337856af9..2f8d31d97f012f 100644
--- a/deps/icu-small/source/i18n/unicode/regex.h
+++ b/deps/icu-small/source/i18n/unicode/regex.h
@@ -66,7 +66,7 @@ class RegexCImpl;
class RegexMatcher;
class RegexPattern;
struct REStackFrame;
-class RuleBasedBreakIterator;
+class BreakIterator;
class UnicodeSet;
class UVector;
class UVector32;
@@ -612,12 +612,6 @@ class U_I18N_API RegexPattern U_FINAL : public UObject {
UVector32 *fGroupMap; // Map from capture group number to position of
// the group's variables in the matcher stack frame.
- UnicodeSet **fStaticSets; // Ptr to static (shared) sets for predefined
- // regex character classes, e.g. Word.
-
- Regex8BitSet *fStaticSets8; // Ptr to the static (shared) latin-1 only
- // sets for predefined regex classes.
-
int32_t fStartType; // Info on how a match must start.
int32_t fInitialStringIdx; //
int32_t fInitialStringLen;
@@ -1780,7 +1774,9 @@ class U_I18N_API RegexMatcher U_FINAL : public UObject {
void MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status);
inline void backTrack(int64_t &inputIdx, int32_t &patIdx);
UBool isWordBoundary(int64_t pos); // perform Perl-like \b test
- UBool isUWordBoundary(int64_t pos); // perform RBBI based \b test
+ UBool isUWordBoundary(int64_t pos, UErrorCode &status); // perform RBBI based \b test
+ // Find a grapheme cluster boundary using a break iterator. For handling \X in regexes.
+ int64_t followingGCBoundary(int64_t pos, UErrorCode &status);
REStackFrame *resetStack();
inline REStackFrame *StateSave(REStackFrame *fp, int64_t savePatIdx, UErrorCode &status);
void IncrementTime(UErrorCode &status);
@@ -1874,7 +1870,8 @@ class U_I18N_API RegexMatcher U_FINAL : public UObject {
UErrorCode fDeferredStatus; // Save error state that cannot be immediately
// reported, or that permanently disables this matcher.
- RuleBasedBreakIterator *fWordBreakItr;
+ BreakIterator *fWordBreakItr;
+ BreakIterator *fGCBreakItr;
};
U_NAMESPACE_END
diff --git a/deps/icu-small/source/i18n/unicode/reldatefmt.h b/deps/icu-small/source/i18n/unicode/reldatefmt.h
index fb691a545105b6..a991bc7986b32d 100644
--- a/deps/icu-small/source/i18n/unicode/reldatefmt.h
+++ b/deps/icu-small/source/i18n/unicode/reldatefmt.h
@@ -264,7 +264,6 @@ class UnicodeString;
class FormattedRelativeDateTime;
class FormattedRelativeDateTimeData;
-#ifndef U_HIDE_DRAFT_API
/**
* An immutable class containing the result of a relative datetime formatting operation.
*
@@ -272,25 +271,25 @@ class FormattedRelativeDateTimeData;
*
* Not intended for public subclassing.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedValue {
public:
/**
* Default constructor; makes an empty FormattedRelativeDateTime.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedRelativeDateTime() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {}
/**
* Move constructor: Leaves the source FormattedRelativeDateTime in an undefined state.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedRelativeDateTime(FormattedRelativeDateTime&& src) U_NOEXCEPT;
/**
* Destruct an instance of FormattedRelativeDateTime.
- * @draft ICU 64
+ * @stable ICU 64
*/
virtual ~FormattedRelativeDateTime() U_OVERRIDE;
@@ -302,7 +301,7 @@ class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedVal
/**
* Move assignment: Leaves the source FormattedRelativeDateTime in an undefined state.
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedRelativeDateTime& operator=(FormattedRelativeDateTime&& src) U_NOEXCEPT;
@@ -327,7 +326,6 @@ class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedVal
: fData(nullptr), fErrorCode(errorCode) {}
friend class RelativeDateTimeFormatter;
};
-#endif /* U_HIDE_DRAFT_API */
/**
* Formats simple relative dates. There are two types of relative dates that
@@ -492,7 +490,6 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
UnicodeString& appendTo,
UErrorCode& status) const;
-#ifndef U_HIDE_DRAFT_API
/**
* Formats a relative date with a quantity such as "in 5 days" or
* "3 months ago"
@@ -508,14 +505,13 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
* @param unit the unit e.g day? month? year?
* @param status ICU error code returned here.
* @return The formatted relative datetime
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedRelativeDateTime formatToValue(
double quantity,
UDateDirection direction,
UDateRelativeUnit unit,
UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Formats a relative date without a quantity.
@@ -539,7 +535,6 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
UnicodeString& appendTo,
UErrorCode& status) const;
-#ifndef U_HIDE_DRAFT_API
/**
* Formats a relative date without a quantity.
*
@@ -553,13 +548,12 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
* @param unit e.g SATURDAY, DAY, MONTH
* @param status ICU error code returned here.
* @return The formatted relative datetime
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedRelativeDateTime formatToValue(
UDateDirection direction,
UDateAbsoluteUnit unit,
UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
@@ -587,7 +581,6 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
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",
@@ -604,13 +597,12 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
* UDAT_REL_UNIT_FRIDAY.
* @param status ICU error code returned here.
* @return The formatted relative datetime
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedRelativeDateTime formatNumericToValue(
double offset,
URelativeDateTimeUnit unit,
UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
@@ -638,7 +630,6 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
UnicodeString& appendTo,
UErrorCode& status) const;
-#ifndef U_HIDE_DRAFT_API
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
* using a text style if possible, e.g. "last week", "this week",
@@ -655,13 +646,12 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
* UDAT_REL_UNIT_FRIDAY.
* @param status ICU error code returned here.
* @return The formatted relative datetime
- * @draft ICU 64
+ * @stable ICU 64
*/
FormattedRelativeDateTime formatToValue(
double offset,
URelativeDateTimeUnit unit,
UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Combines a relative date string and a time string in this object's
@@ -724,13 +714,11 @@ class U_I18N_API RelativeDateTimeFormatter : public UObject {
UErrorCode& status,
Args... args) const;
-#ifndef U_HIDE_DRAFT_API // for FormattedRelativeDateTime
template
FormattedRelativeDateTime doFormatToValue(
F callback,
UErrorCode& status,
Args... args) const;
-#endif // U_HIDE_DRAFT_API
void formatImpl(
double quantity,
diff --git a/deps/icu-small/source/i18n/unicode/selfmt.h b/deps/icu-small/source/i18n/unicode/selfmt.h
old mode 100755
new mode 100644
diff --git a/deps/icu-small/source/i18n/unicode/smpdtfmt.h b/deps/icu-small/source/i18n/unicode/smpdtfmt.h
index 79fa817d5afb89..b4b0e5fb390801 100644
--- a/deps/icu-small/source/i18n/unicode/smpdtfmt.h
+++ b/deps/icu-small/source/i18n/unicode/smpdtfmt.h
@@ -1274,6 +1274,7 @@ class U_I18N_API SimpleDateFormat: public DateFormat {
int32_t count,
UDisplayContext capitalizationContext,
int32_t fieldNum,
+ char16_t fieldToOutput,
FieldPositionHandler& handler,
Calendar& cal,
UErrorCode& status) const; // in case of illegal argument
diff --git a/deps/icu-small/source/i18n/unicode/udat.h b/deps/icu-small/source/i18n/unicode/udat.h
index bdbd080c005821..cf7a165e70ab4f 100644
--- a/deps/icu-small/source/i18n/unicode/udat.h
+++ b/deps/icu-small/source/i18n/unicode/udat.h
@@ -958,7 +958,37 @@ udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute att
U_CAPI void U_EXPORT2
udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status);
+#ifndef U_HIDE_DRAFT_API
+/**
+ * Hour Cycle.
+ * @draft ICU 67
+ */
+typedef enum UDateFormatHourCycle {
+ /**
+ * Hour in am/pm (0~11)
+ * @draft ICU 67
+ */
+ UDAT_HOUR_CYCLE_11,
+
+ /**
+ * Hour in am/pm (1~12)
+ * @draft ICU 67
+ */
+ UDAT_HOUR_CYCLE_12,
+
+ /**
+ * Hour in day (0~23)
+ * @draft ICU 67
+ */
+ UDAT_HOUR_CYCLE_23,
+ /**
+ * Hour in day (1~24)
+ * @draft ICU 67
+ */
+ UDAT_HOUR_CYCLE_24
+} UDateFormatHourCycle;
+#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
diff --git a/deps/icu-small/source/i18n/unicode/udateintervalformat.h b/deps/icu-small/source/i18n/unicode/udateintervalformat.h
index 112f81b31e976b..6235ab710622ce 100644
--- a/deps/icu-small/source/i18n/unicode/udateintervalformat.h
+++ b/deps/icu-small/source/i18n/unicode/udateintervalformat.h
@@ -14,6 +14,7 @@
#if !UCONFIG_NO_FORMATTING
+#include "unicode/ucal.h"
#include "unicode/umisc.h"
#include "unicode/localpointer.h"
#include "unicode/uformattedvalue.h"
@@ -82,14 +83,12 @@
struct UDateIntervalFormat;
typedef struct UDateIntervalFormat UDateIntervalFormat; /**< C typedef for struct UDateIntervalFormat. @stable ICU 4.8 */
-#ifndef U_HIDE_DRAFT_API
struct UFormattedDateInterval;
/**
* Opaque struct to contain the results of a UDateIntervalFormat operation.
- * @draft ICU 64
+ * @stable ICU 64
*/
typedef struct UFormattedDateInterval UFormattedDateInterval;
-#endif /* U_HIDE_DRAFT_API */
/**
* Open a new UDateIntervalFormat object using the predefined rules for a
@@ -132,8 +131,6 @@ udtitvfmt_open(const char* locale,
U_STABLE void U_EXPORT2
udtitvfmt_close(UDateIntervalFormat *formatter);
-
-#ifndef U_HIDE_DRAFT_API
/**
* Creates an object to hold the result of a UDateIntervalFormat
* operation. The object can be used repeatedly; it is cleared whenever
@@ -141,7 +138,7 @@ udtitvfmt_close(UDateIntervalFormat *formatter);
*
* @param ec Set if an error occurs.
* @return A pointer needing ownership.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI UFormattedDateInterval* U_EXPORT2
udtitvfmt_openResult(UErrorCode* ec);
@@ -166,7 +163,7 @@ udtitvfmt_openResult(UErrorCode* ec);
* @param uresult The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI const UFormattedValue* U_EXPORT2
udtitvfmt_resultAsValue(const UFormattedDateInterval* uresult, UErrorCode* ec);
@@ -175,11 +172,10 @@ udtitvfmt_resultAsValue(const UFormattedDateInterval* uresult, UErrorCode* ec);
* Releases the UFormattedDateInterval created by udtitvfmt_openResult().
*
* @param uresult The object to release.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI void U_EXPORT2
udtitvfmt_closeResult(UFormattedDateInterval* uresult);
-#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
@@ -197,7 +193,6 @@ U_NAMESPACE_BEGIN
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateIntervalFormatPointer, UDateIntervalFormat, udtitvfmt_close);
-#ifndef U_HIDE_DRAFT_API
/**
* \class LocalUFormattedDateIntervalPointer
* "Smart pointer" class, closes a UFormattedDateInterval via udtitvfmt_close().
@@ -205,10 +200,9 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateIntervalFormatPointer, UDateIntervalFormat
*
* @see LocalPointerBase
* @see LocalPointer
- * @draft ICU 64
+ * @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedDateIntervalPointer, UFormattedDateInterval, udtitvfmt_closeResult);
-#endif /* U_HIDE_DRAFT_API */
U_NAMESPACE_END
@@ -260,23 +254,48 @@ udtitvfmt_format(const UDateIntervalFormat* formatter,
* UDateIntervalFormat object.
* @param formatter
* The UDateIntervalFormat object specifying the format conventions.
- * @param result
- * The UFormattedDateInterval to contain the result of the
- * formatting operation.
* @param fromDate
* The starting point of the range.
* @param toDate
* The ending point of the range.
+ * @param result
+ * The UFormattedDateInterval to contain the result of the
+ * formatting operation.
* @param status
* A pointer to a UErrorCode to receive any errors.
- * @draft ICU 64
+ * @draft ICU 67
*/
U_DRAFT void U_EXPORT2
udtitvfmt_formatToResult(
const UDateIntervalFormat* formatter,
- UFormattedDateInterval* result,
UDate fromDate,
UDate toDate,
+ UFormattedDateInterval* result,
+ UErrorCode* status);
+
+/**
+ * Formats a date/time range using the conventions established for the
+ * UDateIntervalFormat object.
+ * @param formatter
+ * The UDateIntervalFormat object specifying the format conventions.
+ * @param fromCalendar
+ * The starting point of the range.
+ * @param toCalendar
+ * The ending point of the range.
+ * @param result
+ * The UFormattedDateInterval to contain the result of the
+ * formatting operation.
+ * @param status
+ * A pointer to a UErrorCode to receive any errors.
+ * @draft ICU 67
+ */
+
+U_DRAFT void U_EXPORT2
+udtitvfmt_formatCalendarToResult(
+ const UDateIntervalFormat* formatter,
+ UCalendar* fromCalendar,
+ UCalendar* toCalendar,
+ UFormattedDateInterval* result,
UErrorCode* status);
#endif /* U_HIDE_DRAFT_API */
diff --git a/deps/icu-small/source/i18n/unicode/udatpg.h b/deps/icu-small/source/i18n/unicode/udatpg.h
index 81956d12705d7d..4ec4a2d05116cb 100644
--- a/deps/icu-small/source/i18n/unicode/udatpg.h
+++ b/deps/icu-small/source/i18n/unicode/udatpg.h
@@ -20,6 +20,7 @@
#define __UDATPG_H__
#include "unicode/utypes.h"
+#include "unicode/udat.h"
#include "unicode/uenum.h"
#include "unicode/localpointer.h"
@@ -651,4 +652,26 @@ udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
const UChar *skeleton, int32_t skeletonLength,
int32_t *pLength);
+#if !UCONFIG_NO_FORMATTING
+
+#ifndef U_HIDE_DRAFT_API
+/**
+ * Return the default hour cycle for a locale. Uses the locale that the
+ * UDateTimePatternGenerator was initially created with.
+ *
+ * Cannot be used on an empty UDateTimePatternGenerator instance.
+ *
+ * @param dtpg a pointer to UDateTimePatternGenerator.
+ * @param pErrorCode a pointer to the UErrorCode which must not indicate a
+ * failure before the function call. Set to U_UNSUPPORTED_ERROR
+ * if used on an empty instance.
+ * @return the default hour cycle.
+ * @draft ICU 67
+ */
+U_DRAFT UDateFormatHourCycle U_EXPORT2
+udatpg_getDefaultHourCycle(const UDateTimePatternGenerator *dtpg, UErrorCode* pErrorCode);
+#endif /* U_HIDE_DRAFT_API */
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
#endif
diff --git a/deps/icu-small/source/i18n/unicode/uformattedvalue.h b/deps/icu-small/source/i18n/unicode/uformattedvalue.h
index 172558f7fb716a..71a6592e9dd062 100644
--- a/deps/icu-small/source/i18n/unicode/uformattedvalue.h
+++ b/deps/icu-small/source/i18n/unicode/uformattedvalue.h
@@ -10,8 +10,6 @@
#include "unicode/ufieldpositer.h"
-#ifndef U_HIDE_DRAFT_API
-
/**
* \file
* \brief C API: Abstract operations for localized strings.
@@ -31,41 +29,41 @@
* categories 2^28 and higher or below zero (with the highest bit turned on)
* are private-use and will not be used by ICU in the future.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
typedef enum UFieldCategory {
/**
* For an undefined field category.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UFIELD_CATEGORY_UNDEFINED = 0,
/**
* For fields in UDateFormatField (udat.h), from ICU 3.0.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UFIELD_CATEGORY_DATE,
/**
* For fields in UNumberFormatFields (unum.h), from ICU 49.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UFIELD_CATEGORY_NUMBER,
/**
* For fields in UListFormatterField (ulistformatter.h), from ICU 63.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UFIELD_CATEGORY_LIST,
/**
* For fields in URelativeDateTimeFormatterField (ureldatefmt.h), from ICU 64.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UFIELD_CATEGORY_RELATIVE_DATETIME,
@@ -84,14 +82,14 @@ typedef enum UFieldCategory {
/**
* Category for spans in a list.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UFIELD_CATEGORY_LIST_SPAN = 0x1000 + UFIELD_CATEGORY_LIST,
/**
* Category for spans in a date interval.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UFIELD_CATEGORY_DATE_INTERVAL_SPAN = 0x1000 + UFIELD_CATEGORY_DATE_INTERVAL,
@@ -108,7 +106,7 @@ struct UConstrainedFieldPosition;
* 2. It allows you to set constraints to use when iterating over field positions.
* 3. It is used for the newer FormattedValue APIs.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
typedef struct UConstrainedFieldPosition UConstrainedFieldPosition;
@@ -120,9 +118,9 @@ typedef struct UConstrainedFieldPosition UConstrainedFieldPosition;
*
* @param ec Set if an error occurs.
* @return The new object, or NULL if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT UConstrainedFieldPosition* U_EXPORT2
+U_STABLE UConstrainedFieldPosition* U_EXPORT2
ucfpos_open(UErrorCode* ec);
@@ -133,9 +131,9 @@ ucfpos_open(UErrorCode* ec);
*
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucfpos_reset(
UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@@ -145,9 +143,9 @@ ucfpos_reset(
* Destroys a UConstrainedFieldPosition and releases its memory.
*
* @param ucfpos The instance of UConstrainedFieldPosition.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucfpos_close(UConstrainedFieldPosition* ucfpos);
@@ -174,9 +172,9 @@ ucfpos_close(UConstrainedFieldPosition* ucfpos);
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param category The field category to fix when iterating.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucfpos_constrainCategory(
UConstrainedFieldPosition* ucfpos,
int32_t category,
@@ -207,9 +205,9 @@ ucfpos_constrainCategory(
* @param category The field category to fix when iterating.
* @param field The field to fix when iterating.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucfpos_constrainField(
UConstrainedFieldPosition* ucfpos,
int32_t category,
@@ -227,9 +225,9 @@ ucfpos_constrainField(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
* @return The field category saved in the instance.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ucfpos_getCategory(
const UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@@ -245,9 +243,9 @@ ucfpos_getCategory(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
* @return The field saved in the instance.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ucfpos_getField(
const UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@@ -262,9 +260,9 @@ ucfpos_getField(
* @param pStart Set to the start index saved in the instance. Ignored if nullptr.
* @param pLimit Set to the end index saved in the instance. Ignored if nullptr.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucfpos_getIndexes(
const UConstrainedFieldPosition* ucfpos,
int32_t* pStart,
@@ -282,9 +280,9 @@ ucfpos_getIndexes(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param ec Set if an error occurs.
* @return The current iteration context from ucfpos_setInt64IterationContext.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT int64_t U_EXPORT2
+U_STABLE int64_t U_EXPORT2
ucfpos_getInt64IterationContext(
const UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
@@ -298,9 +296,9 @@ ucfpos_getInt64IterationContext(
* @param ucfpos The instance of UConstrainedFieldPosition.
* @param context The new iteration context.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucfpos_setInt64IterationContext(
UConstrainedFieldPosition* ucfpos,
int64_t context,
@@ -317,9 +315,9 @@ ucfpos_setInt64IterationContext(
* @param category The category to test.
* @param field The field to test.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
ucfpos_matchesField(
const UConstrainedFieldPosition* ucfpos,
int32_t category,
@@ -341,9 +339,9 @@ ucfpos_matchesField(
* @param start The new inclusive start index.
* @param limit The new exclusive end index.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucfpos_setState(
UConstrainedFieldPosition* ucfpos,
int32_t category,
@@ -358,7 +356,7 @@ struct UFormattedValue;
* An abstract formatted value: a string with associated field attributes.
* Many formatters format to types compatible with UFormattedValue.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
typedef struct UFormattedValue UFormattedValue;
@@ -374,9 +372,9 @@ typedef struct UFormattedValue UFormattedValue;
* @param pLength Output variable for the length of the string. Ignored if NULL.
* @param ec Set if an error occurs.
* @return A NUL-terminated char16 string owned by the UFormattedValue.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT const UChar* U_EXPORT2
+U_STABLE const UChar* U_EXPORT2
ufmtval_getString(
const UFormattedValue* ufmtval,
int32_t* pLength,
@@ -404,9 +402,9 @@ ufmtval_getString(
* and ucfpos_constrainField.
* @param ec Set if an error occurs.
* @return TRUE if another position was found; FALSE otherwise.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
ufmtval_nextPosition(
const UFormattedValue* ufmtval,
UConstrainedFieldPosition* ucfpos,
@@ -426,7 +424,7 @@ U_NAMESPACE_BEGIN
* LocalUConstrainedFieldPositionPointer ucfpos(ucfpos_open(ec));
* // no need to explicitly call ucfpos_close()
*
- * @draft ICU 64
+ * @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUConstrainedFieldPositionPointer,
UConstrainedFieldPosition,
@@ -436,6 +434,5 @@ U_NAMESPACE_END
#endif // U_SHOW_CPLUSPLUS_API
-#endif /* U_HIDE_DRAFT_API */
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // __UFORMATTEDVALUE_H__
diff --git a/deps/icu-small/source/i18n/unicode/ulistformatter.h b/deps/icu-small/source/i18n/unicode/ulistformatter.h
index 0fbf72c9ff6abb..66cf50190bb0eb 100644
--- a/deps/icu-small/source/i18n/unicode/ulistformatter.h
+++ b/deps/icu-small/source/i18n/unicode/ulistformatter.h
@@ -34,37 +34,92 @@
struct UListFormatter;
typedef struct UListFormatter UListFormatter; /**< C typedef for struct UListFormatter. @stable ICU 55 */
-#ifndef U_HIDE_DRAFT_API
struct UFormattedList;
/**
* Opaque struct to contain the results of a UListFormatter operation.
- * @draft ICU 64
+ * @stable ICU 64
*/
typedef struct UFormattedList UFormattedList;
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* FieldPosition and UFieldPosition selectors for format fields
* defined by ListFormatter.
- * @draft ICU 63
+ * @stable ICU 63
*/
typedef enum UListFormatterField {
/**
* The literal text in the result which came from the resources.
- * @draft ICU 63
+ * @stable ICU 63
*/
ULISTFMT_LITERAL_FIELD,
/**
* The element text in the result which came from the input strings.
- * @draft ICU 63
+ * @stable ICU 63
*/
ULISTFMT_ELEMENT_FIELD
} UListFormatterField;
+
+#ifndef U_HIDE_DRAFT_API
+/**
+ * Type of meaning expressed by the list.
+ *
+ * @draft ICU 67
+ */
+typedef enum UListFormatterType {
+ /**
+ * Conjunction formatting, e.g. "Alice, Bob, Charlie, and Delta".
+ *
+ * @draft ICU 67
+ */
+ ULISTFMT_TYPE_AND,
+
+ /**
+ * Disjunction (or alternative, or simply one of) formatting, e.g.
+ * "Alice, Bob, Charlie, or Delta".
+ *
+ * @draft ICU 67
+ */
+ ULISTFMT_TYPE_OR,
+
+ /**
+ * Formatting of a list of values with units, e.g. "5 pounds, 12 ounces".
+ *
+ * @draft ICU 67
+ */
+ ULISTFMT_TYPE_UNITS
+} UListFormatterType;
+
+/**
+ * Verbosity level of the list patterns.
+ *
+ * @draft ICU 67
+ */
+typedef enum UListFormatterWidth {
+ /**
+ * Use list formatting with full words (no abbreviations) when possible.
+ *
+ * @draft ICU 67
+ */
+ ULISTFMT_WIDTH_WIDE,
+
+ /**
+ * Use list formatting of typical length.
+ * @draft ICU 67
+ */
+ ULISTFMT_WIDTH_SHORT,
+
+ /**
+ * Use list formatting of the shortest possible length.
+ * @draft ICU 67
+ */
+ ULISTFMT_WIDTH_NARROW,
+} UListFormatterWidth;
#endif /* U_HIDE_DRAFT_API */
/**
* Open a new UListFormatter object using the rules for a given locale.
+ * The object will be initialized with AND type and WIDE width.
+ *
* @param locale
* The locale whose rules should be used; may be NULL for
* default locale.
@@ -83,6 +138,34 @@ U_CAPI UListFormatter* U_EXPORT2
ulistfmt_open(const char* locale,
UErrorCode* status);
+#ifndef U_HIDE_DRAFT_API
+/**
+ * Open a new UListFormatter object appropriate for the given locale, list type,
+ * and style.
+ *
+ * @param locale
+ * The locale whose rules should be used; may be NULL for
+ * default locale.
+ * @param type
+ * The type of list formatting to use.
+ * @param width
+ * The width of formatting to use.
+ * @param status
+ * A pointer to a standard ICU UErrorCode (input/output parameter).
+ * Its input value must pass the U_SUCCESS() test, or else the
+ * function returns immediately. The caller should check its output
+ * value with U_FAILURE(), or use with function chaining (see User
+ * Guide for details).
+ * @return
+ * A pointer to a UListFormatter object for the specified locale,
+ * or NULL if an error occurred.
+ * @draft ICU 67
+ */
+U_DRAFT UListFormatter* U_EXPORT2
+ulistfmt_openForType(const char* locale, UListFormatterType type,
+ UListFormatterWidth width, UErrorCode* status);
+#endif /* U_HIDE_DRAFT_API */
+
/**
* Close a UListFormatter object. Once closed it may no longer be used.
* @param listfmt
@@ -92,7 +175,6 @@ ulistfmt_open(const char* locale,
U_CAPI void U_EXPORT2
ulistfmt_close(UListFormatter *listfmt);
-#ifndef U_HIDE_DRAFT_API
/**
* Creates an object to hold the result of a UListFormatter
* operation. The object can be used repeatedly; it is cleared whenever
@@ -100,7 +182,7 @@ ulistfmt_close(UListFormatter *listfmt);
*
* @param ec Set if an error occurs.
* @return A pointer needing ownership.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI UFormattedList* U_EXPORT2
ulistfmt_openResult(UErrorCode* ec);
@@ -124,7 +206,7 @@ ulistfmt_openResult(UErrorCode* ec);
* @param uresult The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI const UFormattedValue* U_EXPORT2
ulistfmt_resultAsValue(const UFormattedList* uresult, UErrorCode* ec);
@@ -133,11 +215,10 @@ ulistfmt_resultAsValue(const UFormattedList* uresult, UErrorCode* ec);
* Releases the UFormattedList created by ulistfmt_openResult().
*
* @param uresult The object to release.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI void U_EXPORT2
ulistfmt_closeResult(UFormattedList* uresult);
-#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
@@ -155,7 +236,6 @@ U_NAMESPACE_BEGIN
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUListFormatterPointer, UListFormatter, ulistfmt_close);
-#ifndef U_HIDE_DRAFT_API
/**
* \class LocalUFormattedListPointer
* "Smart pointer" class, closes a UFormattedList via ulistfmt_closeResult().
@@ -163,10 +243,9 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalUListFormatterPointer, UListFormatter, ulistfmt
*
* @see LocalPointerBase
* @see LocalPointer
- * @draft ICU 64
+ * @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedListPointer, UFormattedList, ulistfmt_closeResult);
-#endif /* U_HIDE_DRAFT_API */
U_NAMESPACE_END
@@ -215,7 +294,6 @@ ulistfmt_format(const UListFormatter* listfmt,
int32_t resultCapacity,
UErrorCode* status);
-#ifndef U_HIDE_DRAFT_API
/**
* Formats a list of strings to a UFormattedList, which exposes more
* information than the string exported by ulistfmt_format().
@@ -240,7 +318,7 @@ ulistfmt_format(const UListFormatter* listfmt,
* operation. See ulistfmt_openResult().
* @param status
* Error code set if an error occurred during formatting.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI void U_EXPORT2
ulistfmt_formatStringsToResult(
@@ -250,7 +328,6 @@ ulistfmt_formatStringsToResult(
int32_t stringCount,
UFormattedList* uresult,
UErrorCode* status);
-#endif /* U_HIDE_DRAFT_API */
#endif /* #if !UCONFIG_NO_FORMATTING */
diff --git a/deps/icu-small/source/i18n/unicode/unum.h b/deps/icu-small/source/i18n/unicode/unum.h
index 77cde03533f4d1..b5f21ea5859071 100644
--- a/deps/icu-small/source/i18n/unicode/unum.h
+++ b/deps/icu-small/source/i18n/unicode/unum.h
@@ -377,12 +377,10 @@ typedef enum UNumberFormatFields {
UNUM_PERMILL_FIELD,
/** @stable ICU 49 */
UNUM_SIGN_FIELD,
-#ifndef U_HIDE_DRAFT_API
- /** @draft ICU 64 */
+ /** @stable ICU 64 */
UNUM_MEASURE_UNIT_FIELD,
- /** @draft ICU 64 */
+ /** @stable ICU 64 */
UNUM_COMPACT_FIELD,
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_DEPRECATED_API
/**
@@ -1032,17 +1030,15 @@ typedef enum UNumberFormatAttribute {
* @stable ICU 51 */
UNUM_SCALE = 21,
-#ifndef U_HIDE_DRAFT_API
/**
* Minimum grouping digits; most commonly set to 2 to print "1000" instead of "1,000".
* See DecimalFormat::getMinimumGroupingDigits().
*
* For better control over grouping strategies, use UNumberFormatter.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UNUM_MINIMUM_GROUPING_DIGITS = 22,
-#endif /* U_HIDE_DRAFT_API */
/**
* if this attribute is set to 0, it is set to UNUM_CURRENCY_STANDARD purpose,
@@ -1083,12 +1079,10 @@ typedef enum UNumberFormatAttribute {
*/
UNUM_PARSE_DECIMAL_MARK_REQUIRED = 0x1002,
-#ifndef U_HIDE_DRAFT_API
-
/**
* Parsing: if set to 1, parsing is sensitive to case (lowercase/uppercase).
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UNUM_PARSE_CASE_SENSITIVE = 0x1003,
@@ -1097,12 +1091,10 @@ typedef enum UNumberFormatAttribute {
*
* For better control over sign display, use UNumberFormatter.
*
- * @draft ICU 64
+ * @stable ICU 64
*/
UNUM_SIGN_ALWAYS_SHOWN = 0x1004,
-#endif /* U_HIDE_DRAFT_API */
-
#ifndef U_HIDE_INTERNAL_API
/** Limit of boolean attributes. (value should
* not depend on U_HIDE conditionals)
diff --git a/deps/icu-small/source/i18n/unicode/unumberformatter.h b/deps/icu-small/source/i18n/unicode/unumberformatter.h
index b27507f7a8f561..af98ba0027238a 100644
--- a/deps/icu-small/source/i18n/unicode/unumberformatter.h
+++ b/deps/icu-small/source/i18n/unicode/unumberformatter.h
@@ -336,7 +336,7 @@ typedef enum UNumberSignDisplay {
/**
* Show the minus sign on negative numbers and the plus sign on positive numbers. Do not show a
- * sign on zero or NaN, unless the sign bit is set (-0.0 gets a sign).
+ * sign on zero, numbers that round to zero, or NaN.
*
* @stable ICU 61
*/
@@ -344,9 +344,8 @@ typedef enum UNumberSignDisplay {
/**
* Use the locale-dependent accounting format on negative numbers, and show the plus sign on
- * positive numbers. Do not show a sign on zero or NaN, unless the sign bit is set (-0.0 gets a
- * sign). For more information on the accounting format, see the ACCOUNTING sign display
- * strategy.
+ * positive numbers. Do not show a sign on zero, numbers that round to zero, or NaN. For more
+ * information on the accounting format, see the ACCOUNTING sign display strategy.
*
* @stable ICU 61
*/
@@ -428,7 +427,7 @@ typedef struct UFormattedNumber UFormattedNumber;
* NOTE: This is a C-compatible API; C++ users should build against numberformatter.h instead.
*
* @param skeleton The skeleton string, like u"percent precision-integer"
- * @param skeletonLen The number of UChars in the skeleton string, or -1 it it is NUL-terminated.
+ * @param skeletonLen The number of UChars in the skeleton string, or -1 if it is NUL-terminated.
* @param locale The NUL-terminated locale ID.
* @param ec Set if an error occurs.
* @stable ICU 62
@@ -438,23 +437,21 @@ unumf_openForSkeletonAndLocale(const UChar* skeleton, int32_t skeletonLen, const
UErrorCode* ec);
-#ifndef U_HIDE_DRAFT_API
/**
* Like unumf_openForSkeletonAndLocale, but accepts a UParseError, which will be populated with the
* location of a skeleton syntax error if such a syntax error exists.
*
* @param skeleton The skeleton string, like u"percent precision-integer"
- * @param skeletonLen The number of UChars in the skeleton string, or -1 it it is NUL-terminated.
+ * @param skeletonLen The number of UChars in the skeleton string, or -1 if it is NUL-terminated.
* @param locale The NUL-terminated locale ID.
* @param perror A parse error struct populated if an error occurs when parsing. Can be NULL.
* If no error occurs, perror->offset will be set to -1.
* @param ec Set if an error occurs.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT UNumberFormatter* U_EXPORT2
+U_STABLE UNumberFormatter* U_EXPORT2
unumf_openForSkeletonAndLocaleWithError(
const UChar* skeleton, int32_t skeletonLen, const char* locale, UParseError* perror, UErrorCode* ec);
-#endif // U_HIDE_DRAFT_API
/**
@@ -532,7 +529,6 @@ U_STABLE void U_EXPORT2
unumf_formatDecimal(const UNumberFormatter* uformatter, const char* value, int32_t valueLen,
UFormattedNumber* uresult, UErrorCode* ec);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns a representation of a UFormattedNumber as a UFormattedValue,
* which can be subsequently passed to any API requiring that type.
@@ -545,11 +541,10 @@ unumf_formatDecimal(const UNumberFormatter* uformatter, const char* value, int32
* @param uresult The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT const UFormattedValue* U_EXPORT2
+U_STABLE const UFormattedValue* U_EXPORT2
unumf_resultAsValue(const UFormattedNumber* uresult, UErrorCode* ec);
-#endif /* U_HIDE_DRAFT_API */
/**
diff --git a/deps/icu-small/source/i18n/unicode/upluralrules.h b/deps/icu-small/source/i18n/unicode/upluralrules.h
index fc1b2fb57173b8..9c09dfab8bb9f6 100644
--- a/deps/icu-small/source/i18n/unicode/upluralrules.h
+++ b/deps/icu-small/source/i18n/unicode/upluralrules.h
@@ -152,7 +152,6 @@ uplrules_select(const UPluralRules *uplrules,
UChar *keyword, int32_t capacity,
UErrorCode *status);
-#ifndef U_HIDE_DRAFT_API
/**
* Given a formatted number, returns the keyword of the first rule
* that applies to the number, according to the supplied UPluralRules object.
@@ -168,14 +167,13 @@ uplrules_select(const UPluralRules *uplrules,
* @param capacity The capacity of the keyword buffer.
* @param status A pointer to a UErrorCode to receive any errors.
* @return The length of the keyword.
- * @draft ICU 64
+ * @stable ICU 64
*/
U_CAPI int32_t U_EXPORT2
uplrules_selectFormatted(const UPluralRules *uplrules,
const struct UFormattedNumber* number,
UChar *keyword, int32_t capacity,
UErrorCode *status);
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API
/**
diff --git a/deps/icu-small/source/i18n/unicode/ureldatefmt.h b/deps/icu-small/source/i18n/unicode/ureldatefmt.h
index 1aa554dc7c0d7a..d12f0988a88ed1 100644
--- a/deps/icu-small/source/i18n/unicode/ureldatefmt.h
+++ b/deps/icu-small/source/i18n/unicode/ureldatefmt.h
@@ -175,25 +175,23 @@ typedef enum URelativeDateTimeUnit {
#endif /* U_HIDE_DEPRECATED_API */
} URelativeDateTimeUnit;
-#ifndef U_HIDE_DRAFT_API
/**
* FieldPosition and UFieldPosition selectors for format fields
* defined by RelativeDateTimeFormatter.
- * @draft ICU 64
+ * @stable ICU 64
*/
typedef enum URelativeDateTimeFormatterField {
/**
* Represents a literal text string, like "tomorrow" or "days ago".
- * @draft ICU 64
+ * @stable ICU 64
*/
UDAT_REL_LITERAL_FIELD,
/**
* Represents a number quantity, like "3" in "3 days ago".
- * @draft ICU 64
+ * @stable ICU 64
*/
UDAT_REL_NUMERIC_FIELD,
} URelativeDateTimeFormatterField;
-#endif // U_HIDE_DRAFT_API
/**
@@ -252,11 +250,10 @@ ureldatefmt_open( const char* locale,
U_STABLE void U_EXPORT2
ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt);
-#ifndef U_HIDE_DRAFT_API
struct UFormattedRelativeDateTime;
/**
* Opaque struct to contain the results of a URelativeDateTimeFormatter operation.
- * @draft ICU 64
+ * @stable ICU 64
*/
typedef struct UFormattedRelativeDateTime UFormattedRelativeDateTime;
@@ -267,9 +264,9 @@ typedef struct UFormattedRelativeDateTime UFormattedRelativeDateTime;
*
* @param ec Set if an error occurs.
* @return A pointer needing ownership.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT UFormattedRelativeDateTime* U_EXPORT2
+U_STABLE UFormattedRelativeDateTime* U_EXPORT2
ureldatefmt_openResult(UErrorCode* ec);
/**
@@ -284,20 +281,19 @@ ureldatefmt_openResult(UErrorCode* ec);
* @param ufrdt The object containing the formatted string.
* @param ec Set if an error occurs.
* @return A UFormattedValue owned by the input object.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT const UFormattedValue* U_EXPORT2
+U_STABLE const UFormattedValue* U_EXPORT2
ureldatefmt_resultAsValue(const UFormattedRelativeDateTime* ufrdt, UErrorCode* ec);
/**
* Releases the UFormattedRelativeDateTime created by ureldatefmt_openResult.
*
* @param ufrdt The object to release.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ureldatefmt_closeResult(UFormattedRelativeDateTime* ufrdt);
-#endif /* U_HIDE_DRAFT_API */
#if U_SHOW_CPLUSPLUS_API
@@ -315,7 +311,6 @@ U_NAMESPACE_BEGIN
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close);
-#ifndef U_HIDE_DRAFT_API
/**
* \class LocalUFormattedRelativeDateTimePointer
* "Smart pointer" class, closes a UFormattedRelativeDateTime via ureldatefmt_closeResult().
@@ -323,10 +318,9 @@ U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDat
*
* @see LocalPointerBase
* @see LocalPointer
- * @draft ICU 64
+ * @stable ICU 64
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedRelativeDateTimePointer, UFormattedRelativeDateTime, ureldatefmt_closeResult);
-#endif /* U_HIDE_DRAFT_API */
U_NAMESPACE_END
@@ -368,7 +362,6 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
int32_t resultCapacity,
UErrorCode* status);
-#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",
@@ -390,16 +383,15 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
* A pointer to a UErrorCode to receive any errors. In
* case of error status, the contents of result are
* undefined.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ureldatefmt_formatNumericToResult(
const URelativeDateTimeFormatter* reldatefmt,
double offset,
URelativeDateTimeUnit unit,
UFormattedRelativeDateTime* result,
UErrorCode* status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
@@ -437,7 +429,6 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
int32_t resultCapacity,
UErrorCode* status);
-#ifndef U_HIDE_DRAFT_API
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
* using a text style if possible, e.g. "last week", "this week",
@@ -462,16 +453,15 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
* A pointer to a UErrorCode to receive any errors. In
* case of error status, the contents of result are
* undefined.
- * @draft ICU 64
+ * @stable ICU 64
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ureldatefmt_formatToResult(
const URelativeDateTimeFormatter* reldatefmt,
double offset,
URelativeDateTimeUnit unit,
UFormattedRelativeDateTime* result,
UErrorCode* status);
-#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/vtzone.cpp b/deps/icu-small/source/i18n/vtzone.cpp
index bda3d1115e3d13..aa2e1763966710 100644
--- a/deps/icu-small/source/i18n/vtzone.cpp
+++ b/deps/icu-small/source/i18n/vtzone.cpp
@@ -526,15 +526,15 @@ static void parseRRULE(const UnicodeString& rrule, int32_t& month, int32_t& dow,
static TimeZoneRule* createRuleByRRULE(const UnicodeString& zonename, int rawOffset, int dstSavings, UDate start,
UVector* dates, int fromOffset, UErrorCode& status) {
if (U_FAILURE(status)) {
- return NULL;
+ return nullptr;
}
- if (dates == NULL || dates->size() == 0) {
+ if (dates == nullptr || dates->size() == 0) {
status = U_ILLEGAL_ARGUMENT_ERROR;
- return NULL;
+ return nullptr;
}
int32_t i, j;
- DateTimeRule *adtr = NULL;
+ DateTimeRule *adtr = nullptr;
// Parse the first rule
UnicodeString rrule = *((UnicodeString*)dates->elementAt(0));
@@ -545,7 +545,7 @@ static TimeZoneRule* createRuleByRRULE(const UnicodeString& zonename, int rawOff
parseRRULE(rrule, month, dayOfWeek, nthDayOfWeek, days, daysCount, until, status);
if (U_FAILURE(status)) {
- return NULL;
+ return nullptr;
}
if (dates->size() == 1) {
@@ -620,7 +620,7 @@ static TimeZoneRule* createRuleByRRULE(const UnicodeString& zonename, int rawOff
int32_t tmp_daysCount = UPRV_LENGTHOF(tmp_days);
parseRRULE(rrule, tmp_month, tmp_dayOfWeek, tmp_nthDayOfWeek, tmp_days, tmp_daysCount, tmp_until, status);
if (U_FAILURE(status)) {
- return NULL;
+ return nullptr;
}
// If UNTIL is newer than previous one, use the one
if (tmp_until > until) {
@@ -713,14 +713,14 @@ static TimeZoneRule* createRuleByRRULE(const UnicodeString& zonename, int rawOff
// first Sunday after 15th day in the month
adtr = new DateTimeRule(month, dayOfMonth, dayOfWeek, TRUE, startMID, DateTimeRule::WALL_TIME);
}
- if (adtr == NULL) {
+ if (adtr == nullptr) {
goto unsupportedRRule;
}
return new AnnualTimeZoneRule(zonename, rawOffset, dstSavings, adtr, startYear, endYear);
unsupportedRRule:
status = U_INVALID_STATE_ERROR;
- return NULL;
+ return nullptr;
}
/*
@@ -729,34 +729,35 @@ static TimeZoneRule* createRuleByRRULE(const UnicodeString& zonename, int rawOff
static TimeZoneRule* createRuleByRDATE(const UnicodeString& zonename, int32_t rawOffset, int32_t dstSavings,
UDate start, UVector* dates, int32_t fromOffset, UErrorCode& status) {
if (U_FAILURE(status)) {
- return NULL;
+ return nullptr;
}
- TimeArrayTimeZoneRule *retVal = NULL;
- if (dates == NULL || dates->size() == 0) {
+ TimeArrayTimeZoneRule *retVal = nullptr;
+ if (dates == nullptr || dates->size() == 0) {
// When no RDATE line is provided, use start (DTSTART)
// as the transition time
- retVal = new TimeArrayTimeZoneRule(zonename, rawOffset, dstSavings,
- &start, 1, DateTimeRule::UTC_TIME);
+ retVal = new TimeArrayTimeZoneRule(zonename, rawOffset, dstSavings, &start, 1, DateTimeRule::UTC_TIME);
} else {
// Create an array of transition times
int32_t size = dates->size();
UDate* times = (UDate*)uprv_malloc(sizeof(UDate) * size);
- if (times == NULL) {
+ if (times == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
- return NULL;
+ return nullptr;
}
for (int32_t i = 0; i < size; i++) {
UnicodeString *datestr = (UnicodeString*)dates->elementAt(i);
times[i] = parseDateTimeString(*datestr, fromOffset, status);
if (U_FAILURE(status)) {
uprv_free(times);
- return NULL;
+ return nullptr;
}
}
- retVal = new TimeArrayTimeZoneRule(zonename, rawOffset, dstSavings,
- times, size, DateTimeRule::UTC_TIME);
+ retVal = new TimeArrayTimeZoneRule(zonename, rawOffset, dstSavings, times, size, DateTimeRule::UTC_TIME);
uprv_free(times);
}
+ if (retVal == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ }
return retVal;
}
@@ -800,12 +801,15 @@ static UBool isEquivalentDateRule(int32_t month, int32_t weekInMonth, int32_t da
/*
* Convert the rule to its equivalent rule using WALL_TIME mode.
- * This function returns NULL when the specified DateTimeRule is already
+ * This function returns nullptr when the specified DateTimeRule is already
* using WALL_TIME mode.
*/
-static DateTimeRule* toWallTimeRule(const DateTimeRule* rule, int32_t rawOffset, int32_t dstSavings) {
+static DateTimeRule *toWallTimeRule(const DateTimeRule *rule, int32_t rawOffset, int32_t dstSavings, UErrorCode &status) {
+ if (U_FAILURE(status)) {
+ return nullptr;
+ }
if (rule->getTimeRuleType() == DateTimeRule::WALL_TIME) {
- return NULL;
+ return nullptr;
}
int32_t wallt = rule->getRuleMillisInDay();
if (rule->getTimeRuleType() == DateTimeRule::UTC_TIME) {
@@ -864,12 +868,14 @@ static DateTimeRule* toWallTimeRule(const DateTimeRule* rule, int32_t rawOffset,
}
}
// Create a new rule
- DateTimeRule *modifiedRule;
+ DateTimeRule *modifiedRule = nullptr;
if (dtype == DateTimeRule::DOM) {
modifiedRule = new DateTimeRule(month, dom, wallt, DateTimeRule::WALL_TIME);
} else {
- modifiedRule = new DateTimeRule(month, dom, dow,
- (dtype == DateTimeRule::DOW_GEQ_DOM), wallt, DateTimeRule::WALL_TIME);
+ modifiedRule = new DateTimeRule(month, dom, dow, (dtype == DateTimeRule::DOW_GEQ_DOM), wallt, DateTimeRule::WALL_TIME);
+ }
+ if (modifiedRule == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
}
return modifiedRule;
}
@@ -956,21 +962,24 @@ VTZReader::read(void) {
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(VTimeZone)
VTimeZone::VTimeZone()
-: BasicTimeZone(), tz(NULL), vtzlines(NULL),
+: BasicTimeZone(), tz(nullptr), vtzlines(nullptr),
lastmod(MAX_MILLIS) {
}
VTimeZone::VTimeZone(const VTimeZone& source)
-: BasicTimeZone(source), tz(NULL), vtzlines(NULL),
+: BasicTimeZone(source), tz(nullptr), vtzlines(nullptr),
tzurl(source.tzurl), lastmod(source.lastmod),
olsonzid(source.olsonzid), icutzver(source.icutzver) {
- if (source.tz != NULL) {
+ if (source.tz != nullptr) {
tz = source.tz->clone();
}
- if (source.vtzlines != NULL) {
+ if (source.vtzlines != nullptr) {
UErrorCode status = U_ZERO_ERROR;
int32_t size = source.vtzlines->size();
vtzlines = new UVector(uprv_deleteUObject, uhash_compareUnicodeString, size, status);
+ if (vtzlines == nullptr) {
+ return;
+ }
if (U_SUCCESS(status)) {
for (int32_t i = 0; i < size; i++) {
UnicodeString *line = (UnicodeString*)source.vtzlines->elementAt(i);
@@ -980,17 +989,17 @@ VTimeZone::VTimeZone(const VTimeZone& source)
}
}
}
- if (U_FAILURE(status) && vtzlines != NULL) {
+ if (U_FAILURE(status) && vtzlines != nullptr) {
delete vtzlines;
}
}
}
VTimeZone::~VTimeZone() {
- if (tz != NULL) {
+ if (tz != nullptr) {
delete tz;
}
- if (vtzlines != NULL) {
+ if (vtzlines != nullptr) {
delete vtzlines;
}
}
@@ -1002,21 +1011,21 @@ VTimeZone::operator=(const VTimeZone& right) {
}
if (*this != right) {
BasicTimeZone::operator=(right);
- if (tz != NULL) {
+ if (tz != nullptr) {
delete tz;
- tz = NULL;
+ tz = nullptr;
}
- if (right.tz != NULL) {
+ if (right.tz != nullptr) {
tz = right.tz->clone();
}
- if (vtzlines != NULL) {
+ if (vtzlines != nullptr) {
delete vtzlines;
}
- if (right.vtzlines != NULL) {
+ if (right.vtzlines != nullptr) {
UErrorCode status = U_ZERO_ERROR;
int32_t size = right.vtzlines->size();
vtzlines = new UVector(uprv_deleteUObject, uhash_compareUnicodeString, size, status);
- if (U_SUCCESS(status)) {
+ if (vtzlines != nullptr && U_SUCCESS(status)) {
for (int32_t i = 0; i < size; i++) {
UnicodeString *line = (UnicodeString*)right.vtzlines->elementAt(i);
vtzlines->addElement(line->clone(), status);
@@ -1025,9 +1034,9 @@ VTimeZone::operator=(const VTimeZone& right) {
}
}
}
- if (U_FAILURE(status) && vtzlines != NULL) {
+ if (U_FAILURE(status) && vtzlines != nullptr) {
delete vtzlines;
- vtzlines = NULL;
+ vtzlines = nullptr;
}
}
tzurl = right.tzurl;
@@ -1065,15 +1074,18 @@ VTimeZone::operator!=(const TimeZone& that) const {
VTimeZone*
VTimeZone::createVTimeZoneByID(const UnicodeString& ID) {
VTimeZone *vtz = new VTimeZone();
+ if (vtz == nullptr) {
+ return nullptr;
+ }
vtz->tz = (BasicTimeZone*)TimeZone::createTimeZone(ID);
vtz->tz->getID(vtz->olsonzid);
// Set ICU tzdata version
UErrorCode status = U_ZERO_ERROR;
- UResourceBundle *bundle = NULL;
- const UChar* versionStr = NULL;
+ UResourceBundle *bundle = nullptr;
+ const UChar* versionStr = nullptr;
int32_t len = 0;
- bundle = ures_openDirect(NULL, "zoneinfo64", &status);
+ bundle = ures_openDirect(nullptr, "zoneinfo64", &status);
versionStr = ures_getStringByKey(bundle, "TZVersion", &len, &status);
if (U_SUCCESS(status)) {
vtz->icutzver.setTo(versionStr, len);
@@ -1085,26 +1097,26 @@ VTimeZone::createVTimeZoneByID(const UnicodeString& ID) {
VTimeZone*
VTimeZone::createVTimeZoneFromBasicTimeZone(const BasicTimeZone& basic_time_zone, UErrorCode &status) {
if (U_FAILURE(status)) {
- return NULL;
+ return nullptr;
}
VTimeZone *vtz = new VTimeZone();
- if (vtz == NULL) {
+ if (vtz == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
- return NULL;
+ return nullptr;
}
vtz->tz = basic_time_zone.clone();
- if (vtz->tz == NULL) {
+ if (vtz->tz == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
delete vtz;
- return NULL;
+ return nullptr;
}
vtz->tz->getID(vtz->olsonzid);
// Set ICU tzdata version
- UResourceBundle *bundle = NULL;
- const UChar* versionStr = NULL;
+ UResourceBundle *bundle = nullptr;
+ const UChar* versionStr = nullptr;
int32_t len = 0;
- bundle = ures_openDirect(NULL, "zoneinfo64", &status);
+ bundle = ures_openDirect(nullptr, "zoneinfo64", &status);
versionStr = ures_getStringByKey(bundle, "TZVersion", &len, &status);
if (U_SUCCESS(status)) {
vtz->icutzver.setTo(versionStr, len);
@@ -1116,14 +1128,18 @@ VTimeZone::createVTimeZoneFromBasicTimeZone(const BasicTimeZone& basic_time_zone
VTimeZone*
VTimeZone::createVTimeZone(const UnicodeString& vtzdata, UErrorCode& status) {
if (U_FAILURE(status)) {
- return NULL;
+ return nullptr;
}
VTZReader reader(vtzdata);
VTimeZone *vtz = new VTimeZone();
+ if (vtz == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ return nullptr;
+ }
vtz->load(reader, status);
if (U_FAILURE(status)) {
delete vtz;
- return NULL;
+ return nullptr;
}
return vtz;
}
@@ -1251,6 +1267,9 @@ VTimeZone::getTimeZoneRules(const InitialTimeZoneRule*& initial,
void
VTimeZone::load(VTZReader& reader, UErrorCode& status) {
vtzlines = new UVector(uprv_deleteUObject, uhash_compareUnicodeString, DEFAULT_VTIMEZONE_LINES, status);
+ if (vtzlines == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ }
if (U_FAILURE(status)) {
return;
}
@@ -1264,10 +1283,15 @@ VTimeZone::load(VTZReader& reader, UErrorCode& status) {
if (ch == 0xFFFF) {
// end of file
if (start && line.startsWith(ICAL_END_VTIMEZONE, -1)) {
- vtzlines->addElement(new UnicodeString(line), status);
+ LocalPointer element(new UnicodeString(line), status);
+ if (U_FAILURE(status)) {
+ goto cleanupVtzlines;
+ }
+ vtzlines->addElement(element.getAlias(), status);
if (U_FAILURE(status)) {
goto cleanupVtzlines;
}
+ element.orphan(); // on success, vtzlines owns the object.
success = TRUE;
}
break;
@@ -1281,10 +1305,15 @@ VTimeZone::load(VTZReader& reader, UErrorCode& status) {
// NOT followed by TAB/SP -> new line
if (start) {
if (line.length() > 0) {
- vtzlines->addElement(new UnicodeString(line), status);
+ LocalPointer element(new UnicodeString(line), status);
if (U_FAILURE(status)) {
goto cleanupVtzlines;
}
+ vtzlines->addElement(element.getAlias(), status);
+ if (U_FAILURE(status)) {
+ goto cleanupVtzlines;
+ }
+ element.orphan(); // on success, vtzlines owns the object.
}
}
line.remove();
@@ -1299,19 +1328,29 @@ VTimeZone::load(VTZReader& reader, UErrorCode& status) {
eol = TRUE;
if (start) {
if (line.startsWith(ICAL_END_VTIMEZONE, -1)) {
- vtzlines->addElement(new UnicodeString(line), status);
+ LocalPointer element(new UnicodeString(line), status);
+ if (U_FAILURE(status)) {
+ goto cleanupVtzlines;
+ }
+ vtzlines->addElement(element.getAlias(), status);
if (U_FAILURE(status)) {
goto cleanupVtzlines;
}
+ element.orphan(); // on success, vtzlines owns the object.
success = TRUE;
break;
}
} else {
if (line.startsWith(ICAL_BEGIN_VTIMEZONE, -1)) {
- vtzlines->addElement(new UnicodeString(line), status);
+ LocalPointer element(new UnicodeString(line), status);
if (U_FAILURE(status)) {
goto cleanupVtzlines;
}
+ vtzlines->addElement(element.getAlias(), status);
+ if (U_FAILURE(status)) {
+ goto cleanupVtzlines;
+ }
+ element.orphan(); // on success, vtzlines owns the object.
line.remove();
start = TRUE;
eol = FALSE;
@@ -1333,7 +1372,7 @@ VTimeZone::load(VTZReader& reader, UErrorCode& status) {
cleanupVtzlines:
delete vtzlines;
- vtzlines = NULL;
+ vtzlines = nullptr;
}
// parser state
@@ -1349,12 +1388,12 @@ VTimeZone::parse(UErrorCode& status) {
if (U_FAILURE(status)) {
return;
}
- if (vtzlines == NULL || vtzlines->size() == 0) {
+ if (vtzlines == nullptr || vtzlines->size() == 0) {
status = U_INVALID_STATE_ERROR;
return;
}
- InitialTimeZoneRule *initialRule = NULL;
- RuleBasedTimeZone *rbtz = NULL;
+ InitialTimeZoneRule *initialRule = nullptr;
+ RuleBasedTimeZone *rbtz = nullptr;
// timezone ID
UnicodeString tzid;
@@ -1373,13 +1412,16 @@ VTimeZone::parse(UErrorCode& status) {
UnicodeString name; // RFC2445 prop name
UnicodeString value; // RFC2445 prop value
- UVector *dates = NULL; // list of RDATE or RRULE strings
- UVector *rules = NULL; // list of TimeZoneRule instances
+ UVector *dates = nullptr; // list of RDATE or RRULE strings
+ UVector *rules = nullptr; // list of TimeZoneRule instances
int32_t finalRuleIdx = -1;
int32_t finalRuleCount = 0;
rules = new UVector(status);
+ if (rules == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ }
if (U_FAILURE(status)) {
goto cleanupParse;
}
@@ -1387,11 +1429,10 @@ VTimeZone::parse(UErrorCode& status) {
rules->setDeleter(deleteTimeZoneRule);
dates = new UVector(uprv_deleteUObject, uhash_compareUnicodeString, status);
- if (U_FAILURE(status)) {
- goto cleanupParse;
- }
- if (rules == NULL || dates == NULL) {
+ if (dates == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
+ }
+ if (U_FAILURE(status)) {
goto cleanupParse;
}
@@ -1468,7 +1509,7 @@ VTimeZone::parse(UErrorCode& status) {
// by comma
UBool nextDate = TRUE;
int32_t dstart = 0;
- UnicodeString *dstr;
+ UnicodeString *dstr = nullptr;
while (nextDate) {
int32_t dend = value.indexOf(COMMA, dstart);
if (dend == -1) {
@@ -1477,7 +1518,11 @@ VTimeZone::parse(UErrorCode& status) {
} else {
dstr = new UnicodeString(value, dstart, dend - dstart);
}
- dates->addElement(dstr, status);
+ if (dstr == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ } else {
+ dates->addElement(dstr, status);
+ }
if (U_FAILURE(status)) {
goto cleanupParse;
}
@@ -1489,10 +1534,15 @@ VTimeZone::parse(UErrorCode& status) {
goto cleanupParse;
}
isRRULE = true;
- dates->addElement(new UnicodeString(value), status);
+ LocalPointer element(new UnicodeString(value), status);
+ if (U_FAILURE(status)) {
+ goto cleanupParse;
+ }
+ dates->addElement(element.getAlias(), status);
if (U_FAILURE(status)) {
goto cleanupParse;
}
+ element.orphan(); // on success, dates owns the object.
} else if (name.compare(ICAL_END, -1) == 0) {
// Mandatory properties
if (dtstart.length() == 0 || from.length() == 0 || to.length() == 0) {
@@ -1504,7 +1554,7 @@ VTimeZone::parse(UErrorCode& status) {
}
// create a time zone rule
- TimeZoneRule *rule = NULL;
+ TimeZoneRule *rule = nullptr;
int32_t fromOffset = 0;
int32_t toOffset = 0;
int32_t rawOffset = 0;
@@ -1546,7 +1596,7 @@ VTimeZone::parse(UErrorCode& status) {
} else {
rule = createRuleByRDATE(zonename, rawOffset, dstSavings, start, dates, fromOffset, status);
}
- if (U_FAILURE(status) || rule == NULL) {
+ if (U_FAILURE(status) || rule == nullptr) {
goto cleanupParse;
} else {
UBool startAvail = rule->getFirstStart(fromOffset, 0, actualStart);
@@ -1586,25 +1636,24 @@ VTimeZone::parse(UErrorCode& status) {
// Create a initial rule
getDefaultTZName(tzid, FALSE, zonename);
- initialRule = new InitialTimeZoneRule(zonename,
- initialRawOffset, initialDSTSavings);
- if (initialRule == NULL) {
+ initialRule = new InitialTimeZoneRule(zonename, initialRawOffset, initialDSTSavings);
+ if (initialRule == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
goto cleanupParse;
}
// Finally, create the RuleBasedTimeZone
rbtz = new RuleBasedTimeZone(tzid, initialRule);
- if (rbtz == NULL) {
+ if (rbtz == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
goto cleanupParse;
}
- initialRule = NULL; // already adopted by RBTZ, no need to delete
+ initialRule = nullptr; // already adopted by RBTZ, no need to delete
for (n = 0; n < rules->size(); n++) {
TimeZoneRule *r = (TimeZoneRule*)rules->elementAt(n);
AnnualTimeZoneRule *atzrule = dynamic_cast(r);
- if (atzrule != NULL) {
+ if (atzrule != nullptr) {
if (atzrule->getEndYear() == AnnualTimeZoneRule::MAX_YEAR) {
finalRuleCount++;
finalRuleIdx = n;
@@ -1649,7 +1698,7 @@ VTimeZone::parse(UErrorCode& status) {
}
}
- TimeZoneRule *newRule;
+ TimeZoneRule *newRule = nullptr;
UnicodeString tznam;
if (start == finalStart) {
// Transform this into a single transition
@@ -1672,7 +1721,7 @@ VTimeZone::parse(UErrorCode& status) {
finalRule->getStartYear(),
y);
}
- if (newRule == NULL) {
+ if (newRule == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
goto cleanupParse;
}
@@ -1704,20 +1753,20 @@ VTimeZone::parse(UErrorCode& status) {
return;
cleanupParse:
- if (rules != NULL) {
+ if (rules != nullptr) {
while (!rules->isEmpty()) {
TimeZoneRule *r = (TimeZoneRule*)rules->orphanElementAt(0);
delete r;
}
delete rules;
}
- if (dates != NULL) {
+ if (dates != nullptr) {
delete dates;
}
- if (initialRule != NULL) {
+ if (initialRule != nullptr) {
delete initialRule;
}
- if (rbtz != NULL) {
+ if (rbtz != nullptr) {
delete rbtz;
}
return;
@@ -1725,7 +1774,7 @@ VTimeZone::parse(UErrorCode& status) {
void
VTimeZone::write(VTZWriter& writer, UErrorCode& status) const {
- if (vtzlines != NULL) {
+ if (vtzlines != nullptr) {
for (int32_t i = 0; i < vtzlines->size(); i++) {
UnicodeString *line = (UnicodeString*)vtzlines->elementAt(i);
if (line->startsWith(ICAL_TZURL, -1)
@@ -1765,8 +1814,8 @@ VTimeZone::write(UDate start, VTZWriter& writer, UErrorCode& status) const {
if (U_FAILURE(status)) {
return;
}
- InitialTimeZoneRule *initial = NULL;
- UVector *transitionRules = NULL;
+ InitialTimeZoneRule *initial = nullptr;
+ UVector *transitionRules = nullptr;
UVector customProps(uprv_deleteUObject, uhash_compareUnicodeString, status);
UnicodeString tzid;
@@ -1779,7 +1828,7 @@ VTimeZone::write(UDate start, VTZWriter& writer, UErrorCode& status) const {
// Create a RuleBasedTimeZone with the subset rule
getID(tzid);
RuleBasedTimeZone rbtz(tzid, initial);
- if (transitionRules != NULL) {
+ if (transitionRules != nullptr) {
while (!transitionRules->isEmpty()) {
TimeZoneRule *tr = (TimeZoneRule*)transitionRules->orphanElementAt(0);
rbtz.addTransitionRule(tr, status);
@@ -1788,7 +1837,7 @@ VTimeZone::write(UDate start, VTZWriter& writer, UErrorCode& status) const {
}
}
delete transitionRules;
- transitionRules = NULL;
+ transitionRules = nullptr;
}
rbtz.complete(status);
if (U_FAILURE(status)) {
@@ -1797,6 +1846,10 @@ VTimeZone::write(UDate start, VTZWriter& writer, UErrorCode& status) const {
if (olsonzid.length() > 0 && icutzver.length() > 0) {
UnicodeString *icutzprop = new UnicodeString(ICU_TZINFO_PROP);
+ if (icutzprop == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ goto cleanupWritePartial;
+ }
icutzprop->append(olsonzid);
icutzprop->append((UChar)0x005B/*'['*/);
icutzprop->append(icutzver);
@@ -1813,10 +1866,10 @@ VTimeZone::write(UDate start, VTZWriter& writer, UErrorCode& status) const {
return;
cleanupWritePartial:
- if (initial != NULL) {
+ if (initial != nullptr) {
delete initial;
}
- if (transitionRules != NULL) {
+ if (transitionRules != nullptr) {
while (!transitionRules->isEmpty()) {
TimeZoneRule *tr = (TimeZoneRule*)transitionRules->orphanElementAt(0);
delete tr;
@@ -1835,14 +1888,14 @@ VTimeZone::writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) const
UnicodeString tzid;
// Extract simple rules
- InitialTimeZoneRule *initial = NULL;
- AnnualTimeZoneRule *std = NULL, *dst = NULL;
+ InitialTimeZoneRule *initial = nullptr;
+ AnnualTimeZoneRule *std = nullptr, *dst = nullptr;
getSimpleRulesNear(time, initial, std, dst, status);
if (U_SUCCESS(status)) {
// Create a RuleBasedTimeZone with the subset rule
getID(tzid);
RuleBasedTimeZone rbtz(tzid, initial);
- if (std != NULL && dst != NULL) {
+ if (std != nullptr && dst != nullptr) {
rbtz.addTransitionRule(std, status);
rbtz.addTransitionRule(dst, status);
}
@@ -1852,6 +1905,10 @@ VTimeZone::writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) const
if (olsonzid.length() > 0 && icutzver.length() > 0) {
UnicodeString *icutzprop = new UnicodeString(ICU_TZINFO_PROP);
+ if (icutzprop == nullptr) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ goto cleanupWriteSimple;
+ }
icutzprop->append(olsonzid);
icutzprop->append((UChar)0x005B/*'['*/);
icutzprop->append(icutzver);
@@ -1869,13 +1926,13 @@ VTimeZone::writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) const
return;
cleanupWriteSimple:
- if (initial != NULL) {
+ if (initial != nullptr) {
delete initial;
}
- if (std != NULL) {
+ if (std != nullptr) {
delete std;
}
- if (dst != NULL) {
+ if (dst != nullptr) {
delete dst;
}
}
@@ -1891,7 +1948,7 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
return;
}
- if (customProps != NULL) {
+ if (customProps != nullptr) {
for (int32_t i = 0; i < customProps->size(); i++) {
UnicodeString *custprop = (UnicodeString*)customProps->elementAt(i);
w.write(*custprop);
@@ -1912,7 +1969,7 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
UDate dstStartTime = 0.0;
UDate dstUntilTime = 0.0;
int32_t dstCount = 0;
- AnnualTimeZoneRule *finalDstRule = NULL;
+ AnnualTimeZoneRule *finalDstRule = nullptr;
UnicodeString stdName;
int32_t stdFromOffset = 0;
@@ -1926,7 +1983,7 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
UDate stdStartTime = 0.0;
UDate stdUntilTime = 0.0;
int32_t stdCount = 0;
- AnnualTimeZoneRule *finalStdRule = NULL;
+ AnnualTimeZoneRule *finalStdRule = nullptr;
int32_t year, month, dom, dow, doy, mid;
UBool hasTransitions = FALSE;
@@ -1953,8 +2010,8 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
UBool sameRule = FALSE;
const AnnualTimeZoneRule *atzrule;
if (isDst) {
- if (finalDstRule == NULL
- && (atzrule = dynamic_cast(tzt.getTo())) != NULL
+ if (finalDstRule == nullptr
+ && (atzrule = dynamic_cast(tzt.getTo())) != nullptr
&& atzrule->getEndYear() == AnnualTimeZoneRule::MAX_YEAR
) {
finalDstRule = atzrule->clone();
@@ -2000,12 +2057,12 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
dstStartTime = dstUntilTime = t;
dstCount = 1;
}
- if (finalStdRule != NULL && finalDstRule != NULL) {
+ if (finalStdRule != nullptr && finalDstRule != nullptr) {
break;
}
} else {
- if (finalStdRule == NULL
- && (atzrule = dynamic_cast(tzt.getTo())) != NULL
+ if (finalStdRule == nullptr
+ && (atzrule = dynamic_cast(tzt.getTo())) != nullptr
&& atzrule->getEndYear() == AnnualTimeZoneRule::MAX_YEAR
) {
finalStdRule = atzrule->clone();
@@ -2051,7 +2108,7 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
stdStartTime = stdUntilTime = t;
stdCount = 1;
}
- if (finalStdRule != NULL && finalDstRule != NULL) {
+ if (finalStdRule != nullptr && finalDstRule != nullptr) {
break;
}
}
@@ -2075,7 +2132,7 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
}
} else {
if (dstCount > 0) {
- if (finalDstRule == NULL) {
+ if (finalDstRule == nullptr) {
if (dstCount == 1) {
writeZonePropsByTime(w, TRUE, dstName, dstFromOffset, dstToOffset, dstStartTime,
TRUE, status);
@@ -2117,7 +2174,7 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
}
}
if (stdCount > 0) {
- if (finalStdRule == NULL) {
+ if (finalStdRule == nullptr) {
if (stdCount == 1) {
writeZonePropsByTime(w, FALSE, stdName, stdFromOffset, stdToOffset, stdStartTime,
TRUE, status);
@@ -2163,10 +2220,10 @@ VTimeZone::writeZone(VTZWriter& w, BasicTimeZone& basictz,
cleanupWriteZone:
- if (finalStdRule != NULL) {
+ if (finalStdRule != nullptr) {
delete finalStdRule;
}
- if (finalDstRule != NULL) {
+ if (finalDstRule != nullptr) {
delete finalDstRule;
}
}
@@ -2479,8 +2536,11 @@ VTimeZone::writeFinalRule(VTZWriter& writer, UBool isDst, const AnnualTimeZoneRu
return;
}
UBool modifiedRule = TRUE;
- const DateTimeRule *dtrule = toWallTimeRule(rule->getRule(), fromRawOffset, fromDSTSavings);
- if (dtrule == NULL) {
+ const DateTimeRule *dtrule = toWallTimeRule(rule->getRule(), fromRawOffset, fromDSTSavings, status);
+ if (U_FAILURE(status)) {
+ return;
+ }
+ if (dtrule == nullptr) {
modifiedRule = FALSE;
dtrule = rule->getRule();
}
diff --git a/deps/icu-small/source/tools/genccode/genccode.c b/deps/icu-small/source/tools/genccode/genccode.c
index 91e94d7f5181c4..c5bbdf60d7d910 100644
--- a/deps/icu-small/source/tools/genccode/genccode.c
+++ b/deps/icu-small/source/tools/genccode/genccode.c
@@ -69,6 +69,7 @@ enum {
#ifdef CAN_GENERATE_OBJECTS
kOptObject,
kOptMatchArch,
+ kOptSkipDllExport,
#endif
kOptFilename,
kOptAssembly
@@ -82,8 +83,9 @@ static UOption options[]={
UOPTION_DEF("name", 'n', UOPT_REQUIRES_ARG),
UOPTION_DEF("entrypoint", 'e', UOPT_REQUIRES_ARG),
#ifdef CAN_GENERATE_OBJECTS
-/*5*/UOPTION_DEF("object", 'o', UOPT_NO_ARG),
+/*6*/UOPTION_DEF("object", 'o', UOPT_NO_ARG),
UOPTION_DEF("match-arch", 'm', UOPT_REQUIRES_ARG),
+ UOPTION_DEF("skip-dll-export", '\0', UOPT_NO_ARG),
#endif
UOPTION_DEF("filename", 'f', UOPT_REQUIRES_ARG),
UOPTION_DEF("assembly", 'a', UOPT_REQUIRES_ARG)
@@ -127,7 +129,8 @@ main(int argc, char* argv[]) {
fprintf(stderr,
"\t-o or --object write a .obj file instead of .c\n"
"\t-m or --match-arch file.o match the architecture (CPU, 32/64 bits) of the specified .o\n"
- "\t ELF format defaults to i386. Windows defaults to the native platform.\n");
+ "\t ELF format defaults to i386. Windows defaults to the native platform.\n"
+ "\t--skip-dll-export Don't export the ICU data entry point symbol (for use when statically linking)\n");
#endif
fprintf(stderr,
"\t-f or --filename Specify an alternate base filename. (default: symbolname_typ)\n"
@@ -193,7 +196,8 @@ main(int argc, char* argv[]) {
options[kOptMatchArch].doesOccur ? options[kOptMatchArch].value : NULL,
options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,
NULL,
- 0);
+ 0,
+ !options[kOptSkipDllExport].doesOccur);
break;
#endif
default:
diff --git a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp b/deps/icu-small/source/tools/pkgdata/pkgdata.cpp
index c3249bad293e3c..41a13406cf1f31 100644
--- a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp
+++ b/deps/icu-small/source/tools/pkgdata/pkgdata.cpp
@@ -46,6 +46,7 @@
#include "flagparser.h"
#include "filetools.h"
#include "charstr.h"
+#include "uassert.h"
#if U_HAVE_POPEN
# include
@@ -95,7 +96,7 @@ static int32_t pkg_archiveLibrary(const char *targetDir, const char *version, UB
static void createFileNames(UPKGOptions *o, const char mode, const char *version_major, const char *version, const char *libName, const UBool reverseExt, UBool noVersion);
static int32_t initializePkgDataFlags(UPKGOptions *o);
-static int32_t pkg_getOptionsFromICUConfig(UBool verbose, UOption *option);
+static int32_t pkg_getPkgDataPath(UBool verbose, UOption *option);
static int runCommand(const char* command, UBool specialHandling=FALSE);
#define IN_COMMON_MODE(mode) (mode == 'a' || mode == 'c')
@@ -309,7 +310,7 @@ main(int argc, char* argv[]) {
#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
if(!options[BLDOPT].doesOccur && uprv_strcmp(options[MODE].value, "common") != 0) {
- if (pkg_getOptionsFromICUConfig(options[VERBOSE].doesOccur, &options[BLDOPT]) != 0) {
+ if (pkg_getPkgDataPath(options[VERBOSE].doesOccur, &options[BLDOPT]) != 0) {
fprintf(stderr, " required parameter is missing: -O is required for static and shared builds.\n");
fprintf(stderr, "Run '%s --help' for help.\n", progname);
return 1;
@@ -775,7 +776,8 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
(optMatchArch[0] == 0 ? NULL : optMatchArch),
NULL,
gencFilePath,
- sizeof(gencFilePath));
+ sizeof(gencFilePath),
+ TRUE);
pkg_destroyOptMatchArch(optMatchArch);
#if U_PLATFORM_IS_LINUX_BASED
result = pkg_generateLibraryFile(targetDir, mode, gencFilePath);
@@ -1131,12 +1133,15 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir,
int32_t result = 0;
char cmd[SMALL_BUFFER_MAX_SIZE];
- sprintf(cmd, "cd %s && %s %s %s%s%s",
+ auto ret = snprintf(cmd,
+ SMALL_BUFFER_MAX_SIZE,
+ "cd %s && %s %s %s%s%s",
targetDir,
pkgDataFlags[INSTALL_CMD],
libFileNames[LIB_FILE_VERSION],
- installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION]
- );
+ installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION]);
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
result = runCommand(cmd);
@@ -1254,10 +1259,14 @@ static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, c
buffer[bufferLength-1] = 0;
}
- sprintf(cmd, "%s %s%s%s %s%s%s",
+ auto ret = snprintf(cmd,
+ SMALL_BUFFER_MAX_SIZE,
+ "%s %s%s%s %s%s%s",
pkgDataFlags[INSTALL_CMD],
srcDir, PKGDATA_FILE_SEP_STRING, buffer,
installDir, PKGDATA_FILE_SEP_STRING, buffer);
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
result = runCommand(cmd);
if (result != 0) {
@@ -1689,12 +1698,20 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD
break;
}
}
- sprintf(newName, "%s_%s",
+ auto ret = snprintf(newName,
+ SMALL_BUFFER_MAX_SIZE,
+ "%s_%s",
DATA_PREFIX[n],
newNameTmp);
- sprintf(dataName, "%s_%s",
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
+ ret = snprintf(dataName,
+ SMALL_BUFFER_MAX_SIZE,
+ "%s_%s",
o->shortName,
DATA_PREFIX[n]);
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
}
if (newName[0] != 0) {
break;
@@ -2158,41 +2175,46 @@ static void loadLists(UPKGOptions *o, UErrorCode *status)
} /* for each file list file */
}
-/* Try calling icu-config directly to get the option file. */
- static int32_t pkg_getOptionsFromICUConfig(UBool verbose, UOption *option) {
+/* Helper for pkg_getPkgDataPath() */
#if U_HAVE_POPEN
- LocalPipeFilePointer p;
- size_t n;
- static char buf[512] = "";
+static UBool getPkgDataPath(const char *cmd, UBool verbose, char *buf, size_t items) {
icu::CharString cmdBuf;
UErrorCode status = U_ZERO_ERROR;
- const char cmd[] = "icu-config --incpkgdatafile";
- char dirBuf[1024] = "";
- /* #1 try the same path where pkgdata was called from. */
- findDirname(progname, dirBuf, UPRV_LENGTHOF(dirBuf), &status);
- if(U_SUCCESS(status)) {
- cmdBuf.append(dirBuf, status);
- if (cmdBuf[0] != 0) {
- cmdBuf.append( U_FILE_SEP_STRING, status );
- }
- cmdBuf.append( cmd, status );
-
- if(verbose) {
- fprintf(stdout, "# Calling icu-config: %s\n", cmdBuf.data());
- }
- p.adoptInstead(popen(cmdBuf.data(), "r"));
- }
-
- if(p.isNull() || (n = fread(buf, 1, UPRV_LENGTHOF(buf)-1, p.getAlias())) <= 0) {
- if(verbose) {
- fprintf(stdout, "# Calling icu-config: %s\n", cmd);
- }
+ LocalPipeFilePointer p;
+ size_t n;
+
+ cmdBuf.append(cmd, status);
+ if (verbose) {
+ fprintf(stdout, "# Calling: %s\n", cmdBuf.data());
+ }
+ p.adoptInstead( popen(cmdBuf.data(), "r") );
+
+ if (p.isNull() || (n = fread(buf, 1, items-1, p.getAlias())) <= 0) {
+ fprintf(stderr, "%s: Error calling '%s'\n", progname, cmd);
+ *buf = 0;
+ return FALSE;
+ }
- p.adoptInstead(popen(cmd, "r"));
- if(p.isNull() || (n = fread(buf, 1, UPRV_LENGTHOF(buf)-1, p.getAlias())) <= 0) {
- fprintf(stderr, "%s: icu-config: No icu-config found. (fix PATH or use -O option)\n", progname);
+ return TRUE;
+}
+#endif
+
+/* Get path to pkgdata.inc. Try pkg-config first, falling back to icu-config. */
+static int32_t pkg_getPkgDataPath(UBool verbose, UOption *option) {
+#if U_HAVE_POPEN
+ static char buf[512] = "";
+ UBool pkgconfigIsValid = TRUE;
+ const char *pkgconfigCmd = "pkg-config --variable=pkglibdir icu-uc";
+ const char *icuconfigCmd = "icu-config --incpkgdatafile";
+ const char *pkgdata = "pkgdata.inc";
+
+ if (!getPkgDataPath(pkgconfigCmd, verbose, buf, UPRV_LENGTHOF(buf))) {
+ if (!getPkgDataPath(icuconfigCmd, verbose, buf, UPRV_LENGTHOF(buf))) {
+ fprintf(stderr, "%s: icu-config not found. Fix PATH or specify -O option\n", progname);
return -1;
}
+
+ pkgconfigIsValid = FALSE;
}
for (int32_t length = strlen(buf) - 1; length >= 0; length--) {
@@ -2203,21 +2225,18 @@ static void loadLists(UPKGOptions *o, UErrorCode *status)
}
}
- if(buf[strlen(buf)-1]=='\n')
- {
- buf[strlen(buf)-1]=0;
- }
-
- if(buf[0] == 0)
- {
- fprintf(stderr, "%s: icu-config: invalid response from icu-config (fix PATH or use -O option)\n", progname);
+ if (!*buf) {
+ fprintf(stderr, "%s: Unable to locate pkgdata.inc. Unable to parse the results of '%s'. Check paths or use the -O option to specify the path to pkgdata.inc.\n", progname, pkgconfigIsValid ? pkgconfigCmd : icuconfigCmd);
return -1;
}
- if(verbose) {
- fprintf(stdout, "# icu-config said: %s\n", buf);
+ if (pkgconfigIsValid) {
+ uprv_strcat(buf, U_FILE_SEP_STRING);
+ uprv_strcat(buf, pkgdata);
}
+ buf[strlen(buf)] = 0;
+
option->value = buf;
option->doesOccur = TRUE;
diff --git a/deps/icu-small/source/tools/toolutil/pkg_genc.cpp b/deps/icu-small/source/tools/toolutil/pkg_genc.cpp
index b68b2d9c7c7b13..31db2e2184b3be 100644
--- a/deps/icu-small/source/tools/toolutil/pkg_genc.cpp
+++ b/deps/icu-small/source/tools/toolutil/pkg_genc.cpp
@@ -131,6 +131,9 @@ static const struct AssemblyType {
{"gcc",
".globl %s\n"
"\t.section .note.GNU-stack,\"\",%%progbits\n"
+ "#ifdef __CET__\n"
+ "# include \n"
+ "#endif\n"
"\t.section .rodata\n"
"\t.balign 16\n"
"#ifdef U_HIDE_DATA_SYMBOL\n"
@@ -878,7 +881,8 @@ writeObjectCode(
const char *optMatchArch,
const char *optFilename,
char *outFilePath,
- size_t outFilePathCapacity) {
+ size_t outFilePathCapacity,
+ UBool optWinDllExport) {
/* common variables */
char buffer[4096], entry[96]={ 0 };
FileStream *in, *out;
@@ -888,6 +892,8 @@ writeObjectCode(
uint16_t cpu, bits;
UBool makeBigEndian;
+ (void)optWinDllExport; /* unused except Windows */
+
/* platform-specific variables and initialization code */
#ifdef U_ELF
/* 32-bit Elf file header */
@@ -1254,12 +1260,17 @@ writeObjectCode(
uprv_memset(&symbolNames, 0, sizeof(symbolNames));
/* write the linker export directive */
- uprv_strcpy(objHeader.linkerOptions, "-export:");
- length=8;
- uprv_strcpy(objHeader.linkerOptions+length, entry);
- length+=entryLength;
- uprv_strcpy(objHeader.linkerOptions+length, ",data ");
- length+=6;
+ if (optWinDllExport) {
+ uprv_strcpy(objHeader.linkerOptions, "-export:");
+ length=8;
+ uprv_strcpy(objHeader.linkerOptions+length, entry);
+ length+=entryLength;
+ uprv_strcpy(objHeader.linkerOptions+length, ",data ");
+ length+=6;
+ }
+ else {
+ length=0;
+ }
/* set the file header */
objHeader.fileHeader.Machine=cpu;
diff --git a/deps/icu-small/source/tools/toolutil/pkg_genc.h b/deps/icu-small/source/tools/toolutil/pkg_genc.h
index 47e8304a6890c5..b231aa6170c287 100644
--- a/deps/icu-small/source/tools/toolutil/pkg_genc.h
+++ b/deps/icu-small/source/tools/toolutil/pkg_genc.h
@@ -100,6 +100,7 @@ writeObjectCode(
const char *optMatchArch,
const char *optFilename,
char *outFilePath,
- size_t outFilePathCapacity);
+ size_t outFilePathCapacity,
+ UBool optWinDllExport);
#endif
diff --git a/deps/icu-small/source/tools/toolutil/toolutil.cpp b/deps/icu-small/source/tools/toolutil/toolutil.cpp
index 25f9c116ee18d4..f0d6be5cf5ee2a 100644
--- a/deps/icu-small/source/tools/toolutil/toolutil.cpp
+++ b/deps/icu-small/source/tools/toolutil/toolutil.cpp
@@ -60,6 +60,8 @@
#include
+#include
+
#include "unicode/errorcode.h"
#include "unicode/putil.h"
#include "cmemory.h"
@@ -243,7 +245,7 @@ struct UToolMemory {
char name[64];
int32_t capacity, maxCapacity, size, idx;
void *array;
- alignas(max_align_t) char staticArray[1];
+ alignas(std::max_align_t) char staticArray[1];
};
U_CAPI UToolMemory * U_EXPORT2
diff --git a/deps/npm/.npmignore b/deps/npm/.npmignore
index c42aaf956257d5..f45f47b93829b8 100644
--- a/deps/npm/.npmignore
+++ b/deps/npm/.npmignore
@@ -24,5 +24,5 @@ html/*.png
*.pyc
-
+Session.vim
.nyc_output
diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml
index cec3aac226b1c1..9fb0d51133692c 100644
--- a/deps/npm/.travis.yml
+++ b/deps/npm/.travis.yml
@@ -12,9 +12,6 @@ node_js:
env: "DEPLOY_VERSION=testing"
-notifications:
- slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8
-
install:
- "node . install"
diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS
index c2a38c02d53f97..08cade33b6ff10 100644
--- a/deps/npm/AUTHORS
+++ b/deps/npm/AUTHORS
@@ -691,3 +691,7 @@ Vitaliy Markitanov <9357021+vit100@users.noreply.github.com>
simon_s
John Kennedy
Bernard Kitchens
+Jarda Snajdr
+Naix Geng <1308363651@qq.com>
+Dylan Treisman
+mum-never-proud
diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md
index 5cd9c8d8f88615..bae7de70605601 100644
--- a/deps/npm/CHANGELOG.md
+++ b/deps/npm/CHANGELOG.md
@@ -1,3 +1,18 @@
+## 6.14.5 (2020-05-01)
+
+### BUG FIXES
+
+* [`33ec41f18`](https://github.com/npm/cli/commit/33ec41f18f557146607cb14a7a38c707fce6d42c) [#758](https://github.com/npm/cli/pull/758) fix: relativize file links when inflating shrinkwrap ([@jsnajdr](https://github.com/jsnajdr))
+* [`94ed456df`](https://github.com/npm/cli/commit/94ed456dfb0b122fd4192429024f034d06c3c454) [#1162](https://github.com/npm/cli/pull/1162) fix: npm init help output ([@mum-never-proud](https://github.com/mum-never-proud))
+
+### DEPENDENCIES
+
+* [`5587ac01f`](https://github.com/npm/cli/commit/5587ac01ffd0d2ea830a6bbb67bb34a611ffc409) `npm-registry-fetch@4.0.4`
+ * [`fc5d94c39`](https://github.com/npm/npm-registry-fetch/commit/fc5d94c39ca218d78df77249ab3a6bf1d9ed9db1) fix: removed default timeout
+* [`07a4d8884`](https://github.com/npm/cli/commit/07a4d8884448359bac485a49c05fd2d23d06834b) `graceful-fs@4.2.4`
+* [`8228d1f2e`](https://github.com/npm/cli/commit/8228d1f2e427ad9adee617266108acd1ee39b4a5) `mkdirp@0.5.5`
+* [`e6d208317`](https://github.com/npm/cli/commit/e6d20831740a84aea766da2a2913cf82a4d56ada) `nopt@4.0.3`
+
## 6.14.4 (2020-03-24)
### DEPENDENCIES
diff --git a/deps/npm/CONTRIBUTING.md b/deps/npm/CONTRIBUTING.md
index 981f0457d5c6bf..c08bd090cb64b4 100644
--- a/deps/npm/CONTRIBUTING.md
+++ b/deps/npm/CONTRIBUTING.md
@@ -73,7 +73,7 @@ All interactions in the npm repository are covered by the [npm Code of Conduct](
# Make sure you install the dependencies first before running tests.
$ npm install
-# Run tests for the CLI (it could take awhile).
+# Run tests for the CLI (it could take a while).
$ npm run test
```
@@ -97,7 +97,7 @@ $ make link
#################
# ALTERNATIVELY
#################
-# If ou're working on a feature or bug, you can run the same command on your
+# If you're working on a feature or bug, you can run the same command on your
# working branch and link that code.
# Create new branch to work from (there are many ways)
@@ -130,7 +130,7 @@ let you know that it's sent the request to start the benchmark suite.

-If you've updated your pull-reuqest and you'd like to run the the benchmark suite again, simple update your original comment, by adding `test this please ✅` again, or simply just adding another emoji to the **end**. _(The trigger is the phrase "test this please ✅" at the beginning of a comment. Updates will trigger as well, so long as the phrase stays at the beginning.)_.
+If you've updated your pull-request and you'd like to run the the benchmark suite again, simple update your original comment, by adding `test this please ✅` again, or simply just adding another emoji to the **end**. _(The trigger is the phrase "test this please ✅" at the beginning of a comment. Updates will trigger as well, so long as the phrase stays at the beginning.)_.

diff --git a/deps/npm/docs/content/cli-commands/npm.md b/deps/npm/docs/content/cli-commands/npm.md
index 01a9308204d196..2d9789dd77c1c6 100644
--- a/deps/npm/docs/content/cli-commands/npm.md
+++ b/deps/npm/docs/content/cli-commands/npm.md
@@ -57,14 +57,14 @@ on a preinstalled git.
If one of the packages npm tries to install is a native node module and
requires compiling of C++ Code, npm will use
-[node-gyp](https://github.com/TooTallNate/node-gyp) for that task.
-For a Unix system, [node-gyp](https://github.com/TooTallNate/node-gyp)
+[node-gyp](https://github.com/nodejs/node-gyp) for that task.
+For a Unix system, [node-gyp](https://github.com/nodejs/node-gyp)
needs Python, make and a buildchain like GCC. On Windows,
Python and Microsoft Visual Studio C++ are needed. Python 3 is
-not supported by [node-gyp](https://github.com/TooTallNate/node-gyp).
+not supported by [node-gyp](https://github.com/nodejs/node-gyp).
For more information visit
-[the node-gyp repository](https://github.com/TooTallNate/node-gyp) and
-the [node-gyp Wiki](https://github.com/TooTallNate/node-gyp/wiki).
+[the node-gyp repository](https://github.com/nodejs/node-gyp) and
+the [node-gyp Wiki](https://github.com/nodejs/node-gyp/wiki).
### Directories
diff --git a/deps/npm/docs/content/using-npm/scripts.md b/deps/npm/docs/content/using-npm/scripts.md
index a9ca433fdea08c..befedd0724aa56 100644
--- a/deps/npm/docs/content/using-npm/scripts.md
+++ b/deps/npm/docs/content/using-npm/scripts.md
@@ -145,9 +145,15 @@ suites, then those executables will be added to the `PATH` for
executing the scripts. So, if your package.json has this:
```json
-{ "name" : "foo"
-, "dependencies" : { "bar" : "0.1.x" }
-, "scripts": { "start" : "bar ./test" } }
+{
+ "name" : "foo",
+ "dependencies" : {
+ "bar" : "0.1.x"
+ },
+ "scripts": {
+ "start" : "bar ./test"
+ }
+}
```
then you could run `npm start` to execute the `bar` script, which is
@@ -176,9 +182,15 @@ there is a config param of `[@]:`. For example,
if the package.json has this:
```json
-{ "name" : "foo"
-, "config" : { "port" : "8080" }
-, "scripts" : { "start" : "node server.js" } }
+{
+ "name" : "foo",
+ "config" : {
+ "port" : "8080"
+ },
+ "scripts" : {
+ "start" : "node server.js"
+ }
+}
```
and the server.js is this:
@@ -213,10 +225,11 @@ process.env.npm_package_scripts_install === "foo.js"
For example, if your package.json contains this:
```json
-{ "scripts" :
- { "install" : "scripts/install.js"
- , "postinstall" : "scripts/postinstall.js"
- , "uninstall" : "scripts/uninstall.js"
+{
+ "scripts" : {
+ "install" : "scripts/install.js",
+ "postinstall" : "scripts/install.js",
+ "uninstall" : "scripts/uninstall.js"
}
}
```
@@ -232,10 +245,11 @@ If you want to run a make command, you can do so. This works just
fine:
```json
-{ "scripts" :
- { "preinstall" : "./configure"
- , "install" : "make && make install"
- , "test" : "make test"
+{
+ "scripts" : {
+ "preinstall" : "./configure",
+ "install" : "make && make install",
+ "test" : "make test"
}
}
```
diff --git a/deps/npm/docs/public/cli-commands/npm-access/index.html b/deps/npm/docs/public/cli-commands/npm-access/index.html
index f3853e530b6b3a..63df3a3728374c 100644
--- a/deps/npm/docs/public/cli-commands/npm-access/index.html
+++ b/deps/npm/docs/public/cli-commands/npm-access/index.html
@@ -26,7 +26,7 @@
/* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */
.fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;}
/* sc-component-id: Page__Content-sc-4b62ym-0 */
-.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}