ICU 4.2.1
 All Data Structures 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-2009, 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 
45 
52 typedef enum UDateTimePatternField {
88 
103 
113 udatpg_open(const char *locale, UErrorCode *pErrorCode);
114 
123 udatpg_openEmpty(UErrorCode *pErrorCode);
124 
130 U_DRAFT void U_EXPORT2
132 
142 udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
143 
169  const UChar *skeleton, int32_t length,
170  UChar *bestPattern, int32_t capacity,
171  UErrorCode *pErrorCode);
172 
195  const UChar *pattern, int32_t length,
196  UChar *skeleton, int32_t capacity,
197  UErrorCode *pErrorCode);
198 
224  const UChar *pattern, int32_t length,
225  UChar *baseSkeleton, int32_t capacity,
226  UErrorCode *pErrorCode);
227 
254  const UChar *pattern, int32_t patternLength,
255  UBool override,
256  UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
257  UErrorCode *pErrorCode);
258 
279 U_DRAFT void U_EXPORT2
281  UDateTimePatternField field,
282  const UChar *value, int32_t length);
283 
294 U_DRAFT const UChar * U_EXPORT2
296  UDateTimePatternField field,
297  int32_t *pLength);
298 
312 U_DRAFT void U_EXPORT2
314  UDateTimePatternField field,
315  const UChar *value, int32_t length);
316 
327 U_DRAFT const UChar * U_EXPORT2
329  UDateTimePatternField field,
330  int32_t *pLength);
331 
353 U_DRAFT void U_EXPORT2
355  const UChar *dtFormat, int32_t length);
356 
364 U_DRAFT const UChar * U_EXPORT2
366  int32_t *pLength);
367 
381 U_DRAFT void U_EXPORT2
383  const UChar *decimal, int32_t length);
384 
393 U_DRAFT const UChar * U_EXPORT2
395  int32_t *pLength);
396 
424  const UChar *pattern, int32_t patternLength,
425  const UChar *skeleton, int32_t skeletonLength,
426  UChar *dest, int32_t destCapacity,
427  UErrorCode *pErrorCode);
428 
442 
455 
466 U_DRAFT const UChar * U_EXPORT2
468  const UChar *skeleton, int32_t skeletonLength,
469  int32_t *pLength);
470 
471 #endif
const UChar * udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg, UDateTimePatternField field, int32_t *pLength)
Getter corresponding to setAppendItemFormat.
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.
const UChar * udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg, UDateTimePatternField field, int32_t *pLength)
Getter corresponding to setAppendItemNames.
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.
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:38
void udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg, const UChar *dtFormat, int32_t length)
The date time format is a message format pattern used to compose date and time patterns.
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.
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.
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.
void udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg, UDateTimePatternField field, const UChar *value, int32_t length)
Set the name of field, eg "era" in English for ERA.
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.
UDateTimePatternGenerator * udatpg_open(const char *locale, UErrorCode *pErrorCode)
Open a generator according to a given locale.
#define U_EXPORT2
Definition: platform.h:338
UDateTimePatternConflict
Status return values from udatpg_addPattern().
Definition: udatpg.h:93
UEnumeration * udatpg_openSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Return a UEnumeration list of all the skeletons in canonical form.
UDateTimePatternGenerator * udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Create a copy pf a generator.
uint16_t UChar
Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
Definition: umachine.h:299
void udatpg_close(UDateTimePatternGenerator *dtpg)
Close a generator.
UDateTimePatternField
Field number constants for udatpg_getAppendItemFormats() and similar functions.
Definition: udatpg.h:52
void * UDateTimePatternGenerator
Opaque type for a date/time pattern generator object.
Definition: udatpg.h:44
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:593
UEnumeration * udatpg_openBaseSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode)
Return a UEnumeration list of all the base skeletons in canonical form.
UDateTimePatternGenerator * udatpg_openEmpty(UErrorCode *pErrorCode)
Open an empty generator, to be constructed with udatpg_addPattern(...) etc.
C API: String Enumeration.
void udatpg_setDecimal(UDateTimePatternGenerator *dtpg, const UChar *decimal, int32_t length)
The decimal value is used in formatting fractions of seconds.
const UChar * udatpg_getDecimal(const UDateTimePatternGenerator *dtpg, int32_t *pLength)
Getter corresponding to setDecimal.
Basic definitions for ICU, for both C and C++ APIs.
const UChar * udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg, int32_t *pLength)
Getter corresponding to setDateTimeFormat.
#define U_DRAFT
This is used to declare a function as a draft public ICU C API.
Definition: umachine.h:119
signed int int32_t
Define 64 bit limits.
Definition: pwin32.h:143
const UChar * udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg, const UChar *skeleton, int32_t skeletonLength, int32_t *pLength)
Get the pattern corresponding to a given skeleton.
int8_t UBool
The ICU boolean type.
Definition: umachine.h:208