| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * Copyright (C) 1996-2013, International Business Machines Corporation and | 3 * Copyright (C) 1996-2014, International Business Machines Corporation and |
| 4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
| 5 ******************************************************************************* | 5 ******************************************************************************* |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef UCAL_H | 8 #ifndef UCAL_H |
| 9 #define UCAL_H | 9 #define UCAL_H |
| 10 | 10 |
| 11 #include "unicode/utypes.h" | 11 #include "unicode/utypes.h" |
| 12 #include "unicode/uenum.h" | 12 #include "unicode/uenum.h" |
| 13 #include "unicode/uloc.h" | 13 #include "unicode/uloc.h" |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 * @param len The length of zoneID, or -1 if null-terminated. | 738 * @param len The length of zoneID, or -1 if null-terminated. |
| 739 * @param status A pointer to an UErrorCode to receive any errors. | 739 * @param status A pointer to an UErrorCode to receive any errors. |
| 740 * @stable ICU 2.0 | 740 * @stable ICU 2.0 |
| 741 */ | 741 */ |
| 742 U_STABLE void U_EXPORT2 | 742 U_STABLE void U_EXPORT2 |
| 743 ucal_setTimeZone(UCalendar* cal, | 743 ucal_setTimeZone(UCalendar* cal, |
| 744 const UChar* zoneID, | 744 const UChar* zoneID, |
| 745 int32_t len, | 745 int32_t len, |
| 746 UErrorCode* status); | 746 UErrorCode* status); |
| 747 | 747 |
| 748 #ifndef U_HIDE_DRAFT_API | |
| 749 /** | 748 /** |
| 750 * Get the ID of the UCalendar's time zone. | 749 * Get the ID of the UCalendar's time zone. |
| 751 * | 750 * |
| 752 * @param cal The UCalendar to query. | 751 * @param cal The UCalendar to query. |
| 753 * @param result Receives the UCalendar's time zone ID. | 752 * @param result Receives the UCalendar's time zone ID. |
| 754 * @param resultLength The maximum size of result. | 753 * @param resultLength The maximum size of result. |
| 755 * @param status Receives the status. | 754 * @param status Receives the status. |
| 756 * @return The total buffer size needed; if greater than resultLeng
th, the output was truncated. | 755 * @return The total buffer size needed; if greater than resultLeng
th, the output was truncated. |
| 757 * @draft ICU 51 | 756 * @stable ICU 51 |
| 758 */ | 757 */ |
| 759 U_DRAFT int32_t U_EXPORT2 | 758 U_STABLE int32_t U_EXPORT2 |
| 760 ucal_getTimeZoneID(const UCalendar *cal, | 759 ucal_getTimeZoneID(const UCalendar *cal, |
| 761 UChar *result, | 760 UChar *result, |
| 762 int32_t resultLength, | 761 int32_t resultLength, |
| 763 UErrorCode *status); | 762 UErrorCode *status); |
| 764 #endif /* U_HIDE_DRAFT_API */ | |
| 765 | 763 |
| 766 /** | 764 /** |
| 767 * Possible formats for a UCalendar's display name | 765 * Possible formats for a UCalendar's display name |
| 768 * @stable ICU 2.0 | 766 * @stable ICU 2.0 |
| 769 */ | 767 */ |
| 770 enum UCalendarDisplayNameType { | 768 enum UCalendarDisplayNameType { |
| 771 /** Standard display name */ | 769 /** Standard display name */ |
| 772 UCAL_STANDARD, | 770 UCAL_STANDARD, |
| 773 /** Short standard display name */ | 771 /** Short standard display name */ |
| 774 UCAL_SHORT_STANDARD, | 772 UCAL_SHORT_STANDARD, |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 /** | 1280 /** |
| 1283 * Returns the canonical system timezone ID or the normalized | 1281 * Returns the canonical system timezone ID or the normalized |
| 1284 * custom time zone ID for the given time zone ID. | 1282 * custom time zone ID for the given time zone ID. |
| 1285 * @param id The input timezone ID to be canonicalized. | 1283 * @param id The input timezone ID to be canonicalized. |
| 1286 * @param len The length of id, or -1 if null-terminated. | 1284 * @param len The length of id, or -1 if null-terminated. |
| 1287 * @param result The buffer receives the canonical system timezone ID | 1285 * @param result The buffer receives the canonical system timezone ID |
| 1288 * or the custom timezone ID in normalized format. | 1286 * or the custom timezone ID in normalized format. |
| 1289 * @param resultCapacity The capacity of the result buffer. | 1287 * @param resultCapacity The capacity of the result buffer. |
| 1290 * @param isSystemID Receives if the given ID is a known system | 1288 * @param isSystemID Receives if the given ID is a known system |
| 1291 * timezone ID. | 1289 * timezone ID. |
| 1292 * @param status Recevies the status. When the given timezone ID | 1290 * @param status Receives the status. When the given timezone ID |
| 1293 * is neither a known system time zone ID nor a | 1291 * is neither a known system time zone ID nor a |
| 1294 * valid custom timezone ID, U_ILLEGAL_ARGUMENT_ERROR | 1292 * valid custom timezone ID, U_ILLEGAL_ARGUMENT_ERROR |
| 1295 * is set. | 1293 * is set. |
| 1296 * @return The result string length, not including the terminating | 1294 * @return The result string length, not including the terminating |
| 1297 * null. | 1295 * null. |
| 1298 * @stable ICU 4.0 | 1296 * @stable ICU 4.0 |
| 1299 */ | 1297 */ |
| 1300 U_STABLE int32_t U_EXPORT2 | 1298 U_STABLE int32_t U_EXPORT2 |
| 1301 ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len, | 1299 ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len, |
| 1302 UChar* result, int32_t resultCapacity, UBool *isSyst
emID, UErrorCode* status); | 1300 UChar* result, int32_t resultCapacity, UBool *isSyst
emID, UErrorCode* status); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1486 * FALSE. | 1484 * FALSE. |
| 1487 * @param cal The UCalendar to query. | 1485 * @param cal The UCalendar to query. |
| 1488 * @param type The type of transition desired. | 1486 * @param type The type of transition desired. |
| 1489 * @param transition A pointer to a UDate to be set to the transition time. | 1487 * @param transition A pointer to a UDate to be set to the transition time. |
| 1490 * If the function returns FALSE, the value set is unspecified. | 1488 * If the function returns FALSE, the value set is unspecified. |
| 1491 * @param status A pointer to a UErrorCode to receive any errors. | 1489 * @param status A pointer to a UErrorCode to receive any errors. |
| 1492 * @return TRUE if a valid transition time is set in *transition, FALSE | 1490 * @return TRUE if a valid transition time is set in *transition, FALSE |
| 1493 * otherwise. | 1491 * otherwise. |
| 1494 * @stable ICU 50 | 1492 * @stable ICU 50 |
| 1495 */ | 1493 */ |
| 1496 U_DRAFT UBool U_EXPORT2 | 1494 U_STABLE UBool U_EXPORT2 |
| 1497 ucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType typ
e, | 1495 ucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType typ
e, |
| 1498 UDate* transition, UErrorCode* status); | 1496 UDate* transition, UErrorCode* status); |
| 1499 | 1497 |
| 1500 #ifndef U_HIDE_DRAFT_API | |
| 1501 /** | 1498 /** |
| 1502 * Converts a system time zone ID to an equivalent Windows time zone ID. For exam
ple, | 1499 * Converts a system time zone ID to an equivalent Windows time zone ID. For exam
ple, |
| 1503 * Windows time zone ID "Pacific Standard Time" is returned for input "America/Lo
s_Angeles". | 1500 * Windows time zone ID "Pacific Standard Time" is returned for input "America/Lo
s_Angeles". |
| 1504 * | 1501 * |
| 1505 * <p>There are system time zones that cannot be mapped to Windows zones. When th
e input | 1502 * <p>There are system time zones that cannot be mapped to Windows zones. When th
e input |
| 1506 * system time zone ID is unknown or unmappable to a Windows time zone, then this | 1503 * system time zone ID is unknown or unmappable to a Windows time zone, then this |
| 1507 * function returns 0 as the result length, but the operation itself remains succ
essful | 1504 * function returns 0 as the result length, but the operation itself remains succ
essful |
| 1508 * (no error status set on return). | 1505 * (no error status set on return). |
| 1509 * | 1506 * |
| 1510 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supple
mental/zone_tzid.html"> | 1507 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supple
mental/zone_tzid.html"> |
| 1511 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get t
he latest changes, | 1508 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get t
he latest changes, |
| 1512 * please read the ICU user guide section <a href="http://userguide.icu-project.o
rg/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> | 1509 * please read the ICU user guide section <a href="http://userguide.icu-project.o
rg/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> |
| 1513 * Updating the Time Zone Data</a>. | 1510 * Updating the Time Zone Data</a>. |
| 1514 * | 1511 * |
| 1515 * @param id A system time zone ID. | 1512 * @param id A system time zone ID. |
| 1516 * @param len The length of <code>id</code>, or -1 if null-terminated. | 1513 * @param len The length of <code>id</code>, or -1 if null-terminated. |
| 1517 * @param winid A buffer to receive a Windows time zone ID. | 1514 * @param winid A buffer to receive a Windows time zone ID. |
| 1518 * @param winidCapacity The capacity of the result buffer <code>winid</code>. | 1515 * @param winidCapacity The capacity of the result buffer <code>winid</code>. |
| 1519 * @param status Receives the status. | 1516 * @param status Receives the status. |
| 1520 * @return The result string length, not including the terminating n
ull. | 1517 * @return The result string length, not including the terminating n
ull. |
| 1521 * @see ucal_getTimeZoneIDForWindowsID | 1518 * @see ucal_getTimeZoneIDForWindowsID |
| 1522 * | 1519 * |
| 1523 * @draft ICU 52 | 1520 * @stable ICU 52 |
| 1524 */ | 1521 */ |
| 1525 U_DRAFT int32_t U_EXPORT2 | 1522 U_STABLE int32_t U_EXPORT2 |
| 1526 ucal_getWindowsTimeZoneID(const UChar* id, int32_t len, | 1523 ucal_getWindowsTimeZoneID(const UChar* id, int32_t len, |
| 1527 UChar* winid, int32_t winidCapacity, UErrorCode* sta
tus); | 1524 UChar* winid, int32_t winidCapacity, UErrorCode* sta
tus); |
| 1528 | 1525 |
| 1529 /** | 1526 /** |
| 1530 * Converts a Windows time zone ID to an equivalent system time zone ID | 1527 * Converts a Windows time zone ID to an equivalent system time zone ID |
| 1531 * for a region. For example, system time zone ID "America/Los_Angeles" is return
ed | 1528 * for a region. For example, system time zone ID "America/Los_Angeles" is return
ed |
| 1532 * for input Windows ID "Pacific Standard Time" and region "US" (or <code>null</c
ode>), | 1529 * for input Windows ID "Pacific Standard Time" and region "US" (or <code>null</c
ode>), |
| 1533 * "America/Vancouver" is returned for the same Windows ID "Pacific Standard Time
" and | 1530 * "America/Vancouver" is returned for the same Windows ID "Pacific Standard Time
" and |
| 1534 * region "CA". | 1531 * region "CA". |
| 1535 * | 1532 * |
| 1536 * <p>Not all Windows time zones can be mapped to system time zones. When the inp
ut | 1533 * <p>Not all Windows time zones can be mapped to system time zones. When the inp
ut |
| 1537 * Windows time zone ID is unknown or unmappable to a system time zone, then this | 1534 * Windows time zone ID is unknown or unmappable to a system time zone, then this |
| 1538 * function returns 0 as the result length, but the operation itself remains succ
essful | 1535 * function returns 0 as the result length, but the operation itself remains succ
essful |
| 1539 * (no error status set on return). | 1536 * (no error status set on return). |
| 1540 * | 1537 * |
| 1541 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supple
mental/zone_tzid.html"> | 1538 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supple
mental/zone_tzid.html"> |
| 1542 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get t
he latest changes, | 1539 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get t
he latest changes, |
| 1543 * please read the ICU user guide section <a href="http://userguide.icu-project.o
rg/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> | 1540 * please read the ICU user guide section <a href="http://userguide.icu-project.o
rg/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> |
| 1544 * Updating the Time Zone Data</a>. | 1541 * Updating the Time Zone Data</a>. |
| 1545 * | 1542 * |
| 1546 * @param winid A Windows time zone ID. | 1543 * @param winid A Windows time zone ID. |
| 1547 * @param len The length of <code>winid</code>, or -1 if null-terminate
d. | 1544 * @param len The length of <code>winid</code>, or -1 if null-terminate
d. |
| 1548 * @param region A null-terminated region code, or <code>NULL</code> if no
regional preference. | 1545 * @param region A null-terminated region code, or <code>NULL</code> if no
regional preference. |
| 1549 * @param id A buffer to receive a system time zone ID. | 1546 * @param id A buffer to receive a system time zone ID. |
| 1550 * @param idCapacity The capacity of the result buffer <code>id</code>. | 1547 * @param idCapacity The capacity of the result buffer <code>id</code>. |
| 1551 * @param status Receives the status. | 1548 * @param status Receives the status. |
| 1552 * @return The result string length, not including the terminating n
ull. | 1549 * @return The result string length, not including the terminating n
ull. |
| 1553 * @see ucal_getWindowsTimeZoneID | 1550 * @see ucal_getWindowsTimeZoneID |
| 1554 * | 1551 * |
| 1555 * @draft ICU 52 | 1552 * @stable ICU 52 |
| 1556 */ | 1553 */ |
| 1557 U_DRAFT int32_t U_EXPORT2 | 1554 U_STABLE int32_t U_EXPORT2 |
| 1558 ucal_getTimeZoneIDForWindowsID(const UChar* winid, int32_t len, const char* regi
on, | 1555 ucal_getTimeZoneIDForWindowsID(const UChar* winid, int32_t len, const char* regi
on, |
| 1559 UChar* id, int32_t idCapacity, UErrorCode* statu
s); | 1556 UChar* id, int32_t idCapacity, UErrorCode* statu
s); |
| 1560 | 1557 |
| 1561 #endif /* U_HIDE_DRAFT_API */ | |
| 1562 | |
| 1563 #endif /* #if !UCONFIG_NO_FORMATTING */ | 1558 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| 1564 | 1559 |
| 1565 #endif | 1560 #endif |
| OLD | NEW |