Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4159)

Unified Diff: source/i18n/unicode/udat.h

Issue 2440913002: Update ICU to 58.1
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/unicode/ucurr.h ('k') | source/i18n/unicode/udateintervalformat.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/unicode/udat.h
diff --git a/source/i18n/unicode/udat.h b/source/i18n/unicode/udat.h
index bb673ca2d9052a2cd3ef5292a8fc86e91ddc008b..cacfbe85009c234bf1c5b9a7114f14a671c8474d 100644
--- a/source/i18n/unicode/udat.h
+++ b/source/i18n/unicode/udat.h
@@ -1,6 +1,8 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
- * Copyright (C) 1996-2015, International Business Machines
+ * Copyright (C) 1996-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
@@ -150,7 +152,7 @@
*/
typedef void* UDateFormat;
-/** The possible date/time format styles
+/** The possible date/time format styles
* @stable ICU 2.6
*/
typedef enum UDateFormatStyle {
@@ -167,16 +169,16 @@ typedef enum UDateFormatStyle {
/** Bitfield for relative date */
UDAT_RELATIVE = (1 << 7),
-
+
UDAT_FULL_RELATIVE = UDAT_FULL | UDAT_RELATIVE,
-
+
UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE,
-
+
UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE,
-
+
UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE,
-
-
+
+
/** No style */
UDAT_NONE = -1,
@@ -294,7 +296,7 @@ typedef enum UDateFormatStyle {
* Used in combinations date + time, date + time + zone, or time + zone.
* @stable ICU 4.0
*/
-#define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
+#define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd"
/**
* Constant for date skeleton with year, numeric month, weekday, and day.
* Used in combinations date + time, date + time + zone, or time + zone.
@@ -446,7 +448,7 @@ typedef enum UDateFormatStyle {
/* deprecated skeleton constants */
-#ifndef U_HIDE_DEPRECATED_API
+#ifndef U_HIDE_DEPRECATED_API
/**
* Constant for date skeleton with standalone month.
* @deprecated ICU 50 Use UDAT_MONTH instead.
@@ -759,28 +761,43 @@ typedef enum UDateFormatField {
* @internal ICU 53
*/
UDAT_RELATED_YEAR_FIELD = 34,
-#endif /* U_HIDE_INTERNAL_API */
+#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
+ */
+ 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
+ */
+ UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
+#endif /* U_HIDE_DRAFT_API */
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
* FieldPosition and UFieldPosition selector for time separator,
* no corresponding UCAL_ field. No pattern character is currently
* defined for this.
- * @draft ICU 55
+ * @internal
*/
- UDAT_TIME_SEPARATOR_FIELD = 35,
-#endif /* U_HIDE_DRAFT_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 = 36
-
+ UDAT_FIELD_COUNT = 38
+#endif // U_HIDE_DEPRECATED_API
} UDateFormatField;
@@ -834,7 +851,7 @@ udat_toCalendarDateField(UDateFormatField field);
* an error occurred.
* @stable ICU 2.0
*/
-U_STABLE UDateFormat* U_EXPORT2
+U_STABLE UDateFormat* U_EXPORT2
udat_open(UDateFormatStyle timeStyle,
UDateFormatStyle dateStyle,
const char *locale,
@@ -851,13 +868,13 @@ udat_open(UDateFormatStyle timeStyle,
* @param format The formatter to close.
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_close(UDateFormat* format);
/**
* DateFormat boolean attributes
- *
+ *
* @stable ICU 53
*/
typedef enum UDateFormatBooleanAttribute {
@@ -872,23 +889,24 @@ typedef enum UDateFormatBooleanAttribute {
* @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
- */
+ /**
+ * indicates tolerance of pattern mismatch between input data and specified format pattern.
+ * e.g. accepting "September" for a month pattern of MMM ("Sep")
+ * @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;
@@ -948,7 +966,7 @@ U_NAMESPACE_END
* @return A pointer to a UDateFormat identical to fmt.
* @stable ICU 2.0
*/
-U_STABLE UDateFormat* U_EXPORT2
+U_STABLE UDateFormat* U_EXPORT2
udat_clone(const UDateFormat *fmt,
UErrorCode *status);
@@ -970,7 +988,7 @@ udat_clone(const UDateFormat *fmt,
* @see UFieldPosition
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_format( const UDateFormat* format,
UDate dateToFormat,
UChar* result,
@@ -978,7 +996,6 @@ udat_format( const UDateFormat* format,
UFieldPosition* position,
UErrorCode* status);
-#ifndef U_HIDE_DRAFT_API
/**
* Format a date using an UDateFormat.
* The date will be formatted using the conventions specified in {@link #udat_open }
@@ -999,9 +1016,9 @@ udat_format( const UDateFormat* format,
* @see udat_format
* @see udat_parseCalendar
* @see UFieldPosition
-* @draft ICU 55
+* @stable ICU 55
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_formatCalendar( const UDateFormat* format,
UCalendar* calendar,
UChar* result,
@@ -1034,9 +1051,9 @@ udat_formatCalendar( const UDateFormat* format,
* The total buffer size needed; if greater than resultLength, the output was truncated.
* @see udat_parse
* @see UFieldPositionIterator
-* @draft ICU 55
+* @stable ICU 55
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_formatForFields( const UDateFormat* format,
UDate dateToFormat,
UChar* result,
@@ -1072,9 +1089,9 @@ udat_formatForFields( const UDateFormat* format,
* @see udat_format
* @see udat_parseCalendar
* @see UFieldPositionIterator
-* @draft ICU 55
+* @stable ICU 55
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_formatCalendarForFields( const UDateFormat* format,
UCalendar* calendar,
UChar* result,
@@ -1082,7 +1099,6 @@ udat_formatCalendarForFields( const UDateFormat* format,
UFieldPositionIterator* fpositer,
UErrorCode* status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Parse a string into an date/time using a UDateFormat.
@@ -1109,7 +1125,7 @@ udat_formatCalendarForFields( const UDateFormat* format,
* @see udat_format
* @stable ICU 2.0
*/
-U_STABLE UDate U_EXPORT2
+U_STABLE UDate U_EXPORT2
udat_parse(const UDateFormat* format,
const UChar* text,
int32_t textLength,
@@ -1137,7 +1153,7 @@ udat_parse(const UDateFormat* format,
* @see udat_format
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_parseCalendar(const UDateFormat* format,
UCalendar* calendar,
const UChar* text,
@@ -1154,7 +1170,7 @@ udat_parseCalendar(const UDateFormat* format,
* @see udat_setLenient
* @stable ICU 2.0
*/
-U_STABLE UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
udat_isLenient(const UDateFormat* fmt);
/**
@@ -1166,7 +1182,7 @@ udat_isLenient(const UDateFormat* fmt);
* @see dat_isLenient
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_setLenient( UDateFormat* fmt,
UBool isLenient);
@@ -1179,7 +1195,7 @@ udat_setLenient( UDateFormat* fmt,
* @see udat_setCalendar
* @stable ICU 2.0
*/
-U_STABLE const UCalendar* U_EXPORT2
+U_STABLE const UCalendar* U_EXPORT2
udat_getCalendar(const UDateFormat* fmt);
/**
@@ -1191,7 +1207,7 @@ udat_getCalendar(const UDateFormat* fmt);
* @see udat_setCalendar
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_setCalendar( UDateFormat* fmt,
const UCalendar* calendarToSet);
@@ -1204,7 +1220,7 @@ udat_setCalendar( UDateFormat* fmt,
* @see udat_setNumberFormat
* @stable ICU 2.0
*/
-U_STABLE const UNumberFormat* U_EXPORT2
+U_STABLE const UNumberFormat* U_EXPORT2
udat_getNumberFormat(const UDateFormat* fmt);
/**
@@ -1216,14 +1232,14 @@ udat_getNumberFormat(const UDateFormat* fmt);
* @see udat_setNumberFormatForField
* @stable ICU 54
*/
-U_STABLE const UNumberFormat* U_EXPORT2
+U_STABLE const UNumberFormat* U_EXPORT2
udat_getNumberFormatForField(const UDateFormat* fmt, UChar field);
/**
* Set the UNumberFormat for specific field associated with an UDateFormat.
* It can be a single field like: "y"(year) or "M"(month)
* It can be several field combined together: "yM"(year and month)
-* Note:
+* Note:
* 1 symbol field is enough for multiple symbol field (so "y" will override "yy", "yyy")
* If the field is not numeric, then override has no effect (like "MMM" will use abbreviation, not numerical field)
*
@@ -1234,7 +1250,7 @@ udat_getNumberFormatForField(const UDateFormat* fmt, UChar field);
* @see udat_getNumberFormatForField
* @stable ICU 54
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_adoptNumberFormatForFields( UDateFormat* fmt,
const UChar* fields,
UNumberFormat* numberFormatToSet,
@@ -1243,15 +1259,15 @@ udat_adoptNumberFormatForFields( UDateFormat* fmt,
* Set the UNumberFormat associated with an UDateFormat.
* A UDateFormat uses a UNumberFormat to format numbers within a date,
* for example the day number.
-* This method also clears per field NumberFormat instances previously
-* set by {@see udat_setNumberFormatForField}
+* This method also clears per field NumberFormat instances previously
+* set by {@see udat_setNumberFormatForField}
* @param fmt The formatter to set.
* @param numberFormatToSet A pointer to the UNumberFormat to be used by fmt to format numbers.
* @see udat_getNumberFormat
* @see udat_setNumberFormatForField
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_setNumberFormat( UDateFormat* fmt,
const UNumberFormat* numberFormatToSet);
/**
@@ -1263,7 +1279,7 @@ udat_setNumberFormat( UDateFormat* fmt,
* @see udat_getNumberFormat
* @stable ICU 54
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_adoptNumberFormat( UDateFormat* fmt,
UNumberFormat* numberFormatToAdopt);
/**
@@ -1275,7 +1291,7 @@ udat_adoptNumberFormat( UDateFormat* fmt,
* @see udat_countAvailable
* @stable ICU 2.0
*/
-U_STABLE const char* U_EXPORT2
+U_STABLE const char* U_EXPORT2
udat_getAvailable(int32_t localeIndex);
/**
@@ -1286,7 +1302,7 @@ udat_getAvailable(int32_t localeIndex);
* @see udat_getAvailable
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_countAvailable(void);
/**
@@ -1299,7 +1315,7 @@ udat_countAvailable(void);
* @see udat_Set2DigitYearStart
* @stable ICU 2.0
*/
-U_STABLE UDate U_EXPORT2
+U_STABLE UDate U_EXPORT2
udat_get2DigitYearStart( const UDateFormat *fmt,
UErrorCode *status);
@@ -1313,7 +1329,7 @@ udat_get2DigitYearStart( const UDateFormat *fmt,
* @see udat_Set2DigitYearStart
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_set2DigitYearStart( UDateFormat *fmt,
UDate d,
UErrorCode *status);
@@ -1330,7 +1346,7 @@ udat_set2DigitYearStart( UDateFormat *fmt,
* @see udat_applyPattern
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_toPattern( const UDateFormat *fmt,
UBool localized,
UChar *result,
@@ -1347,14 +1363,14 @@ udat_toPattern( const UDateFormat *fmt,
* @see udat_toPattern
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_applyPattern( UDateFormat *format,
UBool localized,
const UChar *pattern,
int32_t patternLength);
-/**
- * The possible types of date format symbols
+/**
+ * The possible types of date format symbols
* @stable ICU 2.6
*/
typedef enum UDateFormatSymbolType {
@@ -1473,7 +1489,7 @@ typedef struct UDateFormatSymbols UDateFormatSymbols;
* @see udat_setSymbols
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_getSymbols(const UDateFormat *fmt,
UDateFormatSymbolType type,
int32_t symbolIndex,
@@ -1493,7 +1509,7 @@ udat_getSymbols(const UDateFormat *fmt,
* @see udat_setSymbols
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
udat_countSymbols( const UDateFormat *fmt,
UDateFormatSymbolType type);
@@ -1512,7 +1528,7 @@ udat_countSymbols( const UDateFormat *fmt,
* @see udat_countSymbols
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_STABLE void U_EXPORT2
udat_setSymbols( UDateFormat *format,
UDateFormatSymbolType type,
int32_t symbolIndex,
@@ -1524,7 +1540,7 @@ udat_setSymbols( UDateFormat *format,
* Get the locale for this date format object.
* You can choose between valid and actual locale.
* @param fmt The formatter to get the locale from
- * @param type type of the locale we're looking for (valid or actual)
+ * @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale name
* @stable ICU 2.8
@@ -1532,7 +1548,7 @@ udat_setSymbols( UDateFormat *format,
U_STABLE const char* U_EXPORT2
udat_getLocaleByType(const UDateFormat *fmt,
ULocDataLocaleType type,
- UErrorCode* status);
+ UErrorCode* status);
/**
* Set a particular UDisplayContext value in the formatter, such as
@@ -1569,7 +1585,7 @@ udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* st
* @see udat_applyPatternRelative
* @internal ICU 4.2 technology preview
*/
-U_INTERNAL int32_t U_EXPORT2
+U_INTERNAL int32_t U_EXPORT2
udat_toPatternRelativeDate(const UDateFormat *fmt,
UChar *result,
int32_t resultLength,
@@ -1586,7 +1602,7 @@ udat_toPatternRelativeDate(const UDateFormat *fmt,
* @see udat_applyPatternRelative
* @internal ICU 4.2 technology preview
*/
-U_INTERNAL int32_t U_EXPORT2
+U_INTERNAL int32_t U_EXPORT2
udat_toPatternRelativeTime(const UDateFormat *fmt,
UChar *result,
int32_t resultLength,
@@ -1604,7 +1620,7 @@ udat_toPatternRelativeTime(const UDateFormat *fmt,
* @see udat_toPatternRelativeDate, udat_toPatternRelativeTime
* @internal ICU 4.2 technology preview
*/
-U_INTERNAL void U_EXPORT2
+U_INTERNAL void U_EXPORT2
udat_applyPatternRelative(UDateFormat *format,
const UChar *datePattern,
int32_t datePatternLength,
« no previous file with comments | « source/i18n/unicode/ucurr.h ('k') | source/i18n/unicode/udateintervalformat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698