ICU 4.8.1.1  4.8.1.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-2010, 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 
46 
53 typedef enum UDateTimePatternField {
89 
109 
124 
134 udatpg_open(const char *locale, UErrorCode *pErrorCode);
135 
144 udatpg_openEmpty(UErrorCode *pErrorCode);
145 
151 U_STABLE void U_EXPORT2
153 
154 #if U_SHOW_CPLUSPLUS_API
155 
157 
167 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDateTimePatternGeneratorPointer, UDateTimePatternGenerator, udatpg_close);
168 
170 
171 #endif
172 
182 udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
183 
207 U_STABLE int32_t U_EXPORT2
209  const UChar *skeleton, int32_t length,
210  UChar *bestPattern, int32_t capacity,
211  UErrorCode *pErrorCode);
212 
243 U_STABLE int32_t U_EXPORT2
245  const UChar *skeleton, int32_t length,
247  UChar *bestPattern, int32_t capacity,
248  UErrorCode *pErrorCode);
249 
270 U_STABLE int32_t U_EXPORT2
272  const UChar *pattern, int32_t length,
273  UChar *skeleton, int32_t capacity,
274  UErrorCode *pErrorCode);
275 
299 U_STABLE int32_t U_EXPORT2
301  const UChar *pattern, int32_t length,
302  UChar *baseSkeleton, int32_t capacity,
303  UErrorCode *pErrorCode);
304 
331  const UChar *pattern, int32_t patternLength,
332  UBool override,
333  UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
334  UErrorCode *pErrorCode);
335 
356 U_STABLE void U_EXPORT2
358  UDateTimePatternField field,
359  const UChar *value, int32_t length);
360 
371 U_STABLE const UChar * U_EXPORT2
373  UDateTimePatternField field,
374  int32_t *pLength);
375 
389 U_STABLE void U_EXPORT2
391  UDateTimePatternField field,
392  const UChar *value, int32_t length);
393 
404 U_STABLE const UChar * U_EXPORT2
406  UDateTimePatternField field,
407  int32_t *pLength);
408 
430 U_STABLE void U_EXPORT2
432  const UChar *dtFormat, int32_t length);
433 
441 U_STABLE const UChar * U_EXPORT2
443  int32_t *pLength);
444 
458 U_STABLE void U_EXPORT2
460  const UChar *decimal, int32_t length);
461 
470 U_STABLE const UChar * U_EXPORT2
472  int32_t *pLength);
473 
499 U_STABLE int32_t U_EXPORT2
501  const UChar *pattern, int32_t patternLength,
502  const UChar *skeleton, int32_t skeletonLength,
503  UChar *dest, int32_t destCapacity,
504  UErrorCode *pErrorCode);
505 
536 U_STABLE int32_t U_EXPORT2
538  const UChar *pattern, int32_t patternLength,
539  const UChar *skeleton, int32_t skeletonLength,
541  UChar *dest, int32_t destCapacity,
542  UErrorCode *pErrorCode);
543 
557 
570 
581 U_STABLE const UChar * U_EXPORT2
583  const UChar *skeleton, int32_t skeletonLength,
584  int32_t *pLength);
585 
586 #endif
const UChar * udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg, UDateTimePatternField field, int32_t *pLength)
Getter corresponding to setAppendItemFormat.
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.
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:39
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.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
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.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UDateTimePatternGenerator * udatpg_open(const char *locale, UErrorCode *pErrorCode)
Open a generator according to a given locale.
#define U_EXPORT2
Definition: platform.h:314
UDateTimePatternConflict
Status return values from udatpg_addPattern().
Definition: udatpg.h:114
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:325
void udatpg_close(UDateTimePatternGenerator *dtpg)
Close a generator.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
UDateTimePatternField
Field number constants for udatpg_getAppendItemFormats() and similar functions.
Definition: udatpg.h:53
void * UDateTimePatternGenerator
Opaque type for a date/time pattern generator object.
Definition: udatpg.h:45
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:639
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.
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.
UDateTimePatternMatchOptions
Masks to control forcing the length of specified fields in the returned pattern to match those in the...
Definition: udatpg.h:97
const UChar * udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg, const UChar *skeleton, int32_t skeletonLength, int32_t *pLength)
Get the pattern corresponding to a given skeleton.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:137
int8_t UBool
The ICU boolean type.
Definition: umachine.h:228