+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 1996-2016, International Business Machines
#define UDAT_HOUR_TZ "jz"
#endif /* U_HIDE_DEPRECATED_API */
+#ifndef U_HIDE_INTERNAL_API
+/**
+ * Constant for Unicode string name of new (in 2019) Japanese calendar era,
+ * root/English abbreviated version (ASCII-range characters).
+ * @internal
+ */
+#define JP_ERA_2019_ROOT "Reiwa"
+/**
+ * Constant for Unicode string name of new (in 2019) Japanese calendar era,
+ * Japanese abbreviated version (Han, or fullwidth Latin for testing).
+ * @internal
+ */
+#define JP_ERA_2019_JA "\\u4EE4\\u548C"
+/**
+ * Constant for Unicode string name of new (in 2019) Japanese calendar era,
+ * root and Japanese narrow version (ASCII-range characters).
+ * @internal
+ */
+#define JP_ERA_2019_NARROW "R"
+#endif // U_HIDE_INTERNAL_API
+
/**
* FieldPosition and UFieldPosition selectors for format fields
* defined by DateFormat and UDateFormat.
UDAT_RELATED_YEAR_FIELD = 34,
#endif /* U_HIDE_INTERNAL_API */
-#ifndef U_HIDE_DRAFT_API
/**
* FieldPosition selector for 'b' field alignment.
* Displays midnight and noon for 12am and 12pm, respectively, if available;
* otherwise fall back to AM / PM.
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35,
/* FieldPosition selector for 'B' field alignment.
* Displays flexible day periods, such as "in the morning", if available.
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API
/**
UDAT_TIME_SEPARATOR_FIELD = 37,
#endif /* U_HIDE_INTERNAL_API */
- /**
+#ifndef U_HIDE_DEPRECATED_API
+ /**
* Number of FieldPosition and UFieldPosition selectors for
* DateFormat and UDateFormat.
* Valid selectors range from 0 to UDAT_FIELD_COUNT-1.
- * This value is subject to change if new fields are defined
- * in the future.
- * @stable ICU 3.0
+ * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UDAT_FIELD_COUNT = 38
-
+#endif /* U_HIDE_DEPRECATED_API */
} UDateFormatField;
* of error (e.g., the input field is UDAT_FIELD_COUNT).
* @stable ICU 4.4
*/
-U_STABLE UCalendarDateFields U_EXPORT2
+U_CAPI UCalendarDateFields U_EXPORT2
udat_toCalendarDateField(UDateFormatField field);
* an error occurred.
* @stable ICU 2.0
*/
-U_STABLE UDateFormat* U_EXPORT2
+U_CAPI UDateFormat* U_EXPORT2
udat_open(UDateFormatStyle timeStyle,
UDateFormatStyle dateStyle,
const char *locale,
* @param format The formatter to close.
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_close(UDateFormat* format);
* @stable ICU 53
*/
UDAT_PARSE_ALLOW_NUMERIC = 1,
-#ifndef U_HIDE_DRAFT_API
/**
* indicates tolerance of a partial literal match
* e.g. accepting "--mon-02-march-2011" for a pattern of "'--: 'EEE-WW-MMMM-yyyy"
- * @draft ICU 56
+ * @stable ICU 56
*/
UDAT_PARSE_PARTIAL_LITERAL_MATCH = 2,
/**
* indicates tolerance of pattern mismatch between input data and specified format pattern.
* e.g. accepting "September" for a month pattern of MMM ("Sep")
- * @draft ICU 56
+ * @stable ICU 56
*/
UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3,
-#endif /* U_HIDE_DRAFT_API */
+
+ /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
+ * it is needed for layout of DateFormat object. */
/**
- * count boolean date format constants
- * @stable ICU 53
+ * One more than the highest normal UDateFormatBooleanAttribute value.
+ * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4
} UDateFormatBooleanAttribute;
* @return The value of attr.
* @stable ICU 53
*/
-U_STABLE UBool U_EXPORT2
+U_CAPI UBool U_EXPORT2
udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status);
/**
* @param status A pointer to an UErrorCode to receive any errors
* @stable ICU 53
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status);
U_NAMESPACE_END
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
/**
* Open a copy of a UDateFormat.
* @return A pointer to a UDateFormat identical to fmt.
* @stable ICU 2.0
*/
-U_STABLE UDateFormat* U_EXPORT2
+U_CAPI UDateFormat* U_EXPORT2
udat_clone(const UDateFormat *fmt,
UErrorCode *status);
* @see UFieldPosition
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_format( const UDateFormat* format,
UDate dateToFormat,
UChar* result,
* @see UFieldPosition
* @stable ICU 55
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_formatCalendar( const UDateFormat* format,
UCalendar* calendar,
UChar* result,
* @see UFieldPositionIterator
* @stable ICU 55
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_formatForFields( const UDateFormat* format,
UDate dateToFormat,
UChar* result,
* @see UFieldPositionIterator
* @stable ICU 55
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_formatCalendarForFields( const UDateFormat* format,
UCalendar* calendar,
UChar* result,
* @see udat_format
* @stable ICU 2.0
*/
-U_STABLE UDate U_EXPORT2
+U_CAPI UDate U_EXPORT2
udat_parse(const UDateFormat* format,
const UChar* text,
int32_t textLength,
* @see udat_format
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_parseCalendar(const UDateFormat* format,
UCalendar* calendar,
const UChar* text,
* @see udat_setLenient
* @stable ICU 2.0
*/
-U_STABLE UBool U_EXPORT2
+U_CAPI UBool U_EXPORT2
udat_isLenient(const UDateFormat* fmt);
/**
* @see dat_isLenient
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setLenient( UDateFormat* fmt,
UBool isLenient);
* @see udat_setCalendar
* @stable ICU 2.0
*/
-U_STABLE const UCalendar* U_EXPORT2
+U_CAPI const UCalendar* U_EXPORT2
udat_getCalendar(const UDateFormat* fmt);
/**
* @see udat_setCalendar
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setCalendar( UDateFormat* fmt,
const UCalendar* calendarToSet);
* @see udat_setNumberFormat
* @stable ICU 2.0
*/
-U_STABLE const UNumberFormat* U_EXPORT2
+U_CAPI const UNumberFormat* U_EXPORT2
udat_getNumberFormat(const UDateFormat* fmt);
/**
* @see udat_setNumberFormatForField
* @stable ICU 54
*/
-U_STABLE const UNumberFormat* U_EXPORT2
+U_CAPI const UNumberFormat* U_EXPORT2
udat_getNumberFormatForField(const UDateFormat* fmt, UChar field);
/**
* @see udat_getNumberFormatForField
* @stable ICU 54
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_adoptNumberFormatForFields( UDateFormat* fmt,
const UChar* fields,
UNumberFormat* numberFormatToSet,
* @see udat_setNumberFormatForField
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setNumberFormat( UDateFormat* fmt,
const UNumberFormat* numberFormatToSet);
/**
* @see udat_getNumberFormat
* @stable ICU 54
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_adoptNumberFormat( UDateFormat* fmt,
UNumberFormat* numberFormatToAdopt);
/**
* @see udat_countAvailable
* @stable ICU 2.0
*/
-U_STABLE const char* U_EXPORT2
+U_CAPI const char* U_EXPORT2
udat_getAvailable(int32_t localeIndex);
/**
* @see udat_getAvailable
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_countAvailable(void);
/**
* @see udat_Set2DigitYearStart
* @stable ICU 2.0
*/
-U_STABLE UDate U_EXPORT2
+U_CAPI UDate U_EXPORT2
udat_get2DigitYearStart( const UDateFormat *fmt,
UErrorCode *status);
* @see udat_Set2DigitYearStart
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_set2DigitYearStart( UDateFormat *fmt,
UDate d,
UErrorCode *status);
* @see udat_applyPattern
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_toPattern( const UDateFormat *fmt,
UBool localized,
UChar *result,
* @see udat_toPattern
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_applyPattern( UDateFormat *format,
UBool localized,
const UChar *pattern,
* @see udat_setSymbols
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_getSymbols(const UDateFormat *fmt,
UDateFormatSymbolType type,
int32_t symbolIndex,
* @see udat_setSymbols
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_countSymbols( const UDateFormat *fmt,
UDateFormatSymbolType type);
* @see udat_countSymbols
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setSymbols( UDateFormat *format,
UDateFormatSymbolType type,
int32_t symbolIndex,
* @return the locale name
* @stable ICU 2.8
*/
-U_STABLE const char* U_EXPORT2
+U_CAPI const char* U_EXPORT2
udat_getLocaleByType(const UDateFormat *fmt,
ULocDataLocaleType type,
UErrorCode* status);
* @param status A pointer to an UErrorCode to receive any errors
* @stable ICU 51
*/
-U_DRAFT void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status);
/**
* @return The UDisplayContextValue for the specified type.
* @stable ICU 53
*/
-U_STABLE UDisplayContext U_EXPORT2
+U_CAPI UDisplayContext U_EXPORT2
udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
#ifndef U_HIDE_INTERNAL_API