OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * | 3 * |
4 * Copyright (C) 2007-2012, International Business Machines | 4 * Copyright (C) 2007-2015, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 * file name: udatpg.h | 8 * file name: udatpg.h |
9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
11 * indentation:4 | 11 * indentation:4 |
12 * | 12 * |
13 * created on: 2007jul30 | 13 * created on: 2007jul30 |
14 * created by: Markus W. Scherer | 14 * created by: Markus W. Scherer |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 /** | 252 /** |
253 * Get a unique skeleton from a given pattern. For example, | 253 * Get a unique skeleton from a given pattern. For example, |
254 * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd". | 254 * both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd". |
255 * | 255 * |
256 * Note that this function uses a non-const UDateTimePatternGenerator: | 256 * Note that this function uses a non-const UDateTimePatternGenerator: |
257 * It uses a stateful pattern parser which is set up for each generator object, | 257 * It uses a stateful pattern parser which is set up for each generator object, |
258 * rather than creating one for each function call. | 258 * rather than creating one for each function call. |
259 * Consecutive calls to this function do not affect each other, | 259 * Consecutive calls to this function do not affect each other, |
260 * but this function cannot be used concurrently on a single generator object. | 260 * but this function cannot be used concurrently on a single generator object. |
261 * | 261 * |
262 * @param dtpg a pointer to UDateTimePatternGenerator. | 262 * @param unusedDtpg a pointer to UDateTimePatternGenerator. |
| 263 * This parameter is no longer used. Callers may pass NULL. |
263 * @param pattern input pattern, such as "dd/MMM". | 264 * @param pattern input pattern, such as "dd/MMM". |
264 * @param length the length of pattern. | 265 * @param length the length of pattern. |
265 * @param skeleton such as "MMMdd" | 266 * @param skeleton such as "MMMdd" |
266 * @param capacity the capacity of skeleton. | 267 * @param capacity the capacity of skeleton. |
267 * @param pErrorCode a pointer to the UErrorCode which must not indicate a | 268 * @param pErrorCode a pointer to the UErrorCode which must not indicate a |
268 * failure before the function call. | 269 * failure before the function call. |
269 * @return the length of skeleton. | 270 * @return the length of skeleton. |
270 * @stable ICU 3.8 | 271 * @stable ICU 3.8 |
271 */ | 272 */ |
272 U_STABLE int32_t U_EXPORT2 | 273 U_STABLE int32_t U_EXPORT2 |
273 udatpg_getSkeleton(UDateTimePatternGenerator *dtpg, | 274 udatpg_getSkeleton(UDateTimePatternGenerator *unusedDtpg, |
274 const UChar *pattern, int32_t length, | 275 const UChar *pattern, int32_t length, |
275 UChar *skeleton, int32_t capacity, | 276 UChar *skeleton, int32_t capacity, |
276 UErrorCode *pErrorCode); | 277 UErrorCode *pErrorCode); |
277 | 278 |
278 /** | 279 /** |
279 * Get a unique base skeleton from a given pattern. This is the same | 280 * Get a unique base skeleton from a given pattern. This is the same |
280 * as the skeleton, except that differences in length are minimized so | 281 * as the skeleton, except that differences in length are minimized so |
281 * as to only preserve the difference between string and numeric form. So | 282 * as to only preserve the difference between string and numeric form. So |
282 * for example, both "MMM-dd" and "d/MMM" produce the skeleton "MMMd" | 283 * for example, both "MMM-dd" and "d/MMM" produce the skeleton "MMMd" |
283 * (notice the single d). | 284 * (notice the single d). |
284 * | 285 * |
285 * Note that this function uses a non-const UDateTimePatternGenerator: | 286 * Note that this function uses a non-const UDateTimePatternGenerator: |
286 * It uses a stateful pattern parser which is set up for each generator object, | 287 * It uses a stateful pattern parser which is set up for each generator object, |
287 * rather than creating one for each function call. | 288 * rather than creating one for each function call. |
288 * Consecutive calls to this function do not affect each other, | 289 * Consecutive calls to this function do not affect each other, |
289 * but this function cannot be used concurrently on a single generator object. | 290 * but this function cannot be used concurrently on a single generator object. |
290 * | 291 * |
291 * @param dtpg a pointer to UDateTimePatternGenerator. | 292 * @param unusedDtpg a pointer to UDateTimePatternGenerator. |
| 293 * This parameter is no longer used. Callers may pass NULL. |
292 * @param pattern input pattern, such as "dd/MMM". | 294 * @param pattern input pattern, such as "dd/MMM". |
293 * @param length the length of pattern. | 295 * @param length the length of pattern. |
294 * @param baseSkeleton such as "Md" | 296 * @param baseSkeleton such as "Md" |
295 * @param capacity the capacity of base skeleton. | 297 * @param capacity the capacity of base skeleton. |
296 * @param pErrorCode a pointer to the UErrorCode which must not indicate a | 298 * @param pErrorCode a pointer to the UErrorCode which must not indicate a |
297 * failure before the function call. | 299 * failure before the function call. |
298 * @return the length of baseSkeleton. | 300 * @return the length of baseSkeleton. |
299 * @stable ICU 3.8 | 301 * @stable ICU 3.8 |
300 */ | 302 */ |
301 U_STABLE int32_t U_EXPORT2 | 303 U_STABLE int32_t U_EXPORT2 |
302 udatpg_getBaseSkeleton(UDateTimePatternGenerator *dtpg, | 304 udatpg_getBaseSkeleton(UDateTimePatternGenerator *unusedDtpg, |
303 const UChar *pattern, int32_t length, | 305 const UChar *pattern, int32_t length, |
304 UChar *baseSkeleton, int32_t capacity, | 306 UChar *baseSkeleton, int32_t capacity, |
305 UErrorCode *pErrorCode); | 307 UErrorCode *pErrorCode); |
306 | 308 |
307 /** | 309 /** |
308 * Adds a pattern to the generator. If the pattern has the same skeleton as | 310 * Adds a pattern to the generator. If the pattern has the same skeleton as |
309 * an existing pattern, and the override parameter is set, then the previous | 311 * an existing pattern, and the override parameter is set, then the previous |
310 * value is overriden. Otherwise, the previous value is retained. In either | 312 * value is overriden. Otherwise, the previous value is retained. In either |
311 * case, the conflicting status is set and previous vale is stored in | 313 * case, the conflicting status is set and previous vale is stored in |
312 * conflicting pattern. | 314 * conflicting pattern. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 * @param pLength A pointer that will receive the length of the name for field. | 404 * @param pLength A pointer that will receive the length of the name for field. |
403 * @return name for field | 405 * @return name for field |
404 * @stable ICU 3.8 | 406 * @stable ICU 3.8 |
405 */ | 407 */ |
406 U_STABLE const UChar * U_EXPORT2 | 408 U_STABLE const UChar * U_EXPORT2 |
407 udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg, | 409 udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg, |
408 UDateTimePatternField field, | 410 UDateTimePatternField field, |
409 int32_t *pLength); | 411 int32_t *pLength); |
410 | 412 |
411 /** | 413 /** |
412 * The date time format is a message format pattern used to compose date and | 414 * The DateTimeFormat is a message format pattern used to compose date and |
413 * time patterns. The default value is "{0} {1}", where {0} will be replaced | 415 * time patterns. The default pattern in the root locale is "{1} {0}", where |
414 * by the date pattern and {1} will be replaced by the time pattern. | 416 * {1} will be replaced by the date pattern and {0} will be replaced by the |
| 417 * time pattern; however, other locales may specify patterns such as |
| 418 * "{1}, {0}" or "{1} 'at' {0}", etc. |
415 * <p> | 419 * <p> |
416 * This is used when the input skeleton contains both date and time fields, | 420 * This is used when the input skeleton contains both date and time fields, |
417 * but there is not a close match among the added patterns. For example, | 421 * but there is not a close match among the added patterns. For example, |
418 * suppose that this object was created by adding "dd-MMM" and "hh:mm", and | 422 * suppose that this object was created by adding "dd-MMM" and "hh:mm", and |
419 * its datetimeFormat is the default "{0} {1}". Then if the input skeleton | 423 * its DateTimeFormat is the default "{1} {0}". Then if the input skeleton |
420 * is "MMMdhmm", there is not an exact match, so the input skeleton is | 424 * is "MMMdhmm", there is not an exact match, so the input skeleton is |
421 * broken up into two components "MMMd" and "hmm". There are close matches | 425 * broken up into two components "MMMd" and "hmm". There are close matches |
422 * for those two skeletons, so the result is put together with this pattern, | 426 * for those two skeletons, so the result is put together with this pattern, |
423 * resulting in "d-MMM h:mm". | 427 * resulting in "d-MMM h:mm". |
424 * | 428 * |
425 * @param dtpg a pointer to UDateTimePatternGenerator. | 429 * @param dtpg a pointer to UDateTimePatternGenerator. |
426 * @param dtFormat | 430 * @param dtFormat |
427 * message format pattern, here {0} will be replaced by the date | 431 * message format pattern, here {1} will be replaced by the date |
428 * pattern and {1} will be replaced by the time pattern. | 432 * pattern and {0} will be replaced by the time pattern. |
429 * @param length the length of dtFormat. | 433 * @param length the length of dtFormat. |
430 * @stable ICU 3.8 | 434 * @stable ICU 3.8 |
431 */ | 435 */ |
432 U_STABLE void U_EXPORT2 | 436 U_STABLE void U_EXPORT2 |
433 udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg, | 437 udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg, |
434 const UChar *dtFormat, int32_t length); | 438 const UChar *dtFormat, int32_t length); |
435 | 439 |
436 /** | 440 /** |
437 * Getter corresponding to setDateTimeFormat. | 441 * Getter corresponding to setDateTimeFormat. |
438 * @param dtpg a pointer to UDateTimePatternGenerator. | 442 * @param dtpg a pointer to UDateTimePatternGenerator. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 * @param pLength pointer to the length of return pattern. | 583 * @param pLength pointer to the length of return pattern. |
580 * @return pattern corresponding to a given skeleton. | 584 * @return pattern corresponding to a given skeleton. |
581 * @stable ICU 3.8 | 585 * @stable ICU 3.8 |
582 */ | 586 */ |
583 U_STABLE const UChar * U_EXPORT2 | 587 U_STABLE const UChar * U_EXPORT2 |
584 udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg, | 588 udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg, |
585 const UChar *skeleton, int32_t skeletonLength, | 589 const UChar *skeleton, int32_t skeletonLength, |
586 int32_t *pLength); | 590 int32_t *pLength); |
587 | 591 |
588 #endif | 592 #endif |
OLD | NEW |