Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: source/i18n/unicode/timezone.h

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/i18n/unicode/tblcoll.h ('k') | source/i18n/unicode/tmunit.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /************************************************************************* 1 /*************************************************************************
2 * Copyright (c) 1997-2013, International Business Machines Corporation 2 * Copyright (c) 1997-2014, International Business Machines Corporation
3 * and others. All Rights Reserved. 3 * and others. All Rights Reserved.
4 ************************************************************************** 4 **************************************************************************
5 * 5 *
6 * File TIMEZONE.H 6 * File TIMEZONE.H
7 * 7 *
8 * Modification History: 8 * Modification History:
9 * 9 *
10 * Date Name Description 10 * Date Name Description
11 * 04/21/97 aliu Overhauled header. 11 * 04/21/97 aliu Overhauled header.
12 * 07/09/97 helena Changed createInstance to createDefault. 12 * 07/09/97 helena Changed createInstance to createDefault.
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 * @stable ICU 3.8 323 * @stable ICU 3.8
324 */ 324 */
325 static const char* U_EXPORT2 getTZDataVersion(UErrorCode& status); 325 static const char* U_EXPORT2 getTZDataVersion(UErrorCode& status);
326 326
327 /** 327 /**
328 * Returns the canonical system timezone ID or the normalized 328 * Returns the canonical system timezone ID or the normalized
329 * custom time zone ID for the given time zone ID. 329 * custom time zone ID for the given time zone ID.
330 * @param id The input time zone ID to be canonicalized. 330 * @param id The input time zone ID to be canonicalized.
331 * @param canonicalID Receives the canonical system time zone ID 331 * @param canonicalID Receives the canonical system time zone ID
332 * or the custom time zone ID in normalized format. 332 * or the custom time zone ID in normalized format.
333 * @param status Recevies the status. When the given time zone ID 333 * @param status Receives the status. When the given time zone ID
334 * is neither a known system time zone ID nor a 334 * is neither a known system time zone ID nor a
335 * valid custom time zone ID, U_ILLEGAL_ARGUMENT_ERROR 335 * valid custom time zone ID, U_ILLEGAL_ARGUMENT_ERROR
336 * is set. 336 * is set.
337 * @return A reference to the result. 337 * @return A reference to the result.
338 * @stable ICU 4.0 338 * @stable ICU 4.0
339 */ 339 */
340 static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id, 340 static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id,
341 UnicodeString& canonicalID, UErrorCode& status); 341 UnicodeString& canonicalID, UErrorCode& status);
342 342
343 /** 343 /**
344 * Returns the canonical system time zone ID or the normalized 344 * Returns the canonical system time zone ID or the normalized
345 * custom time zone ID for the given time zone ID. 345 * custom time zone ID for the given time zone ID.
346 * @param id The input time zone ID to be canonicalized. 346 * @param id The input time zone ID to be canonicalized.
347 * @param canonicalID Receives the canonical system time zone ID 347 * @param canonicalID Receives the canonical system time zone ID
348 * or the custom time zone ID in normalized format. 348 * or the custom time zone ID in normalized format.
349 * @param isSystemID Receives if the given ID is a known system 349 * @param isSystemID Receives if the given ID is a known system
350 * time zone ID. 350 * time zone ID.
351 * @param status Recevies the status. When the given time zone ID 351 * @param status Receives the status. When the given time zone ID
352 * is neither a known system time zone ID nor a 352 * is neither a known system time zone ID nor a
353 * valid custom time zone ID, U_ILLEGAL_ARGUMENT_ERROR 353 * valid custom time zone ID, U_ILLEGAL_ARGUMENT_ERROR
354 * is set. 354 * is set.
355 * @return A reference to the result. 355 * @return A reference to the result.
356 * @stable ICU 4.0 356 * @stable ICU 4.0
357 */ 357 */
358 static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id, 358 static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id,
359 UnicodeString& canonicalID, UBool& isSystemID, UErrorCode& status); 359 UnicodeString& canonicalID, UBool& isSystemID, UErrorCode& status);
360 360
361 #ifndef U_HIDE_DRAFT_API
362 /** 361 /**
363 * Converts a system time zone ID to an equivalent Windows time zone ID. For example, 362 * Converts a system time zone ID to an equivalent Windows time zone ID. For example,
364 * Windows time zone ID "Pacific Standard Time" is returned for input "Americ a/Los_Angeles". 363 * Windows time zone ID "Pacific Standard Time" is returned for input "Americ a/Los_Angeles".
365 * 364 *
366 * <p>There are system time zones that cannot be mapped to Windows zones. Whe n the input 365 * <p>There are system time zones that cannot be mapped to Windows zones. Whe n the input
367 * system time zone ID is unknown or unmappable to a Windows time zone, then the result will be 366 * system time zone ID is unknown or unmappable to a Windows time zone, then the result will be
368 * empty, but the operation itself remains successful (no error status set on return). 367 * empty, but the operation itself remains successful (no error status set on return).
369 * 368 *
370 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/su pplemental/zone_tzid.html"> 369 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/su pplemental/zone_tzid.html">
371 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To g et the latest changes, 370 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To g et the latest changes,
372 * please read the ICU user guide section <a href="http://userguide.icu-proje ct.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> 371 * please read the ICU user guide section <a href="http://userguide.icu-proje ct.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data">
373 * Updating the Time Zone Data</a>. 372 * Updating the Time Zone Data</a>.
374 * 373 *
375 * @param id A system time zone ID. 374 * @param id A system time zone ID.
376 * @param winid Receives a Windows time zone ID. When the input system ti me zone ID is unknown 375 * @param winid Receives a Windows time zone ID. When the input system ti me zone ID is unknown
377 * or unmappable to a Windows time zone ID, then an empty st ring is set on return. 376 * or unmappable to a Windows time zone ID, then an empty st ring is set on return.
378 * @param status Receives the status. 377 * @param status Receives the status.
379 * @return A reference to the result (<code>winid</code>). 378 * @return A reference to the result (<code>winid</code>).
380 * @see getIDForWindowsID 379 * @see getIDForWindowsID
381 * 380 *
382 * @draft ICU 52 381 * @stable ICU 52
383 */ 382 */
384 static UnicodeString& U_EXPORT2 getWindowsID(const UnicodeString& id, 383 static UnicodeString& U_EXPORT2 getWindowsID(const UnicodeString& id,
385 UnicodeString& winid, UErrorCode& status); 384 UnicodeString& winid, UErrorCode& status);
386 385
387 /** 386 /**
388 * Converts a Windows time zone ID to an equivalent system time zone ID 387 * Converts a Windows time zone ID to an equivalent system time zone ID
389 * for a region. For example, system time zone ID "America/Los_Angeles" is re turned 388 * for a region. For example, system time zone ID "America/Los_Angeles" is re turned
390 * for input Windows ID "Pacific Standard Time" and region "US" (or <code>nul l</code>), 389 * for input Windows ID "Pacific Standard Time" and region "US" (or <code>nul l</code>),
391 * "America/Vancouver" is returned for the same Windows ID "Pacific Standard Time" and 390 * "America/Vancouver" is returned for the same Windows ID "Pacific Standard Time" and
392 * region "CA". 391 * region "CA".
393 * 392 *
394 * <p>Not all Windows time zones can be mapped to system time zones. When the input 393 * <p>Not all Windows time zones can be mapped to system time zones. When the input
395 * Windows time zone ID is unknown or unmappable to a system time zone, then the result 394 * Windows time zone ID is unknown or unmappable to a system time zone, then the result
396 * will be empty, but the operation itself remains successful (no error statu s set on return). 395 * will be empty, but the operation itself remains successful (no error statu s set on return).
397 * 396 *
398 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/su pplemental/zone_tzid.html"> 397 * <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/su pplemental/zone_tzid.html">
399 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To g et the latest changes, 398 * Zone-Tzid mapping data</a>. The mapping data is updated time to time. To g et the latest changes,
400 * please read the ICU user guide section <a href="http://userguide.icu-proje ct.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data"> 399 * please read the ICU user guide section <a href="http://userguide.icu-proje ct.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data">
401 * Updating the Time Zone Data</a>. 400 * Updating the Time Zone Data</a>.
402 * 401 *
403 * @param winid A Windows time zone ID. 402 * @param winid A Windows time zone ID.
404 * @param region A null-terminated region code, or <code>NULL</code> if no regional preference. 403 * @param region A null-terminated region code, or <code>NULL</code> if no regional preference.
405 * @param id Receives a system time zone ID. When the input Windows ti me zone ID is unknown 404 * @param id Receives a system time zone ID. When the input Windows ti me zone ID is unknown
406 * or unmappable to a system time zone ID, then an empty str ing is set on return. 405 * or unmappable to a system time zone ID, then an empty str ing is set on return.
407 * @param status Receives the status. 406 * @param status Receives the status.
408 * @return A reference to the result (<code>id</code>). 407 * @return A reference to the result (<code>id</code>).
409 * @see getWindowsID 408 * @see getWindowsID
410 * 409 *
411 * @draft ICU 52 410 * @stable ICU 52
412 */ 411 */
413 static UnicodeString& U_EXPORT2 getIDForWindowsID(const UnicodeString& winid , const char* region, 412 static UnicodeString& U_EXPORT2 getIDForWindowsID(const UnicodeString& winid , const char* region,
414 UnicodeString& id, UErrorCode& status); 413 UnicodeString& id, UErrorCode& status);
415 414
416 #endif /* U_HIDE_DRAFT_API */
417
418 /** 415 /**
419 * Returns true if the two TimeZones are equal. (The TimeZone version only compares 416 * Returns true if the two TimeZones are equal. (The TimeZone version only compares
420 * IDs, but subclasses are expected to also compare the fields they add.) 417 * IDs, but subclasses are expected to also compare the fields they add.)
421 * 418 *
422 * @param that The TimeZone object to be compared with. 419 * @param that The TimeZone object to be compared with.
423 * @return True if the given TimeZone is equal to this TimeZone; false 420 * @return True if the given TimeZone is equal to this TimeZone; false
424 * otherwise. 421 * otherwise.
425 * @stable ICU 2.0 422 * @stable ICU 2.0
426 */ 423 */
427 virtual UBool operator==(const TimeZone& that) const; 424 virtual UBool operator==(const TimeZone& that) const;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 * @stable ICU 4.4 602 * @stable ICU 4.4
606 */ 603 */
607 GENERIC_LOCATION 604 GENERIC_LOCATION
608 }; 605 };
609 606
610 /** 607 /**
611 * Returns a name of this time zone suitable for presentation to the user 608 * Returns a name of this time zone suitable for presentation to the user
612 * in the default locale. 609 * in the default locale.
613 * This method returns the long name, not including daylight savings. 610 * This method returns the long name, not including daylight savings.
614 * If the display name is not available for the locale, 611 * If the display name is not available for the locale,
615 * then this method returns a string in the format 612 * then this method returns a string in the localized GMT offset format
616 * <code>GMT[+-]hh:mm</code>. 613 * such as <code>GMT[+-]HH:mm</code>.
617 * @param result the human-readable name of this time zone in the default lo cale. 614 * @param result the human-readable name of this time zone in the default lo cale.
618 * @return A reference to 'result'. 615 * @return A reference to 'result'.
619 * @stable ICU 2.0 616 * @stable ICU 2.0
620 */ 617 */
621 UnicodeString& getDisplayName(UnicodeString& result) const; 618 UnicodeString& getDisplayName(UnicodeString& result) const;
622 619
623 /** 620 /**
624 * Returns a name of this time zone suitable for presentation to the user 621 * Returns a name of this time zone suitable for presentation to the user
625 * in the specified locale. 622 * in the specified locale.
626 * This method returns the long name, not including daylight savings. 623 * This method returns the long name, not including daylight savings.
627 * If the display name is not available for the locale, 624 * If the display name is not available for the locale,
628 * then this method returns a string in the format 625 * then this method returns a string in the localized GMT offset format
629 * <code>GMT[+-]hh:mm</code>. 626 * such as <code>GMT[+-]HH:mm</code>.
630 * @param locale the locale in which to supply the display name. 627 * @param locale the locale in which to supply the display name.
631 * @param result the human-readable name of this time zone in the given loca le 628 * @param result the human-readable name of this time zone in the given loca le
632 * or in the default locale if the given locale is not recogni zed. 629 * or in the default locale if the given locale is not recogni zed.
633 * @return A reference to 'result'. 630 * @return A reference to 'result'.
634 * @stable ICU 2.0 631 * @stable ICU 2.0
635 */ 632 */
636 UnicodeString& getDisplayName(const Locale& locale, UnicodeString& result) c onst; 633 UnicodeString& getDisplayName(const Locale& locale, UnicodeString& result) c onst;
637 634
638 /** 635 /**
639 * Returns a name of this time zone suitable for presentation to the user 636 * Returns a name of this time zone suitable for presentation to the user
640 * in the default locale. 637 * in the default locale.
641 * If the display name is not available for the locale, 638 * If the display name is not available for the locale,
642 * then this method returns a string in the format 639 * then this method returns a string in the localized GMT offset format
643 * <code>GMT[+-]hh:mm</code>. 640 * such as <code>GMT[+-]HH:mm</code>.
644 * @param daylight if true, return the daylight savings name. 641 * @param daylight if true, return the daylight savings name.
645 * @param style 642 * @param style
646 * @param result the human-readable name of this time zone in the default lo cale. 643 * @param result the human-readable name of this time zone in the default lo cale.
647 * @return A reference to 'result'. 644 * @return A reference to 'result'.
648 * @stable ICU 2.0 645 * @stable ICU 2.0
649 */ 646 */
650 UnicodeString& getDisplayName(UBool daylight, EDisplayType style, UnicodeStr ing& result) const; 647 UnicodeString& getDisplayName(UBool daylight, EDisplayType style, UnicodeStr ing& result) const;
651 648
652 /** 649 /**
653 * Returns a name of this time zone suitable for presentation to the user 650 * Returns a name of this time zone suitable for presentation to the user
654 * in the specified locale. 651 * in the specified locale.
655 * If the display name is not available for the locale, 652 * If the display name is not available for the locale,
656 * then this method returns a string in the format 653 * then this method returns a string in the localized GMT offset format
657 * <code>GMT[+-]hh:mm</code>. 654 * such as <code>GMT[+-]HH:mm</code>.
658 * @param daylight if true, return the daylight savings name. 655 * @param daylight if true, return the daylight savings name.
659 * @param style 656 * @param style
660 * @param locale the locale in which to supply the display name. 657 * @param locale the locale in which to supply the display name.
661 * @param result the human-readable name of this time zone in the given loca le 658 * @param result the human-readable name of this time zone in the given loca le
662 * or in the default locale if the given locale is not recogni zed. 659 * or in the default locale if the given locale is not recogni zed.
663 * @return A refence to 'result'. 660 * @return A refence to 'result'.
664 * @stable ICU 2.0 661 * @stable ICU 2.0
665 */ 662 */
666 UnicodeString& getDisplayName(UBool daylight, EDisplayType style, const Loca le& locale, UnicodeString& result) const; 663 UnicodeString& getDisplayName(UBool daylight, EDisplayType style, const Loca le& locale, UnicodeString& result) const;
667 664
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 TimeZone::setID(const UnicodeString& ID) 939 TimeZone::setID(const UnicodeString& ID)
943 { 940 {
944 fID = ID; 941 fID = ID;
945 } 942 }
946 U_NAMESPACE_END 943 U_NAMESPACE_END
947 944
948 #endif /* #if !UCONFIG_NO_FORMATTING */ 945 #endif /* #if !UCONFIG_NO_FORMATTING */
949 946
950 #endif //_TIMEZONE 947 #endif //_TIMEZONE
951 //eof 948 //eof
OLDNEW
« no previous file with comments | « source/i18n/unicode/tblcoll.h ('k') | source/i18n/unicode/tmunit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698