time_input_facet.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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) 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.time_input_facet">
  9. <title>Time Input Facet</title>
  10. <link linkend="time_input_facet_intro">Introduction</link> -
  11. <link linkend="time_input_facet_constr">Construction</link> -
  12. <link linkend="time_input_facet_accessors">Accessors</link>
  13. <anchor id="time_input_facet_intro" />
  14. <bridgehead renderas="sect3">Introduction</bridgehead>
  15. <para>The <code>boost::date_time::time_input_facet</code> is an extension of the <code>date_input_facet</code>. It is typedef'ed in the <code>boost::posix_time</code> namespace as <code>time_input_facet</code> and <code>wtime_input_facet</code>. It is typedef'ed in the <code>boost::local_time</code> namespace as <code>local_time_input_facet</code> and <code>wlocal_time_input_facet</code>.
  16. </para>
  17. <anchor id="time_input_facet_constr" />
  18. <bridgehead renderas="sect3">Construction</bridgehead>
  19. <para>
  20. <informaltable frame="all">
  21. <tgroup cols="2">
  22. <thead>
  23. <row>
  24. <entry>Syntax</entry>
  25. <entry>Description</entry>
  26. </row>
  27. </thead>
  28. <tbody>
  29. <row>
  30. <entry valign="top"><screen>time_input_facet()</screen></entry>
  31. <entry>Default constructor</entry>
  32. </row>
  33. <row>
  34. <entry valign="top"><screen>time_input_facet(string_type)</screen></entry>
  35. <entry>Format given will be used for date/time input. All other formats will use their defaults.</entry>
  36. </row>
  37. <row>
  38. <entry valign="top"><screen>time_input_facet(...)
  39. Parameters:
  40. string_type format
  41. format_date_parser_type
  42. special_values_parser_type
  43. period_parser_type
  44. date_gen_parser_type</screen></entry>
  45. <entry>Format given will be used for date/time input. The remaining parameters are parser objects. Further details on these objects can be found <link linkend="date_time.io_objects">here</link>.</entry>
  46. </row>
  47. </tbody>
  48. </tgroup>
  49. </informaltable>
  50. </para>
  51. <anchor id="time_input_facet_accessors" />
  52. <bridgehead renderas="sect3">Accessors</bridgehead>
  53. <para>
  54. The time_input_facet inherits all the public date_input_facet methods. Therefore, the date_input_facet methods are not listed here. Instead, they can be found by following <link linkend="date_time.date_input_facet">this</link> link.
  55. <informaltable frame="all">
  56. <tgroup cols="2">
  57. <thead>
  58. <row>
  59. <entry valign="top" morerows="1">Syntax</entry>
  60. <entry>Description</entry>
  61. </row>
  62. <row>
  63. <entry>Example</entry>
  64. </row>
  65. </thead>
  66. <tbody>
  67. <row>
  68. <entry valign="top" morerows="1"><screen>void set_iso_format()</screen></entry>
  69. <entry>Sets the time format to ISO</entry>
  70. </row>
  71. <row>
  72. <entry><screen>f->set_iso_format();
  73. // "%Y%m%dT%H%M%S%F%q"
  74. "20051225T132536.789-0700"</screen></entry>
  75. </row>
  76. <row>
  77. <entry valign="top" morerows="1"><screen>void set_iso_extended_format()</screen></entry>
  78. <entry>Sets the date format to ISO Extended</entry>
  79. </row>
  80. <row>
  81. <entry><screen>f->set_iso_extended_format();
  82. // "%Y-%m-%d %H:%M:%S%F %Q"
  83. "2005-12-25 13:25:36.789 -07:00"</screen></entry>
  84. </row>
  85. <row>
  86. <entry valign="top" morerows="1"><screen>void time_duration_format(...)
  87. Parameter:
  88. char_type*</screen></entry>
  89. <entry>Sets the time_duration format.</entry>
  90. </row>
  91. <row>
  92. <entry><screen>f->time_duration_format("%H:%M");
  93. // hours and minutes only</screen></entry>
  94. </row>
  95. <row>
  96. <entry valign="top" morerows="1"><screen>InItrT get(...)
  97. Common parameters for all
  98. 'get' functions:
  99. InItrT from
  100. InItrT to
  101. ios_base
  102. Unique parameter for 'get' funcs:
  103. gregorian object</screen></entry>
  104. <entry>There are 3 get functions in the time_input_facet. The common parameters are: an iterator pointing to the begining of the stream, an iterator pointing to the end of the stream, and an ios_base object. Each unique gregorian object has it's own get function. Each unique get function is described below.</entry>
  105. </row>
  106. <row>
  107. <entry><screen></screen></entry>
  108. </row>
  109. <row>
  110. <entry valign="top" morerows="1"><screen>InItrT get(..., ptime)</screen></entry>
  111. <entry>Gets a ptime object from the stream using the format set by <code>format(...)</code> or the default.</entry>
  112. </row>
  113. <row>
  114. <entry><screen>ss.str("2005-Jan-01 13:12:01");
  115. ss >> pt; // default format</screen></entry>
  116. </row>
  117. <row>
  118. <entry valign="top" morerows="1"><screen>InItrT get(..., time_duration)</screen></entry>
  119. <entry>Gets a time_duration object from the stream using the format set by <code>time_duration_format(...)</code> or the default.</entry>
  120. </row>
  121. <row>
  122. <entry><screen>ss.str("01:25:15.000123000");
  123. ss >> td; // default format</screen></entry>
  124. </row>
  125. <row>
  126. <entry valign="top" morerows="1"><screen>InItrT get(..., time_period)</screen></entry>
  127. <entry>Gets a time_period from the stream. The format of the dates/times will use the format set by <code>format(..)</code> or the default date and time format. The type of period (open or closed range) and the delimiters used are those used by the period_parser.</entry>
  128. </row>
  129. <row>
  130. <entry>see the <link linkend="date_time.io_tutorial">tutorial</link> for a complete example.</entry>
  131. </row>
  132. <!-- This should be changed later
  133. <row>
  134. <entry valign="top" morerows="1"><screen>InItrT get_local_time(..., local_date_time)</screen></entry>
  135. <entry>Gets a local_date_time object from the stream using the format set by <code>format(...)</code> or the default.</entry>
  136. </row>
  137. <row>
  138. <entry><screen></screen></entry>
  139. </row>
  140. -->
  141. </tbody>
  142. </tgroup>
  143. </informaltable>
  144. </para>
  145. </section>