1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Class template time_facet</title> |
---|
5 | <link rel="stylesheet" href="boostbook.css" type="text/css"> |
---|
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> |
---|
7 | <link rel="start" href="index.html" title="The Boost C++ Libraries"> |
---|
8 | <link rel="up" href="date_time/doxy.html#id2417782" title="Header <boost/date_time/time_facet.hpp>"> |
---|
9 | <link rel="prev" href="time_formats.html" title="Struct template time_formats"> |
---|
10 | <link rel="next" href="time_input_facet.html" title="Class template time_input_facet"> |
---|
11 | </head> |
---|
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
13 | <table cellpadding="2" width="100%"> |
---|
14 | <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td> |
---|
15 | <td align="center"><a href="../../index.htm">Home</a></td> |
---|
16 | <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> |
---|
17 | <td align="center"><a href="../../people/people.htm">People</a></td> |
---|
18 | <td align="center"><a href="../../more/faq.htm">FAQ</a></td> |
---|
19 | <td align="center"><a href="../../more/index.htm">More</a></td> |
---|
20 | </table> |
---|
21 | <hr> |
---|
22 | <div class="spirit-nav"> |
---|
23 | <a accesskey="p" href="time_formats.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2417782"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="time_input_facet.html"><img src="images/next.png" alt="Next"></a> |
---|
24 | </div> |
---|
25 | <div class="refentry" lang="en"> |
---|
26 | <a name="time_facet"></a><div class="titlepage"></div> |
---|
27 | <div class="refnamediv"> |
---|
28 | <h2><span class="refentrytitle">Class template time_facet</span></h2> |
---|
29 | <p>boost::date_time::time_facet — </p> |
---|
30 | </div> |
---|
31 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
---|
32 | <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> time_type, <span class="bold"><strong>typename</strong></span> CharT, |
---|
33 | <span class="bold"><strong>typename</strong></span> OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > |
---|
34 | <span class="bold"><strong>class</strong></span> time_facet : <span class="bold"><strong>public</strong></span> boost::date_time::date_facet< time_type::date_type, CharT, OutItrT > |
---|
35 | { |
---|
36 | <span class="bold"><strong>public</strong></span>: |
---|
37 | <span class="emphasis"><em>// types</em></span> |
---|
38 | <span class="bold"><strong>typedef</strong></span> time_type::date_type date_type; |
---|
39 | <span class="bold"><strong>typedef</strong></span> time_type::time_duration_type time_duration_type; |
---|
40 | <span class="bold"><strong>typedef</strong></span> <a href="period.html" title="Class template period">boost::date_time::period</a>< time_type, time_duration_type > period_type; |
---|
41 | <span class="bold"><strong>typedef</strong></span> <a href="date_facet.html" title="Class template date_facet">boost::date_time::date_facet</a>< <span class="bold"><strong>typename</strong></span> time_type::date_type, CharT, OutItrT > base_type; |
---|
42 | <span class="bold"><strong>typedef</strong></span> base_type::string_type string_type; |
---|
43 | <span class="bold"><strong>typedef</strong></span> base_type::char_type char_type; |
---|
44 | <span class="bold"><strong>typedef</strong></span> base_type::period_formatter_type period_formatter_type; |
---|
45 | <span class="bold"><strong>typedef</strong></span> base_type::special_values_formatter_type special_values_formatter_type; |
---|
46 | <span class="bold"><strong>typedef</strong></span> base_type::date_gen_formatter_type date_gen_formatter_type; |
---|
47 | |
---|
48 | <span class="emphasis"><em>// <a href="time_facet.html#time_facetconstruct-copy-destruct">construct/copy/destruct</a></em></span> |
---|
49 | <a href="time_facet.html#id2451781-bb">time_facet</a>(::size_t = 0); |
---|
50 | <a href="time_facet.html#id2451803-bb">time_facet</a>(<span class="bold"><strong>const</strong></span> char_type *, |
---|
51 | period_formatter_type = period_formatter_type(), |
---|
52 | <span class="bold"><strong>const</strong></span> special_values_formatter_type & = special_values_formatter_type(), |
---|
53 | date_gen_formatter_type = date_gen_formatter_type(), |
---|
54 | ::size_t = 0); |
---|
55 | |
---|
56 | <span class="emphasis"><em>// <a href="time_facet.html#id2442387-bb">public member functions</a></em></span> |
---|
57 | <span class="type">std::locale::id &</span> <a href="time_facet.html#id2442392-bb">__get_id</a>(<span class="bold"><strong>void</strong></span>) <span class="bold"><strong>const</strong></span>; |
---|
58 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="time_facet.html#id2442414-bb">time_duration_format</a>(<span class="bold"><strong>const</strong></span> char_type *<span class="bold"><strong>const</strong></span>) ; |
---|
59 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> <a href="time_facet.html#id2442440-bb">set_iso_format</a>() ; |
---|
60 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> <a href="time_facet.html#id2442452-bb">set_iso_extended_format</a>() ; |
---|
61 | <span class="type">OutItrT</span> <a href="time_facet.html#id2442465-bb">put</a>(OutItrT, std::ios_base &, char_type, <span class="bold"><strong>const</strong></span> time_type &) <span class="bold"><strong>const</strong></span>; |
---|
62 | <span class="type">OutItrT</span> <a href="time_facet.html#id2479271-bb">put</a>(OutItrT, std::ios_base &, char_type, <span class="bold"><strong>const</strong></span> time_duration_type &) <span class="bold"><strong>const</strong></span>; |
---|
63 | <span class="type">OutItrT</span> <a href="time_facet.html#id2479327-bb">put</a>(OutItrT, std::ios_base &, char_type, <span class="bold"><strong>const</strong></span> period_type &) <span class="bold"><strong>const</strong></span>; |
---|
64 | |
---|
65 | <span class="emphasis"><em>// <a href="time_facet.html#id2478751-bb">protected static functions</a></em></span> |
---|
66 | <span class="type">string_type</span> <a href="time_facet.html#id2478756-bb">fractional_seconds_as_string</a>(<span class="bold"><strong>const</strong></span> time_duration_type &, <span class="bold"><strong>bool</strong></span>) ; |
---|
67 | |
---|
68 | <span class="bold"><strong>static</strong></span> const char_type * fractional_seconds_format; |
---|
69 | <span class="bold"><strong>static</strong></span> const char_type * fractional_seconds_or_none_format; |
---|
70 | <span class="bold"><strong>static</strong></span> const char_type * seconds_with_fractional_seconds_format; |
---|
71 | <span class="bold"><strong>static</strong></span> const char_type * seconds_format; |
---|
72 | <span class="bold"><strong>static</strong></span> const char_type * standard_format; |
---|
73 | <span class="bold"><strong>static</strong></span> const char_type * zone_abbrev_format; |
---|
74 | <span class="bold"><strong>static</strong></span> const char_type * zone_name_format; |
---|
75 | <span class="bold"><strong>static</strong></span> const char_type * zone_iso_format; |
---|
76 | <span class="bold"><strong>static</strong></span> const char_type * zone_iso_extended_format; |
---|
77 | <span class="bold"><strong>static</strong></span> const char_type * posix_zone_string_format; |
---|
78 | <span class="bold"><strong>static</strong></span> const char_type * duration_seperator; |
---|
79 | <span class="bold"><strong>static</strong></span> const char_type * duration_sign_always; |
---|
80 | <span class="bold"><strong>static</strong></span> const char_type * duration_sign_negative_only; |
---|
81 | <span class="bold"><strong>static</strong></span> const char_type * negative_sign; |
---|
82 | <span class="bold"><strong>static</strong></span> const char_type * positive_sign; |
---|
83 | <span class="bold"><strong>static</strong></span> const char_type * iso_time_format_specifier; |
---|
84 | <span class="bold"><strong>static</strong></span> const char_type * iso_time_format_extended_specifier; |
---|
85 | <span class="bold"><strong>static</strong></span> const char_type * default_time_format; |
---|
86 | <span class="bold"><strong>static</strong></span> const char_type * default_time_duration_format; |
---|
87 | <span class="bold"><strong>static</strong></span> std::locale::id id; |
---|
88 | };</pre></div> |
---|
89 | <div class="refsect1" lang="en"> |
---|
90 | <a name="id2656501"></a><h2>Description</h2> |
---|
91 | <p>Facet used for format-based output of time types This class provides for the use of format strings to output times. In addition to the flags for formatting date elements, the following are the allowed format flags:</p> |
---|
92 | <div class="itemizedlist"><ul type="disc"> |
---|
93 | <li><p>x X => default format - enables addition of more flags to default (ie. "%x %X %z")</p></li> |
---|
94 | <li><p>f => fractional seconds ".123456"</p></li> |
---|
95 | <li><p>F => fractional seconds or none: like frac sec but empty if frac sec == 0</p></li> |
---|
96 | <li><p>s => seconds w/ fractional sec "02.123" (this is the same as "%S%f)</p></li> |
---|
97 | <li><p>S => seconds "02"</p></li> |
---|
98 | <li><p>z => abbreviated time zone "EDT"</p></li> |
---|
99 | <li><p>Z => full time zone name "Eastern Daylight Time" </p></li> |
---|
100 | </ul></div> |
---|
101 | <div class="refsect2" lang="en"> |
---|
102 | <a name="id2656548"></a><h3> |
---|
103 | <a name="time_facetconstruct-copy-destruct"></a><code class="computeroutput">time_facet</code> construct/copy/destruct</h3> |
---|
104 | <div class="orderedlist"><ol type="1"> |
---|
105 | <li><pre class="literallayout"><a name="id2451781-bb"></a>time_facet(::size_t a_ref = 0);</pre></li> |
---|
106 | <li><pre class="literallayout"><a name="id2451803-bb"></a>time_facet(<span class="bold"><strong>const</strong></span> char_type * a_format, |
---|
107 | period_formatter_type period_formatter = period_formatter_type(), |
---|
108 | <span class="bold"><strong>const</strong></span> special_values_formatter_type & special_value_formatter = special_values_formatter_type(), |
---|
109 | date_gen_formatter_type dg_formatter = date_gen_formatter_type(), |
---|
110 | ::size_t a_ref = 0);</pre></li> |
---|
111 | </ol></div> |
---|
112 | </div> |
---|
113 | <div class="refsect2" lang="en"> |
---|
114 | <a name="id2656615"></a><h3> |
---|
115 | <a name="id2442387-bb"></a><code class="computeroutput">time_facet</code> public member functions</h3> |
---|
116 | <div class="orderedlist"><ol type="1"> |
---|
117 | <li><pre class="literallayout"><span class="type">std::locale::id &</span> <a name="id2442392-bb"></a>__get_id(<span class="bold"><strong>void</strong></span> ) <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
118 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2442414-bb"></a>time_duration_format(<span class="bold"><strong>const</strong></span> char_type *<span class="bold"><strong>const</strong></span> format) ;</pre></li> |
---|
119 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> <a name="id2442440-bb"></a>set_iso_format() ;</pre></li> |
---|
120 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>void</strong></span></span> <a name="id2442452-bb"></a>set_iso_extended_format() ;</pre></li> |
---|
121 | <li><pre class="literallayout"><span class="type">OutItrT</span> <a name="id2442465-bb"></a>put(OutItrT a_next, std::ios_base & a_ios, char_type a_fill, |
---|
122 | <span class="bold"><strong>const</strong></span> time_type & a_time) <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
123 | <li><pre class="literallayout"><span class="type">OutItrT</span> <a name="id2479271-bb"></a>put(OutItrT a_next, std::ios_base & a_ios, char_type a_fill, |
---|
124 | <span class="bold"><strong>const</strong></span> time_duration_type & a_time_dur) <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
125 | <li><pre class="literallayout"><span class="type">OutItrT</span> <a name="id2479327-bb"></a>put(OutItrT next, std::ios_base & a_ios, char_type fill, |
---|
126 | <span class="bold"><strong>const</strong></span> period_type & p) <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
127 | </ol></div> |
---|
128 | </div> |
---|
129 | <div class="refsect2" lang="en"> |
---|
130 | <a name="id2656847"></a><h3> |
---|
131 | <a name="id2478751-bb"></a><code class="computeroutput">time_facet</code> protected static functions</h3> |
---|
132 | <div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="type">string_type</span> <a name="id2478756-bb"></a>fractional_seconds_as_string(<span class="bold"><strong>const</strong></span> time_duration_type & a_time, |
---|
133 | <span class="bold"><strong>bool</strong></span> null_when_zero) ;</pre></li></ol></div> |
---|
134 | </div> |
---|
135 | </div> |
---|
136 | </div> |
---|
137 | <table width="100%"><tr> |
---|
138 | <td align="left"></td> |
---|
139 | <td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td> |
---|
140 | </tr></table> |
---|
141 | <hr> |
---|
142 | <div class="spirit-nav"> |
---|
143 | <a accesskey="p" href="time_formats.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2417782"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="time_input_facet.html"><img src="images/next.png" alt="Next"></a> |
---|
144 | </div> |
---|
145 | </body> |
---|
146 | </html> |
---|