ICU 67.1  67.1
udateintervalformat.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *****************************************************************************************
5 * Copyright (C) 2010-2012,2015 International Business Machines
6 * Corporation and others. All Rights Reserved.
7 *****************************************************************************************
8 */
9 
10 #ifndef UDATEINTERVALFORMAT_H
11 #define UDATEINTERVALFORMAT_H
12 
13 #include "unicode/utypes.h"
14 
15 #if !UCONFIG_NO_FORMATTING
16 
17 #include "unicode/ucal.h"
18 #include "unicode/umisc.h"
19 #include "unicode/localpointer.h"
21 
83 struct UDateIntervalFormat;
92 
117 U_STABLE UDateIntervalFormat* U_EXPORT2
118 udtitvfmt_open(const char* locale,
119  const UChar* skeleton,
120  int32_t skeletonLength,
121  const UChar* tzID,
122  int32_t tzIDLength,
123  UErrorCode* status);
124 
131 U_STABLE void U_EXPORT2
133 
145 
168 U_CAPI const UFormattedValue* U_EXPORT2
170 
177 U_CAPI void U_EXPORT2
179 
180 
181 #if U_SHOW_CPLUSPLUS_API
182 
183 U_NAMESPACE_BEGIN
184 
195 
206 
207 U_NAMESPACE_END
208 
209 #endif
210 
211 
241 U_STABLE int32_t U_EXPORT2
243  UDate fromDate,
244  UDate toDate,
245  UChar* result,
246  int32_t resultCapacity,
247  UFieldPosition* position,
248  UErrorCode* status);
249 
250 
251 #ifndef U_HIDE_DRAFT_API
252 
268 U_DRAFT void U_EXPORT2
270  const UDateIntervalFormat* formatter,
271  UDate fromDate,
272  UDate toDate,
273  UFormattedDateInterval* result,
274  UErrorCode* status);
275 
293 U_DRAFT void U_EXPORT2
295  const UDateIntervalFormat* formatter,
296  UCalendar* fromCalendar,
297  UCalendar* toCalendar,
298  UFormattedDateInterval* result,
299  UErrorCode* status);
300 #endif /* U_HIDE_DRAFT_API */
301 
302 
303 #endif /* #if !UCONFIG_NO_FORMATTING */
304 
305 #endif
udtitvfmt_formatCalendarToResult
void udtitvfmt_formatCalendarToResult(const UDateIntervalFormat *formatter, UCalendar *fromCalendar, UCalendar *toCalendar, UFormattedDateInterval *result, UErrorCode *status)
Formats a date/time range using the conventions established for the UDateIntervalFormat object.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
LocalUDateIntervalFormatPointer
"Smart pointer" class, closes a UDateIntervalFormat via udtitvfmt_close().
uformattedvalue.h
C API: Abstract operations for localized strings.
LocalUFormattedDateIntervalPointer
"Smart pointer" class, closes a UFormattedDateInterval via udtitvfmt_close().
Definition: udateintervalformat.h:194
umisc.h
C API:misc definitions.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
udtitvfmt_resultAsValue
U_CAPI const UFormattedValue * udtitvfmt_resultAsValue(const UFormattedDateInterval *uresult, UErrorCode *ec)
Returns a representation of a UFormattedDateInterval as a UFormattedValue, which can be subsequently ...
udtitvfmt_format
int32_t udtitvfmt_format(const UDateIntervalFormat *formatter, UDate fromDate, UDate toDate, UChar *result, int32_t resultCapacity, UFieldPosition *position, UErrorCode *status)
Formats a date/time range using the conventions established for the UDateIntervalFormat object.
UFormattedValue
struct UFormattedValue UFormattedValue
An abstract formatted value: a string with associated field attributes.
Definition: uformattedvalue.h:361
udtitvfmt_openResult
U_CAPI UFormattedDateInterval * udtitvfmt_openResult(UErrorCode *ec)
Creates an object to hold the result of a UDateIntervalFormat operation.
ucal.h
C API: Calendar.
UDateIntervalFormat
struct UDateIntervalFormat UDateIntervalFormat
C typedef for struct UDateIntervalFormat.
Definition: udateintervalformat.h:84
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
UFieldPosition
A struct representing a range of text containing a specific field.
Definition: umisc.h:34
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UCalendar
void * UCalendar
A calendar.
Definition: ucal.h:169
UDate
double UDate
Date and Time data type.
Definition: utypes.h:203
udtitvfmt_open
UDateIntervalFormat * udtitvfmt_open(const char *locale, const UChar *skeleton, int32_t skeletonLength, const UChar *tzID, int32_t tzIDLength, UErrorCode *status)
Open a new UDateIntervalFormat object using the predefined rules for a given locale plus a specified ...
U_DRAFT
#define U_DRAFT
This is used to declare a function as a draft public ICU C API
Definition: umachine.h:113
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
UFormattedDateInterval
struct UFormattedDateInterval UFormattedDateInterval
Opaque struct to contain the results of a UDateIntervalFormat operation.
Definition: udateintervalformat.h:91
udtitvfmt_formatToResult
void udtitvfmt_formatToResult(const UDateIntervalFormat *formatter, UDate fromDate, UDate toDate, UFormattedDateInterval *result, UErrorCode *status)
Formats a date/time range using the conventions established for the UDateIntervalFormat object.
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:376
udtitvfmt_closeResult
U_CAPI void udtitvfmt_closeResult(UFormattedDateInterval *uresult)
Releases the UFormattedDateInterval created by udtitvfmt_openResult().
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:109
udtitvfmt_close
void udtitvfmt_close(UDateIntervalFormat *formatter)
Close a UDateIntervalFormat object.