ICU 57.1 57.1
udatpg.h
Go to the documentation of this file.
1/*
2*******************************************************************************
3*
4* Copyright (C) 2007-2015, International Business Machines
5* Corporation and others. All Rights Reserved.
6*
7*******************************************************************************
8* file name: udatpg.h
9* encoding: US-ASCII
10* tab size: 8 (not used)
11* indentation:4
12*
13* created on: 2007jul30
14* created by: Markus W. Scherer
15*/
16
17#ifndef __UDATPG_H__
18#define __UDATPG_H__
19
20#include "unicode/utypes.h"
21#include "unicode/uenum.h"
23
46
89
102#ifndef U_HIDE_INTERNAL_API
107#endif /* U_HIDE_INTERNAL_API */
111
126
136udatpg_open(const char *locale, UErrorCode *pErrorCode);
137
147
153U_STABLE void U_EXPORT2
155
156#if U_SHOW_CPLUSPLUS_API
157
159
170
172
173#endif
174
185
209U_STABLE int32_t U_EXPORT2
211 const UChar *skeleton, int32_t length,
212 UChar *bestPattern, int32_t capacity,
213 UErrorCode *pErrorCode);
214
245U_STABLE int32_t U_EXPORT2
247 const UChar *skeleton, int32_t length,
249 UChar *bestPattern, int32_t capacity,
250 UErrorCode *pErrorCode);
251
273U_STABLE int32_t U_EXPORT2
275 const UChar *pattern, int32_t length,
276 UChar *skeleton, int32_t capacity,
277 UErrorCode *pErrorCode);
278
303U_STABLE int32_t U_EXPORT2
305 const UChar *pattern, int32_t length,
306 UChar *baseSkeleton, int32_t capacity,
307 UErrorCode *pErrorCode);
308
335 const UChar *pattern, int32_t patternLength,
336 UBool override,
337 UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
338 UErrorCode *pErrorCode);
339
360U_STABLE void U_EXPORT2
363 const UChar *value, int32_t length);
364
375U_STABLE const UChar * U_EXPORT2
378 int32_t *pLength);
379
393U_STABLE void U_EXPORT2
396 const UChar *value, int32_t length);
397
408U_STABLE const UChar * U_EXPORT2
411 int32_t *pLength);
412
436U_STABLE void U_EXPORT2
438 const UChar *dtFormat, int32_t length);
439
447U_STABLE const UChar * U_EXPORT2
449 int32_t *pLength);
450
464U_STABLE void U_EXPORT2
466 const UChar *decimal, int32_t length);
467
476U_STABLE const UChar * U_EXPORT2
478 int32_t *pLength);
479
505U_STABLE int32_t U_EXPORT2
507 const UChar *pattern, int32_t patternLength,
508 const UChar *skeleton, int32_t skeletonLength,
509 UChar *dest, int32_t destCapacity,
510 UErrorCode *pErrorCode);
511
542U_STABLE int32_t U_EXPORT2
544 const UChar *pattern, int32_t patternLength,
545 const UChar *skeleton, int32_t skeletonLength,
547 UChar *dest, int32_t destCapacity,
548 UErrorCode *pErrorCode);
549
561U_STABLE UEnumeration * U_EXPORT2
563
574U_STABLE UEnumeration * U_EXPORT2
576
587U_STABLE const UChar * U_EXPORT2
589 const UChar *skeleton, int32_t skeletonLength,
590 int32_t *pLength);
591
592#endif
"Smart pointer" class, closes a UDateTimePatternGenerator via udatpg_close().
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:539
void udatpg_close(UDateTimePatternGenerator *dtpg)
Close a generator.
UDateTimePatternGenerator * udatpg_open(const char *locale, UErrorCode *pErrorCode)
Open a generator according to a given locale.
void * UDateTimePatternGenerator
Opaque type for a date/time pattern generator object.
Definition: udatpg.h:45
const UChar * udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg, const UChar *skeleton, int32_t skeletonLength, int32_t *pLength)
Get the pattern corresponding to a given 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.
void udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg, UDateTimePatternField field, const UChar *value, int32_t length)
Set the name of field, eg "era" in English for ERA.
int32_t udatpg_getBaseSkeleton(UDateTimePatternGenerator *unusedDtpg, const UChar *pattern, int32_t length, UChar *baseSkeleton, int32_t capacity, UErrorCode *pErrorCode)
Get a unique base skeleton from a given pattern.
void udatpg_setDecimal(UDateTimePatternGenerator *dtpg, const UChar *decimal, int32_t length)
The decimal value is used in formatting fractions of seconds.
const UChar * udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg, UDateTimePatternField field, int32_t *pLength)
Getter corresponding to setAppendItemNames.
const UChar * udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg, UDateTimePatternField field, int32_t *pLength)
Getter corresponding to setAppendItemFormat.
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.
int32_t udatpg_getSkeleton(UDateTimePatternGenerator *unusedDtpg, const UChar *pattern, int32_t length, UChar *skeleton, int32_t capacity, UErrorCode *pErrorCode)
Get a unique skeleton from a given pattern.
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.
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.
UDateTimePatternGenerator * udatpg_openEmpty(UErrorCode *pErrorCode)
Open an empty generator, to be constructed with udatpg_addPattern(...) etc.
UDateTimePatternConflict
Status return values from udatpg_addPattern().
Definition: udatpg.h:116
@ UDATPG_NO_CONFLICT
Definition: udatpg.h:118
@ UDATPG_BASE_CONFLICT
Definition: udatpg.h:120
@ UDATPG_CONFLICT
Definition: udatpg.h:122
@ UDATPG_CONFLICT_COUNT
Definition: udatpg.h:124
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_getDateTimeFormat(const UDateTimePatternGenerator *dtpg, int32_t *pLength)
Getter corresponding to setDateTimeFormat.
UDateTimePatternMatchOptions
Masks to control forcing the length of specified fields in the returned pattern to match those in the...
Definition: udatpg.h:97
@ UDATPG_MATCH_HOUR_FIELD_LENGTH
Definition: udatpg.h:101
@ UDATPG_MATCH_MINUTE_FIELD_LENGTH
Definition: udatpg.h:104
@ UDATPG_MATCH_SECOND_FIELD_LENGTH
Definition: udatpg.h:106
@ UDATPG_MATCH_NO_OPTIONS
Definition: udatpg.h:99
@ UDATPG_MATCH_ALL_FIELDS_LENGTH
Definition: udatpg.h:109
const UChar * udatpg_getDecimal(const UDateTimePatternGenerator *dtpg, int32_t *pLength)
Getter corresponding to setDecimal.
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.
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.
UDateTimePatternGenerator * udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Create a copy pf a generator.
UEnumeration * udatpg_openSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Return a UEnumeration list of all the skeletons in canonical form.
UDateTimePatternField
Field number constants for udatpg_getAppendItemFormats() and similar functions.
Definition: udatpg.h:53
@ UDATPG_WEEK_OF_YEAR_FIELD
Definition: udatpg.h:63
@ UDATPG_DAY_OF_YEAR_FIELD
Definition: udatpg.h:69
@ UDATPG_QUARTER_FIELD
Definition: udatpg.h:59
@ UDATPG_WEEKDAY_FIELD
Definition: udatpg.h:67
@ UDATPG_DAYPERIOD_FIELD
Definition: udatpg.h:75
@ UDATPG_MONTH_FIELD
Definition: udatpg.h:61
@ UDATPG_DAY_FIELD
Definition: udatpg.h:73
@ UDATPG_SECOND_FIELD
Definition: udatpg.h:81
@ UDATPG_ZONE_FIELD
Definition: udatpg.h:85
@ UDATPG_FRACTIONAL_SECOND_FIELD
Definition: udatpg.h:83
@ UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD
Definition: udatpg.h:71
@ UDATPG_YEAR_FIELD
Definition: udatpg.h:57
@ UDATPG_FIELD_COUNT
Definition: udatpg.h:87
@ UDATPG_WEEK_OF_MONTH_FIELD
Definition: udatpg.h:65
@ UDATPG_HOUR_FIELD
Definition: udatpg.h:77
@ UDATPG_ERA_FIELD
Definition: udatpg.h:55
@ UDATPG_MINUTE_FIELD
Definition: udatpg.h:79
C API: String Enumeration.
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:39
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:312
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:476
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129