ICU 78.2 78.2 |
An immutable class containing the result of a date interval formatting operation.More...
#include <dtitvfmt.h>

Public Member Functions | |
| FormattedDateInterval () | |
| Default constructor; makes an emptyFormattedDateInterval.More... | |
| FormattedDateInterval (FormattedDateInterval &&src) noexcept | |
| Move constructor: Leaves the sourceFormattedDateInterval in an undefined state.More... | |
| virtual | ~FormattedDateInterval () override |
| Destruct an instance ofFormattedDateInterval.More... | |
| FormattedDateInterval (constFormattedDateInterval &)=delete | |
| Copying not supported; use move constructor instead. | |
| FormattedDateInterval & | operator= (constFormattedDateInterval &)=delete |
| Copying not supported; use move assignment instead. | |
| FormattedDateInterval & | operator= (FormattedDateInterval &&src) noexcept |
| Move assignment: Leaves the sourceFormattedDateInterval in an undefined state.More... | |
| UnicodeString | toString (UErrorCode &status) const override |
| Returns the formatted string as a self-containedUnicodeString.More... | |
| UnicodeString | toTempString (UErrorCode &status) const override |
| Returns the formatted string as a read-only alias to memory owned by theFormattedValue.More... | |
| Appendable & | appendTo (Appendable &appendable,UErrorCode &status) const override |
| Appends the formatted string to anAppendable.More... | |
| UBool | nextPosition (ConstrainedFieldPosition &cfpos,UErrorCode &status) const override |
| Iterates over field positions in theFormattedValue.More... | |
Public Member Functions inherited fromicu::FormattedValue | |
| virtual | ~FormattedValue () |
Friends | |
| class | DateIntervalFormat |
An immutable class containing the result of a date interval formatting operation.
Instances of this class are immutable and thread-safe.
When callingnextPosition(): 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 thenextPosition() iterator.
Not intended for public subclassing.
Definition at line59 of filedtitvfmt.h.
| inline |
Default constructor; makes an emptyFormattedDateInterval.
Definition at line65 of filedtitvfmt.h.
| noexcept |
Move constructor: Leaves the sourceFormattedDateInterval in an undefined state.
| overridevirtual |
Destruct an instance ofFormattedDateInterval.
| overridevirtual |
Appends the formatted string to anAppendable.
| appendable | TheAppendable to which to append the string output. |
| status | Set if an error occurs. |
Implementsicu::FormattedValue.
| overridevirtual |
Iterates over field positions in theFormattedValue.
This lets you determine the position of specific types of substrings, like a month or a decimal separator.
To loop over all field positions:
ConstrainedFieldPosition cfpos;while (fmtval.nextPosition(cfpos, status)) { // handle the field position; get information from cfpos}| cfpos | The object used for iteration state. This can provide constraints to iterate over only one specific category or field; seeConstrainedFieldPosition::constrainCategory andConstrainedFieldPosition::constrainField. |
| status | Set if an error occurs. |
Implementsicu::FormattedValue.
| noexcept |
Move assignment: Leaves the sourceFormattedDateInterval in an undefined state.
| overridevirtual |
Returns the formatted string as a self-containedUnicodeString.
If you need the string within the current scope only, considertoTempString.
| status | Set if an error occurs. |
Implementsicu::FormattedValue.
| overridevirtual |
Returns the formatted string as a read-only alias to memory owned by theFormattedValue.
The return value is valid only as long as thisFormattedValue is present and unchanged in memory. If you need the string outside the current scope, considertoString.
The buffer returned by callingUnicodeString::getBuffer() on the return value is guaranteed to be NUL-terminated.
| status | Set if an error occurs. |
Implementsicu::FormattedValue.