ICU 54.1 54.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
udatpg.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 *
4 * Copyright (C) 2007-2012, 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"
22 #include "unicode/localpointer.h"
23
45 typedef void *UDateTimePatternGenerator;
46
53 typedef enum UDateTimePatternField {
55 UDATPG_ERA_FIELD,
57 UDATPG_YEAR_FIELD,
59 UDATPG_QUARTER_FIELD,
61 UDATPG_MONTH_FIELD,
63 UDATPG_WEEK_OF_YEAR_FIELD,
65 UDATPG_WEEK_OF_MONTH_FIELD,
67 UDATPG_WEEKDAY_FIELD,
69 UDATPG_DAY_OF_YEAR_FIELD,
71 UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD,
73 UDATPG_DAY_FIELD,
75 UDATPG_DAYPERIOD_FIELD,
77 UDATPG_HOUR_FIELD,
79 UDATPG_MINUTE_FIELD,
81 UDATPG_SECOND_FIELD,
83 UDATPG_FRACTIONAL_SECOND_FIELD,
85 UDATPG_ZONE_FIELD,
87 UDATPG_FIELD_COUNT
88 } UDateTimePatternField;
89
97 typedef enum UDateTimePatternMatchOptions {
99 UDATPG_MATCH_NO_OPTIONS = 0,
101 UDATPG_MATCH_HOUR_FIELD_LENGTH = 1 << UDATPG_HOUR_FIELD,
102 #ifndef U_HIDE_INTERNAL_API
103
104 UDATPG_MATCH_MINUTE_FIELD_LENGTH = 1 << UDATPG_MINUTE_FIELD,
106 UDATPG_MATCH_SECOND_FIELD_LENGTH = 1 << UDATPG_SECOND_FIELD,
107 #endif /* U_HIDE_INTERNAL_API */
108
109 UDATPG_MATCH_ALL_FIELDS_LENGTH = (1 << UDATPG_FIELD_COUNT) - 1
110 } UDateTimePatternMatchOptions;
111
116 typedef enum UDateTimePatternConflict {
118 UDATPG_NO_CONFLICT,
120 UDATPG_BASE_CONFLICT,
122 UDATPG_CONFLICT,
124 UDATPG_CONFLICT_COUNT
125 } UDateTimePatternConflict;
126
135 U_STABLE UDateTimePatternGenerator * U_EXPORT2
136 udatpg_open(const char *locale, UErrorCode *pErrorCode);
137
145 U_STABLE UDateTimePatternGenerator * U_EXPORT2
146 udatpg_openEmpty(UErrorCode *pErrorCode);
147
153 U_STABLE void U_EXPORT2
154 udatpg_close(UDateTimePatternGenerator *dtpg);
155
156 #if U_SHOW_CPLUSPLUS_API
157
158 U_NAMESPACE_BEGIN
159
169 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateTimePatternGeneratorPointer, UDateTimePatternGenerator, udatpg_close);
170
171 U_NAMESPACE_END
172
173 #endif
174
183 U_STABLE UDateTimePatternGenerator * U_EXPORT2
184 udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
185
209 U_STABLE int32_t U_EXPORT2
210 udatpg_getBestPattern(UDateTimePatternGenerator *dtpg,
211 const UChar *skeleton, int32_t length,
212 UChar *bestPattern, int32_t capacity,
213 UErrorCode *pErrorCode);
214
245 U_STABLE int32_t U_EXPORT2
246 udatpg_getBestPatternWithOptions(UDateTimePatternGenerator *dtpg,
247 const UChar *skeleton, int32_t length,
248 UDateTimePatternMatchOptions options,
249 UChar *bestPattern, int32_t capacity,
250 UErrorCode *pErrorCode);
251
272 U_STABLE int32_t U_EXPORT2
273 udatpg_getSkeleton(UDateTimePatternGenerator *dtpg,
274 const UChar *pattern, int32_t length,
275 UChar *skeleton, int32_t capacity,
276 UErrorCode *pErrorCode);
277
301 U_STABLE int32_t U_EXPORT2
302 udatpg_getBaseSkeleton(UDateTimePatternGenerator *dtpg,
303 const UChar *pattern, int32_t length,
304 UChar *baseSkeleton, int32_t capacity,
305 UErrorCode *pErrorCode);
306
331 U_STABLE UDateTimePatternConflict U_EXPORT2
332 udatpg_addPattern(UDateTimePatternGenerator *dtpg,
333 const UChar *pattern, int32_t patternLength,
334 UBool override,
335 UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
336 UErrorCode *pErrorCode);
337
358 U_STABLE void U_EXPORT2
359 udatpg_setAppendItemFormat(UDateTimePatternGenerator *dtpg,
360 UDateTimePatternField field,
361 const UChar *value, int32_t length);
362
373 U_STABLE const UChar * U_EXPORT2
374 udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg,
375 UDateTimePatternField field,
376 int32_t *pLength);
377
391 U_STABLE void U_EXPORT2
392 udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg,
393 UDateTimePatternField field,
394 const UChar *value, int32_t length);
395
406 U_STABLE const UChar * U_EXPORT2
407 udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg,
408 UDateTimePatternField field,
409 int32_t *pLength);
410
432 U_STABLE void U_EXPORT2
433 udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg,
434 const UChar *dtFormat, int32_t length);
435
443 U_STABLE const UChar * U_EXPORT2
444 udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg,
445 int32_t *pLength);
446
460 U_STABLE void U_EXPORT2
461 udatpg_setDecimal(UDateTimePatternGenerator *dtpg,
462 const UChar *decimal, int32_t length);
463
472 U_STABLE const UChar * U_EXPORT2
473 udatpg_getDecimal(const UDateTimePatternGenerator *dtpg,
474 int32_t *pLength);
475
501 U_STABLE int32_t U_EXPORT2
502 udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg,
503 const UChar *pattern, int32_t patternLength,
504 const UChar *skeleton, int32_t skeletonLength,
505 UChar *dest, int32_t destCapacity,
506 UErrorCode *pErrorCode);
507
538 U_STABLE int32_t U_EXPORT2
539 udatpg_replaceFieldTypesWithOptions(UDateTimePatternGenerator *dtpg,
540 const UChar *pattern, int32_t patternLength,
541 const UChar *skeleton, int32_t skeletonLength,
542 UDateTimePatternMatchOptions options,
543 UChar *dest, int32_t destCapacity,
544 UErrorCode *pErrorCode);
545
557 U_STABLE UEnumeration * U_EXPORT2
558 udatpg_openSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
559
570 U_STABLE UEnumeration * U_EXPORT2
571 udatpg_openBaseSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
572
583 U_STABLE const UChar * U_EXPORT2
584 udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
585 const UChar *skeleton, int32_t skeletonLength,
586 int32_t *pLength);
587
588 #endif