diff options
author | mcheshkov <mcheshkov@yandex-team.ru> | 2022-02-10 16:46:16 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:16 +0300 |
commit | 1312621288956f199a5bd5342b0133d4395fa725 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/icu/include/unicode/dtitvfmt.h | |
parent | e9d19cec64684c9c1e6b0c98297e5b895cf904fe (diff) | |
download | ydb-1312621288956f199a5bd5342b0133d4395fa725.tar.gz |
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/icu/include/unicode/dtitvfmt.h')
-rw-r--r-- | contrib/libs/icu/include/unicode/dtitvfmt.h | 292 |
1 files changed, 146 insertions, 146 deletions
diff --git a/contrib/libs/icu/include/unicode/dtitvfmt.h b/contrib/libs/icu/include/unicode/dtitvfmt.h index 40d6591688..4e4d712b4f 100644 --- a/contrib/libs/icu/include/unicode/dtitvfmt.h +++ b/contrib/libs/icu/include/unicode/dtitvfmt.h @@ -1,4 +1,4 @@ -// © 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************************** * Copyright (C) 2008-2016, International Business Machines Corporation and @@ -16,8 +16,8 @@ #include "unicode/utypes.h" -#if U_SHOW_CPLUSPLUS_API - +#if U_SHOW_CPLUSPLUS_API + /** * \file * \brief C++ API: Format and parse date interval in a language-independent manner. @@ -30,87 +30,87 @@ #include "unicode/dtintrv.h" #include "unicode/dtitvinf.h" #include "unicode/dtptngen.h" -#include "unicode/formattedvalue.h" +#include "unicode/formattedvalue.h" U_NAMESPACE_BEGIN -class FormattedDateIntervalData; -class DateIntervalFormat; +class FormattedDateIntervalData; +class DateIntervalFormat; + +/** + * An immutable class containing the result of a date interval formatting operation. + * + * Instances of this class are immutable and thread-safe. + * + * When calling nextPosition(): + * The fields are returned from left to right. The special field category + * UFIELD_CATEGORY_DATE_INTERVAL_SPAN is used to indicate which datetime + * primitives came from which arguments: 0 means fromCalendar, and 1 means + * toCalendar. The span category will always occur before the + * corresponding fields in UFIELD_CATEGORY_DATE + * in the nextPosition() iterator. + * + * Not intended for public subclassing. + * + * @stable ICU 64 + */ +class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue { + public: + /** + * Default constructor; makes an empty FormattedDateInterval. + * @stable ICU 64 + */ + FormattedDateInterval() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {} + + /** + * Move constructor: Leaves the source FormattedDateInterval in an undefined state. + * @stable ICU 64 + */ + FormattedDateInterval(FormattedDateInterval&& src) U_NOEXCEPT; + + /** + * Destruct an instance of FormattedDateInterval. + * @stable ICU 64 + */ + virtual ~FormattedDateInterval() U_OVERRIDE; + + /** Copying not supported; use move constructor instead. */ + FormattedDateInterval(const FormattedDateInterval&) = delete; + + /** Copying not supported; use move assignment instead. */ + FormattedDateInterval& operator=(const FormattedDateInterval&) = delete; + + /** + * Move assignment: Leaves the source FormattedDateInterval in an undefined state. + * @stable ICU 64 + */ + FormattedDateInterval& operator=(FormattedDateInterval&& src) U_NOEXCEPT; + + /** @copydoc FormattedValue::toString() */ + UnicodeString toString(UErrorCode& status) const U_OVERRIDE; + + /** @copydoc FormattedValue::toTempString() */ + UnicodeString toTempString(UErrorCode& status) const U_OVERRIDE; + + /** @copydoc FormattedValue::appendTo() */ + Appendable &appendTo(Appendable& appendable, UErrorCode& status) const U_OVERRIDE; + + /** @copydoc FormattedValue::nextPosition() */ + UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const U_OVERRIDE; + + private: + FormattedDateIntervalData *fData; + UErrorCode fErrorCode; + explicit FormattedDateInterval(FormattedDateIntervalData *results) + : fData(results), fErrorCode(U_ZERO_ERROR) {} + explicit FormattedDateInterval(UErrorCode errorCode) + : fData(nullptr), fErrorCode(errorCode) {} + friend class DateIntervalFormat; +}; + /** - * An immutable class containing the result of a date interval formatting operation. - * - * Instances of this class are immutable and thread-safe. - * - * When calling nextPosition(): - * The fields are returned from left to right. The special field category - * UFIELD_CATEGORY_DATE_INTERVAL_SPAN is used to indicate which datetime - * primitives came from which arguments: 0 means fromCalendar, and 1 means - * toCalendar. The span category will always occur before the - * corresponding fields in UFIELD_CATEGORY_DATE - * in the nextPosition() iterator. - * - * Not intended for public subclassing. - * - * @stable ICU 64 - */ -class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue { - public: - /** - * Default constructor; makes an empty FormattedDateInterval. - * @stable ICU 64 - */ - FormattedDateInterval() : fData(nullptr), fErrorCode(U_INVALID_STATE_ERROR) {} - - /** - * Move constructor: Leaves the source FormattedDateInterval in an undefined state. - * @stable ICU 64 - */ - FormattedDateInterval(FormattedDateInterval&& src) U_NOEXCEPT; - - /** - * Destruct an instance of FormattedDateInterval. - * @stable ICU 64 - */ - virtual ~FormattedDateInterval() U_OVERRIDE; - - /** Copying not supported; use move constructor instead. */ - FormattedDateInterval(const FormattedDateInterval&) = delete; - - /** Copying not supported; use move assignment instead. */ - FormattedDateInterval& operator=(const FormattedDateInterval&) = delete; - - /** - * Move assignment: Leaves the source FormattedDateInterval in an undefined state. - * @stable ICU 64 - */ - FormattedDateInterval& operator=(FormattedDateInterval&& src) U_NOEXCEPT; - - /** @copydoc FormattedValue::toString() */ - UnicodeString toString(UErrorCode& status) const U_OVERRIDE; - - /** @copydoc FormattedValue::toTempString() */ - UnicodeString toTempString(UErrorCode& status) const U_OVERRIDE; - - /** @copydoc FormattedValue::appendTo() */ - Appendable &appendTo(Appendable& appendable, UErrorCode& status) const U_OVERRIDE; - - /** @copydoc FormattedValue::nextPosition() */ - UBool nextPosition(ConstrainedFieldPosition& cfpos, UErrorCode& status) const U_OVERRIDE; - - private: - FormattedDateIntervalData *fData; - UErrorCode fErrorCode; - explicit FormattedDateInterval(FormattedDateIntervalData *results) - : fData(results), fErrorCode(U_ZERO_ERROR) {} - explicit FormattedDateInterval(UErrorCode errorCode) - : fData(nullptr), fErrorCode(errorCode) {} - friend class DateIntervalFormat; -}; - - -/** * DateIntervalFormat is a class for formatting and parsing date * intervals in a language-independent manner. * Only formatting is supported, parsing is not supported. @@ -172,12 +172,12 @@ class U_I18N_API FormattedDateInterval : public UMemory, public FormattedValue { * * <P> * The calendar fields we support for interval formatting are: - * year, month, date, day-of-week, am-pm, hour, hour-of-day, minute, second, - * and millisecond. + * year, month, date, day-of-week, am-pm, hour, hour-of-day, minute, second, + * and millisecond. * (though we do not currently have specific intervalFormat date for skeletons - * with seconds and millisecond). + * with seconds and millisecond). * Those calendar fields can be defined in the following order: - * year > month > date > hour (in day) > minute > second > millisecond + * 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. @@ -433,7 +433,7 @@ public: * @return A copy of the object. * @stable ICU 4.0 */ - virtual DateIntervalFormat* clone() const; + virtual DateIntervalFormat* clone() const; /** * Return true if the given Format objects are semantically equal. Objects @@ -502,19 +502,19 @@ public: FieldPosition& fieldPosition, UErrorCode& status) const ; - /** - * Format a DateInterval to produce a FormattedDateInterval. - * - * The FormattedDateInterval exposes field information about the formatted string. - * - * @param dtInterval DateInterval to be formatted. - * @param status Set if an error occurs. - * @return A FormattedDateInterval containing the format result. - * @stable ICU 64 - */ - FormattedDateInterval formatToValue( - const DateInterval& dtInterval, - UErrorCode& status) const; + /** + * Format a DateInterval to produce a FormattedDateInterval. + * + * The FormattedDateInterval exposes field information about the formatted string. + * + * @param dtInterval DateInterval to be formatted. + * @param status Set if an error occurs. + * @return A FormattedDateInterval containing the format result. + * @stable ICU 64 + */ + FormattedDateInterval formatToValue( + const DateInterval& dtInterval, + UErrorCode& status) const; /** * Format 2 Calendars to produce a string. @@ -546,27 +546,27 @@ public: UErrorCode& status) const ; /** - * Format 2 Calendars to produce a FormattedDateInterval. - * - * The FormattedDateInterval exposes field information about the formatted string. - * - * Note: "fromCalendar" and "toCalendar" are not const, - * since calendar is not const in SimpleDateFormat::format(Calendar&), - * - * @param fromCalendar calendar set to the from date in date interval - * to be formatted into date interval string - * @param toCalendar calendar set to the to date in date interval - * to be formatted into date interval string - * @param status Set if an error occurs. - * @return A FormattedDateInterval containing the format result. - * @stable ICU 64 - */ - FormattedDateInterval formatToValue( - Calendar& fromCalendar, - Calendar& toCalendar, - UErrorCode& status) const; - - /** + * Format 2 Calendars to produce a FormattedDateInterval. + * + * The FormattedDateInterval exposes field information about the formatted string. + * + * Note: "fromCalendar" and "toCalendar" are not const, + * since calendar is not const in SimpleDateFormat::format(Calendar&), + * + * @param fromCalendar calendar set to the from date in date interval + * to be formatted into date interval string + * @param toCalendar calendar set to the to date in date interval + * to be formatted into date interval string + * @param status Set if an error occurs. + * @return A FormattedDateInterval containing the format result. + * @stable ICU 64 + */ + FormattedDateInterval formatToValue( + Calendar& fromCalendar, + Calendar& toCalendar, + UErrorCode& status) const; + + /** * Date interval parsing is not supported. Please do not use. * <P> * This method should handle parsing of @@ -775,14 +775,14 @@ private: * Below are for generating interval patterns local to the formatter */ - /** Like fallbackFormat, but only formats the range part of the fallback. */ - void fallbackFormatRange( - Calendar& fromCalendar, - Calendar& toCalendar, - UnicodeString& appendTo, - int8_t& firstIndex, - FieldPositionHandler& fphandler, - UErrorCode& status) const; + /** Like fallbackFormat, but only formats the range part of the fallback. */ + void fallbackFormatRange( + Calendar& fromCalendar, + Calendar& toCalendar, + UnicodeString& appendTo, + int8_t& firstIndex, + FieldPositionHandler& fphandler, + UErrorCode& status) const; /** * Format 2 Calendars using fall-back interval pattern @@ -800,8 +800,8 @@ private: * (any difference is in ampm/hours or below) * @param appendTo Output parameter to receive result. * Result is appended to existing contents. - * @param firstIndex See formatImpl for more information. - * @param fphandler See formatImpl for more information. + * @param firstIndex See formatImpl for more information. + * @param fphandler See formatImpl for more information. * @param status output param set to success/failure code on exit * @return Reference to 'appendTo' parameter. * @internal (private) @@ -810,8 +810,8 @@ private: Calendar& toCalendar, UBool fromToOnSameDay, UnicodeString& appendTo, - int8_t& firstIndex, - FieldPositionHandler& fphandler, + int8_t& firstIndex, + FieldPositionHandler& fphandler, UErrorCode& status) const; @@ -1075,11 +1075,11 @@ private: * to be formatted into date interval string * @param appendTo Output parameter to receive result. * Result is appended to existing contents. - * @param firstIndex 0 if the first output date is fromCalendar; - * 1 if it corresponds to toCalendar; - * -1 if there is only one date printed. - * @param fphandler Handler for field position information. - * The fields will be from the UDateFormatField enum. + * @param firstIndex 0 if the first output date is fromCalendar; + * 1 if it corresponds to toCalendar; + * -1 if there is only one date printed. + * @param fphandler Handler for field position information. + * The fields will be from the UDateFormatField enum. * @param status Output param filled with success/failure status. * Caller needs to make sure it is SUCCESS * at the function entrance @@ -1089,20 +1089,20 @@ private: UnicodeString& formatImpl(Calendar& fromCalendar, Calendar& toCalendar, UnicodeString& appendTo, - int8_t& firstIndex, - FieldPositionHandler& fphandler, + int8_t& firstIndex, + FieldPositionHandler& fphandler, UErrorCode& status) const ; - /** Version of formatImpl for DateInterval. */ - UnicodeString& formatIntervalImpl(const DateInterval& dtInterval, - UnicodeString& appendTo, - int8_t& firstIndex, - FieldPositionHandler& fphandler, - UErrorCode& status) const; + /** Version of formatImpl for DateInterval. */ + UnicodeString& formatIntervalImpl(const DateInterval& dtInterval, + UnicodeString& appendTo, + int8_t& firstIndex, + FieldPositionHandler& fphandler, + UErrorCode& status) const; + - // from calendar field to pattern letter - static const char16_t fgCalendarFieldToPatternLetter[]; + static const char16_t fgCalendarFieldToPatternLetter[]; /** @@ -1148,7 +1148,7 @@ U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ -#endif /* U_SHOW_CPLUSPLUS_API */ - +#endif /* U_SHOW_CPLUSPLUS_API */ + #endif // _DTITVFMT_H__ //eof |