ICU 59.1  59.1
ureldatefmt.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) 2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 *****************************************************************************************
8 */
9 
10 #ifndef URELDATEFMT_H
11 #define URELDATEFMT_H
12 
13 #include "unicode/utypes.h"
14 
15 #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
16 
17 #include "unicode/unum.h"
19 #include "unicode/localpointer.h"
20 
50 
56 
62 
63 #ifndef U_HIDE_DEPRECATED_API
64 
69 #endif /* U_HIDE_DEPRECATED_API */
71 
77 typedef enum URelativeDateTimeUnit {
168 #ifndef U_HIDE_DEPRECATED_API
169 
174 #endif /* U_HIDE_DEPRECATED_API */
176 
218 ureldatefmt_open( const char* locale,
219  UNumberFormat* nfToAdopt,
221  UDisplayContext capitalizationContext,
222  UErrorCode* status );
223 
230 U_STABLE void U_EXPORT2
232 
233 #if U_SHOW_CPLUSPLUS_API
234 
236 
247 
249 
250 #endif
251 
280 U_STABLE int32_t U_EXPORT2
282  double offset,
284  UChar* result,
285  int32_t resultCapacity,
286  UErrorCode* status);
287 
316 U_STABLE int32_t U_EXPORT2
318  double offset,
320  UChar* result,
321  int32_t resultCapacity,
322  UErrorCode* status);
323 
353 U_STABLE int32_t U_EXPORT2
355  const UChar * relativeDateString,
356  int32_t relativeDateStringLen,
357  const UChar * timeString,
358  int32_t timeStringLen,
359  UChar* result,
360  int32_t resultCapacity,
361  UErrorCode* status );
362 
363 #endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */
364 
365 #endif
URelativeDateTimeUnit
Represents the unit for formatting a relative date.
Definition: ureldatefmt.h:77
int32_t ureldatefmt_formatNumeric(const URelativeDateTimeFormatter *reldatefmt, double offset, URelativeDateTimeUnit unit, UChar *result, int32_t resultCapacity, UErrorCode *status)
Format a combination of URelativeDateTimeUnit and numeric offset using a numeric style, e.g.
void ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt)
Close a URelativeDateTimeFormatter object.
Specifies that relative unit is second, e.g.
Definition: ureldatefmt.h:125
struct URelativeDateTimeFormatter URelativeDateTimeFormatter
C typedef for struct URelativeDateTimeFormatter.
Definition: ureldatefmt.h:182
Specifies that relative unit is week, e.g.
Definition: ureldatefmt.h:101
Specifies that relative unit is month, e.g.
Definition: ureldatefmt.h:95
UDisplayContext
Display context settings.
Specifies that relative unit is Friday, e.g.
Definition: ureldatefmt.h:161
Specifies that relative unit is Monday, e.g.
Definition: ureldatefmt.h:137
Everything spelled out.
Definition: ureldatefmt.h:49
Specifies that relative unit is Saturday, e.g.
Definition: ureldatefmt.h:167
C API: Display context types (enum values)
Specifies that relative unit is minute, e.g.
Definition: ureldatefmt.h:119
Specifies that relative unit is Wednesday, e.g.
Definition: ureldatefmt.h:149
Abbreviations used when possible.
Definition: ureldatefmt.h:55
Specifies that relative unit is Sunday, e.g.
Definition: ureldatefmt.h:131
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
int32_t ureldatefmt_format(const URelativeDateTimeFormatter *reldatefmt, double offset, URelativeDateTimeUnit unit, UChar *result, int32_t resultCapacity, UErrorCode *status)
Format a combination of URelativeDateTimeUnit and numeric offset using a text style if possible...
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:496
void * UNumberFormat
A number formatter.
Definition: unum.h:137
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
URelativeDateTimeFormatter * ureldatefmt_open(const char *locale, UNumberFormat *nfToAdopt, UDateRelativeDateTimeFormatterStyle width, UDisplayContext capitalizationContext, UErrorCode *status)
Open a new URelativeDateTimeFormatter object for a given locale using the specified width and capital...
One more than the highest normal UDateRelativeDateTimeFormatterStyle value.
Definition: ureldatefmt.h:68
Specifies that relative unit is quarter, e.g.
Definition: ureldatefmt.h:89
UDateRelativeDateTimeFormatterStyle
The formatting style.
Definition: ureldatefmt.h:44
"Smart pointer" class, closes a URelativeDateTimeFormatter via ureldatefmt_close().
Specifies that relative unit is hour, e.g.
Definition: ureldatefmt.h:113
Use the shortest possible form.
Definition: ureldatefmt.h:61
Specifies that relative unit is year, e.g.
Definition: ureldatefmt.h:83
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:349
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
Specifies that relative unit is Tuesday, e.g.
Definition: ureldatefmt.h:143
Specifies that relative unit is day, e.g.
Definition: ureldatefmt.h:107
Basic definitions for ICU, for both C and C++ APIs.
Specifies that relative unit is Thursday, e.g.
Definition: ureldatefmt.h:155
One more than the highest normal URelativeDateTimeUnit value.
Definition: ureldatefmt.h:173
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
C API: NumberFormat.
int32_t ureldatefmt_combineDateAndTime(const URelativeDateTimeFormatter *reldatefmt, const UChar *relativeDateString, int32_t relativeDateStringLen, const UChar *timeString, int32_t timeStringLen, UChar *result, int32_t resultCapacity, UErrorCode *status)
Combines a relative date string and a time string in this object's locale.