Go to the documentation of this file.
102 #ifndef U_HIDE_INTERNAL_API
156 #if U_SHOW_CPLUSPLUS_API
211 const UChar *skeleton, int32_t length,
212 UChar *bestPattern, int32_t capacity,
247 const UChar *skeleton, int32_t length,
249 UChar *bestPattern, int32_t capacity,
274 const UChar *pattern, int32_t length,
275 UChar *skeleton, int32_t capacity,
303 const UChar *pattern, int32_t length,
304 UChar *baseSkeleton, int32_t capacity,
333 const UChar *pattern, int32_t patternLength,
335 UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
361 const UChar *value, int32_t length);
394 const UChar *value, int32_t length);
436 const UChar *dtFormat, int32_t length);
464 const UChar *decimal, int32_t length);
505 const UChar *pattern, int32_t patternLength,
506 const UChar *skeleton, int32_t skeletonLength,
507 UChar *dest, int32_t destCapacity,
542 const UChar *pattern, int32_t patternLength,
543 const UChar *skeleton, int32_t skeletonLength,
545 UChar *dest, int32_t destCapacity,
587 const UChar *skeleton, int32_t skeletonLength,
UDateTimePatternGenerator * udatpg_open(const char *locale, UErrorCode *pErrorCode)
Open a generator according to a given locale.
@ UDATPG_MATCH_ALL_FIELDS_LENGTH
@ UDATPG_MATCH_MINUTE_FIELD_LENGTH
int32_t udatpg_getBestPattern(UDateTimePatternGenerator *dtpg, const UChar *skeleton, int32_t length, UChar *bestPattern, int32_t capacity, UErrorCode *pErrorCode)
Get the best pattern matching the input skeleton.
Basic definitions for ICU, for both C and C++ APIs.
UDateTimePatternConflict
Status return values from udatpg_addPattern().
@ UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD
int8_t UBool
The ICU boolean type.
void udatpg_close(UDateTimePatternGenerator *dtpg)
Close a generator.
UEnumeration * udatpg_openBaseSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Return a UEnumeration list of all the base skeletons in canonical form.
UDateTimePatternConflict udatpg_addPattern(UDateTimePatternGenerator *dtpg, const UChar *pattern, int32_t patternLength, UBool override, UChar *conflictingPattern, int32_t capacity, int32_t *pLength, UErrorCode *pErrorCode)
Adds a pattern to the generator.
const UChar * udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg, const UChar *skeleton, int32_t skeletonLength, int32_t *pLength)
Get the pattern corresponding to a given skeleton.
@ UDATPG_DAY_OF_YEAR_FIELD
UDateTimePatternField
Field number constants for udatpg_getAppendItemFormats() and similar functions.
int32_t udatpg_getSkeleton(UDateTimePatternGenerator *dtpg, const UChar *pattern, int32_t length, UChar *skeleton, int32_t capacity, UErrorCode *pErrorCode)
Get a unique skeleton from a given pattern.
@ UDATPG_WEEK_OF_YEAR_FIELD
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
UDateTimePatternGenerator * udatpg_openEmpty(UErrorCode *pErrorCode)
Open an empty generator, to be constructed with udatpg_addPattern(...) etc.
const UChar * udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg, UDateTimePatternField field, int32_t *pLength)
Getter corresponding to setAppendItemNames.
@ UDATPG_MATCH_NO_OPTIONS
@ UDATPG_MATCH_SECOND_FIELD_LENGTH
int32_t udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg, const UChar *pattern, int32_t patternLength, const UChar *skeleton, int32_t skeletonLength, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode)
Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton.
void * UDateTimePatternGenerator
Opaque type for a date/time pattern generator object.
const UChar * udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg, int32_t *pLength)
Getter corresponding to setDateTimeFormat.
void udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg, const UChar *dtFormat, int32_t length)
The DateTimeFormat is a message format pattern used to compose date and time patterns.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
void udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg, UDateTimePatternField field, const UChar *value, int32_t length)
Set the name of field, eg "era" in English for ERA.
"Smart pointer" class, closes a UDateTimePatternGenerator via udatpg_close().
@ UDATPG_FRACTIONAL_SECOND_FIELD
UDateTimePatternMatchOptions
Masks to control forcing the length of specified fields in the returned pattern to match those in the...
int32_t udatpg_replaceFieldTypesWithOptions(UDateTimePatternGenerator *dtpg, const UChar *pattern, int32_t patternLength, const UChar *skeleton, int32_t skeletonLength, UDateTimePatternMatchOptions options, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode)
Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton.
int32_t udatpg_getBestPatternWithOptions(UDateTimePatternGenerator *dtpg, const UChar *skeleton, int32_t length, UDateTimePatternMatchOptions options, UChar *bestPattern, int32_t capacity, UErrorCode *pErrorCode)
Get the best pattern matching the input skeleton.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
const UChar * udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg, UDateTimePatternField field, int32_t *pLength)
Getter corresponding to setAppendItemFormat.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
void udatpg_setAppendItemFormat(UDateTimePatternGenerator *dtpg, UDateTimePatternField field, const UChar *value, int32_t length)
An AppendItem format is a pattern used to append a field if there is no good match.
@ UDATPG_MATCH_HOUR_FIELD_LENGTH
struct UEnumeration UEnumeration
structure representing an enumeration object instance
int32_t udatpg_getBaseSkeleton(UDateTimePatternGenerator *dtpg, const UChar *pattern, int32_t length, UChar *baseSkeleton, int32_t capacity, UErrorCode *pErrorCode)
Get a unique base skeleton from a given pattern.
UEnumeration * udatpg_openSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Return a UEnumeration list of all the skeletons in canonical form.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
const UChar * udatpg_getDecimal(const UDateTimePatternGenerator *dtpg, int32_t *pLength)
Getter corresponding to setDecimal.
C API: String Enumeration.
@ UDATPG_WEEK_OF_MONTH_FIELD
void udatpg_setDecimal(UDateTimePatternGenerator *dtpg, const UChar *decimal, int32_t length)
The decimal value is used in formatting fractions of seconds.
UDateTimePatternGenerator * udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Create a copy pf a generator.