Go to the documentation of this file.
15 #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
64 #ifndef U_HIDE_DEPRECATED_API
169 #ifndef U_HIDE_DEPRECATED_API
178 #ifndef U_HIDE_DRAFT_API
196 #endif // U_HIDE_DRAFT_API
255 #ifndef U_HIDE_DRAFT_API
303 #if U_SHOW_CPLUSPLUS_API
318 #ifndef U_HIDE_DRAFT_API
368 int32_t resultCapacity,
371 #ifndef U_HIDE_DRAFT_API
437 int32_t resultCapacity,
440 #ifndef U_HIDE_DRAFT_API
507 const UChar * relativeDateString,
508 int32_t relativeDateStringLen,
509 const UChar * timeString,
510 int32_t timeStringLen,
512 int32_t resultCapacity,
Specifies that relative unit is second, e.g.
Basic definitions for ICU, for both C and C++ APIs.
Specifies that relative unit is year, e.g.
void ureldatefmt_closeResult(UFormattedRelativeDateTime *ufrdt)
Releases the UFormattedRelativeDateTime created by ureldatefmt_openResult.
Represents a number quantity, like "3" in "3 days ago".
UFormattedRelativeDateTime * ureldatefmt_openResult(UErrorCode *ec)
Creates an object to hold the result of a URelativeDateTimeFormatter operation.
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,...
URelativeDateTimeUnit
Represents the unit for formatting a relative date.
Represents a literal text string, like "tomorrow" or "days ago".
Specifies that relative unit is Wednesday, e.g.
void ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt)
Close a URelativeDateTimeFormatter object.
Abbreviations used when possible.
Specifies that relative unit is quarter, e.g.
Specifies that relative unit is month, e.g.
Specifies that relative unit is hour, e.g.
C API: Compatibility APIs for number formatting.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
URelativeDateTimeFormatterField
FieldPosition and UFieldPosition selectors for format fields defined by RelativeDateTimeFormatter.
Specifies that relative unit is day, e.g.
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,...
Specifies that relative unit is Friday, e.g.
Specifies that relative unit is Thursday, e.g.
One more than the highest normal URelativeDateTimeUnit value.
Specifies that relative unit is week, e.g.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
One more than the highest normal UDateRelativeDateTimeFormatterStyle value.
Specifies that relative unit is Tuesday, e.g.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
struct UFormattedRelativeDateTime UFormattedRelativeDateTime
Opaque struct to contain the results of a URelativeDateTimeFormatter operation.
#define U_DRAFT
This is used to declare a function as a draft public ICU C API
UDisplayContext
Display context settings.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Specifies that relative unit is Saturday, e.g.
void * UNumberFormat
A number formatter.
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...
Use the shortest possible form.
const UFormattedValue * ureldatefmt_resultAsValue(const UFormattedRelativeDateTime *ufrdt, UErrorCode *ec)
Returns a representation of a UFormattedRelativeDateTime as a UFormattedValue, which can be subsequen...
Specifies that relative unit is Sunday, e.g.
C API: Display context types (enum values)
Specifies that relative unit is minute, e.g.
UDateRelativeDateTimeFormatterStyle
The formatting style.
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.
void ureldatefmt_formatNumericToResult(const URelativeDateTimeFormatter *reldatefmt, double offset, URelativeDateTimeUnit unit, UFormattedRelativeDateTime *result, UErrorCode *status)
Format a combination of URelativeDateTimeUnit and numeric offset using a numeric style,...
struct URelativeDateTimeFormatter URelativeDateTimeFormatter
C typedef for struct URelativeDateTimeFormatter.
Specifies that relative unit is Monday, e.g.
void ureldatefmt_formatToResult(const URelativeDateTimeFormatter *reldatefmt, double offset, URelativeDateTimeUnit unit, UFormattedRelativeDateTime *result, UErrorCode *status)
Format a combination of URelativeDateTimeUnit and numeric offset using a text style if possible,...