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">
5 <!-- Copyright (c) 2005 CrystalClear Software, Inc.
6 Subject to the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
10 <section id=
"date_time.time_input_facet">
11 <title>Time Input Facet
</title>
13 <link linkend=
"time_input_facet_intro">Introduction
</link> -
14 <link linkend=
"time_input_facet_constr">Construction
</link> -
15 <link linkend=
"time_input_facet_accessors">Accessors
</link>
17 <anchor id=
"time_input_facet_intro" />
18 <bridgehead renderas=
"sect3">Introduction
</bridgehead>
19 <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>.
22 <anchor id=
"time_input_facet_constr" />
23 <bridgehead renderas=
"sect3">Construction
</bridgehead>
25 <informaltable frame=
"all">
30 <entry>Description
</entry>
35 <entry valign=
"top"><screen>time_input_facet()
</screen></entry>
36 <entry>Default constructor
</entry>
39 <entry valign=
"top"><screen>time_input_facet(string_type)
</screen></entry>
40 <entry>Format given will be used for date/time input. All other formats will use their defaults.
</entry>
43 <entry valign=
"top"><screen>time_input_facet(...)
46 format_date_parser_type
47 special_values_parser_type
49 date_gen_parser_type
</screen></entry>
50 <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>
57 <anchor id=
"time_input_facet_accessors" />
58 <bridgehead renderas=
"sect3">Accessors
</bridgehead>
60 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.
61 <informaltable frame=
"all">
65 <entry valign=
"top" morerows=
"1">Syntax
</entry>
66 <entry>Description
</entry>
69 <entry>Example
</entry>
75 <entry valign=
"top" morerows=
"1"><screen>void set_iso_format()
</screen></entry>
76 <entry>Sets the time format to ISO
</entry>
79 <entry><screen>f-
>set_iso_format();
80 //
"%Y%m%dT%H%M%S%F%q"
81 "20051225T132536.789-0700"</screen></entry>
85 <entry valign=
"top" morerows=
"1"><screen>void set_iso_extended_format()
</screen></entry>
86 <entry>Sets the date format to ISO Extended
</entry>
89 <entry><screen>f-
>set_iso_extended_format();
90 //
"%Y-%m-%d %H:%M:%S%F %Q"
91 "2005-12-25 13:25:36.789 -07:00"</screen></entry>
95 <entry valign=
"top" morerows=
"1"><screen>void time_duration_format(...)
97 char_type*
</screen></entry>
98 <entry>Sets the time_duration format.
</entry>
101 <entry><screen>f-
>time_duration_format(
"%H:%M");
102 // hours and minutes only
</screen></entry>
107 <entry valign=
"top" morerows=
"1"><screen>InItrT get(...)
108 Common parameters for all
113 Unique parameter for 'get' funcs:
114 gregorian object
</screen></entry>
115 <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>
118 <entry><screen></screen></entry>
122 <entry valign=
"top" morerows=
"1"><screen>InItrT get(..., ptime)
</screen></entry>
123 <entry>Gets a ptime object from the stream using the format set by
<code>format(...)
</code> or the default.
</entry>
126 <entry><screen>ss.str(
"2005-Jan-01 13:12:01");
127 ss
>> pt; // default format
</screen></entry>
131 <entry valign=
"top" morerows=
"1"><screen>InItrT get(..., time_duration)
</screen></entry>
132 <entry>Gets a time_duration object from the stream using the format set by
<code>time_duration_format(...)
</code> or the default.
</entry>
135 <entry><screen>ss.str(
"01:25:15.000123000");
136 ss
>> td; // default format
</screen></entry>
140 <entry valign=
"top" morerows=
"1"><screen>InItrT get(..., time_period)
</screen></entry>
141 <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>
144 <entry>see the
<link linkend=
"date_time.io_tutorial">tutorial
</link> for a complete example.
</entry>
147 <!-- This should be changed later
149 <entry valign="top" morerows="1"><screen>InItrT get_local_time(..., local_date_time)</screen></entry>
150 <entry>Gets a local_date_time object from the stream using the format set by <code>format(...)</code> or the default.</entry>
153 <entry><screen></screen></entry>