time_zone_base.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  3. "../../../tools/boostbook/dtd/boostbook.dtd">
  4. <!-- Copyright (c) 2001-2005 CrystalClear Software, Inc.
  5. Subject to the Boost Software License, Version 1.0.
  6. (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <section id="date_time.local_time.time_zone_base">
  9. <title>Time Zone (abstract)</title>
  10. <link linkend="time_zone_base_intro">Introduction</link> --
  11. <link linkend="time_zone_base_header">Header</link> --
  12. <link linkend="time_zone_base_constr">Construction</link> --
  13. <link linkend="time_zone_base_accessors">Accessors</link>
  14. <anchor id="time_zone_base_intro" />
  15. <bridgehead renderas="sect3">Introduction</bridgehead>
  16. <para>
  17. The time_zone_base class is an abstract base class template for representing time zones. Time zones are a set of data and rules that provide information about a time zone. The date_time library handles time_zones by means of a boost::shared_ptr&lt;time_zone_base&gt;. A user's custom time zone class will work in the date_time library by means of this shared_ptr.
  18. </para>
  19. <para>
  20. For convienience, the time_zone_base class is typedef'd as time_zone. All references in the documentation to time_zone, are referring to this typedef.
  21. </para>
  22. <anchor id="time_zone_base_header" />
  23. <bridgehead renderas="sect3">Header</bridgehead>
  24. <para>
  25. The time_zone_base class is defined in the header:
  26. <programlisting>#include "boost/date_time/time_zone_base.hpp"
  27. </programlisting>
  28. </para>
  29. <anchor id="time_zone_base_constr" />
  30. <bridgehead renderas="sect3">Construction</bridgehead>
  31. <para>
  32. A default constructor is provided in the time_zone_base class. There are no private data members in this base class to initialize.
  33. </para>
  34. <para>
  35. Template parameters are time_type (typically posix_time::ptime) and CharT (defaults to char).
  36. </para>
  37. <anchor id="time_zone_base_accessors" />
  38. <bridgehead renderas="sect3">Accessors</bridgehead>
  39. <para>
  40. All of the accessors listed here are pure virtual functions.
  41. </para>
  42. <para>
  43. <informaltable frame="all">
  44. <tgroup cols="2">
  45. <thead>
  46. <row>
  47. <entry>Syntax</entry>
  48. <entry>Description</entry>
  49. </row>
  50. </thead>
  51. <tbody>
  52. <row>
  53. <entry valign="top"><screen>
  54. string_type dst_zone_abbrev();</screen></entry>
  55. <entry>Returns the daylight savings abbreviation for the represented time zone.</entry>
  56. </row>
  57. <row>
  58. <entry valign="top"><screen>
  59. string_type std_zone_abbrev();</screen></entry>
  60. <entry>Returns the standard abbreviation for the represented time zone.</entry>
  61. </row>
  62. <row>
  63. <entry valign="top"><screen>
  64. string_type dst_zone_name();</screen></entry>
  65. <entry>Returns the daylight savings name for the represented time zone.</entry>
  66. </row>
  67. <row>
  68. <entry valign="top"><screen>
  69. string_type std_zone_name();</screen></entry>
  70. <entry>Returns the standard name for the represented time zone.</entry>
  71. </row>
  72. <row>
  73. <entry valign="top"><screen>bool has_dst();</screen></entry>
  74. <entry>Returns true if this time zone does not make a daylight savings shift.</entry>
  75. </row>
  76. <row>
  77. <entry valign="top"><screen>
  78. time_type dst_local_start_time(year_type);</screen></entry>
  79. <entry>The date and time daylight savings time begins in given year.</entry>
  80. </row>
  81. <row>
  82. <entry valign="top"><screen>
  83. time_type dst_local_end_time(year_type);</screen></entry>
  84. <entry valign="top">The date and time daylight savings time ends in given year.</entry>
  85. </row>
  86. <row>
  87. <entry valign="top"><screen>
  88. time_duration_type base_utc_offset();</screen></entry>
  89. <entry>The amount of time offset from UTC (typically in hours).</entry>
  90. </row>
  91. <row>
  92. <entry valign="top"><screen>
  93. time_duration_type dst_offset();</screen></entry>
  94. <entry>The amount of time shifted during daylight savings.</entry>
  95. </row>
  96. <row>
  97. <entry valign="top"><screen>
  98. std::string to_posix_string();</screen></entry>
  99. <entry>Returns a posix time zone string representation of this time_zone_base object. For a detailed description of a posix time zone string see <link linkend="date_time.local_time.posix_time_zone">posix_time_zone</link>.</entry>
  100. </row>
  101. </tbody>
  102. </tgroup>
  103. </informaltable>
  104. </para>
  105. </section>