summaryrefslogtreecommitdiff
path: root/doc/html/date_generator_formatter.html
blob: 106abab6237c50c8518d89c381127f274a96cfe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Class template date_generator_formatter</title>
<link rel="stylesheet" href="boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="The Boost C++ Libraries">
<link rel="up" href="date_time/doxy.html#id899283" title="Header &lt;boost/date_time/date_generator_formatter.hpp&gt;">
<link rel="prev" href="ostream_date_formatter.html" title="Class template ostream_date_formatter">
<link rel="next" href="date_generator_parser.html" title="Class template date_generator_parser">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.htm">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="../../people/people.htm">People</a></td>
<td align="center"><a href="../../more/faq.htm">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ostream_date_formatter.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id899283"><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="date_generator_parser.html"><img src="images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="date_generator_formatter"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template date_generator_formatter</span></h2>
<p>boost::date_time::date_generator_formatter &#8212; Formats date_generators for output. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<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>&lt;<span class="bold"><strong>typename</strong></span> date_type, <span class="bold"><strong>typename</strong></span> CharT, 
         <span class="bold"><strong>typename</strong></span> OutItrT = std::ostreambuf_iterator&lt;CharT, std::char_traits&lt;CharT&gt; &gt; &gt; 
<span class="bold"><strong>class</strong></span> date_generator_formatter {
<span class="bold"><strong>public</strong></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><strong>typedef</strong></span> <a href="partial_date.html" title="Class template partial_date">partial_date</a>&lt; date_type &gt;        partial_date_type;
  <span class="bold"><strong>typedef</strong></span> <a href="nth_kday_of_month.html" title="Class template nth_kday_of_month">nth_kday_of_month</a>&lt; date_type &gt;   nth_kday_type;    
  <span class="bold"><strong>typedef</strong></span> <a href="first_kday_of_month.html" title="Class template first_kday_of_month">first_kday_of_month</a>&lt; date_type &gt; first_kday_type;  
  <span class="bold"><strong>typedef</strong></span> <a href="last_kday_of_month.html" title="Class template last_kday_of_month">last_kday_of_month</a>&lt; date_type &gt;  last_kday_type;   
  <span class="bold"><strong>typedef</strong></span> <a href="first_kday_after.html" title="Class template first_kday_after">first_kday_after</a>&lt; date_type &gt;    kday_after_type;  
  <span class="bold"><strong>typedef</strong></span> <a href="first_kday_before.html" title="Class template first_kday_before">first_kday_before</a>&lt; date_type &gt;   kday_before_type; 
  <span class="bold"><strong>typedef</strong></span> CharT                            char_type;        
  <span class="bold"><strong>typedef</strong></span> std::basic_string&lt; char_type &gt;   string_type;      
  <span class="bold"><strong>typedef</strong></span> std::vector&lt; string_type &gt;       collection_type;  

  <span class="emphasis"><em>// <a href="date_generator_formatter.html#date_generator_formatterconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="date_generator_formatter.html#id1110027-bb">date_generator_formatter</a>();
  <a href="date_generator_formatter.html#id961419-bb">date_generator_formatter</a>(<span class="bold"><strong>const</strong></span> string_type &amp;, <span class="bold"><strong>const</strong></span> string_type &amp;, 
                           <span class="bold"><strong>const</strong></span> string_type &amp;, <span class="bold"><strong>const</strong></span> string_type &amp;, 
                           <span class="bold"><strong>const</strong></span> string_type &amp;, <span class="bold"><strong>const</strong></span> string_type &amp;, 
                           <span class="bold"><strong>const</strong></span> string_type &amp;, <span class="bold"><strong>const</strong></span> string_type &amp;, 
                           <span class="bold"><strong>const</strong></span> string_type &amp;);

  <span class="emphasis"><em>// <a href="date_generator_formatter.html#id973485-bb">public member functions</a></em></span>
  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="date_generator_formatter.html#id901972-bb">elements</a>(<span class="bold"><strong>const</strong></span> collection_type &amp;, phrase_elements = first) ;
  <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
    <span class="type">OutItrT</span> <a href="date_generator_formatter.html#id835566-bb">put_partial_date</a>(OutItrT, std::ios_base &amp;, CharT, 
                             <span class="bold"><strong>const</strong></span> partial_date_type &amp;, <span class="bold"><strong>const</strong></span> facet_type &amp;) <span class="bold"><strong>const</strong></span>;
  <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
    <span class="type">OutItrT</span> <a href="date_generator_formatter.html#id858210-bb">put_nth_kday</a>(OutItrT, std::ios_base &amp;, CharT, 
                         <span class="bold"><strong>const</strong></span> nth_kday_type &amp;, <span class="bold"><strong>const</strong></span> facet_type &amp;) <span class="bold"><strong>const</strong></span>;
  <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
    <span class="type">OutItrT</span> <a href="date_generator_formatter.html#id1042356-bb">put_first_kday</a>(OutItrT, std::ios_base &amp;, CharT, 
                           <span class="bold"><strong>const</strong></span> first_kday_type &amp;, <span class="bold"><strong>const</strong></span> facet_type &amp;) <span class="bold"><strong>const</strong></span>;
  <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
    <span class="type">OutItrT</span> <a href="date_generator_formatter.html#id800050-bb">put_last_kday</a>(OutItrT, std::ios_base &amp;, CharT, 
                          <span class="bold"><strong>const</strong></span> last_kday_type &amp;, <span class="bold"><strong>const</strong></span> facet_type &amp;) <span class="bold"><strong>const</strong></span>;
  <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
    <span class="type">OutItrT</span> <a href="date_generator_formatter.html#id821874-bb">put_kday_before</a>(OutItrT, std::ios_base &amp;, CharT, 
                            <span class="bold"><strong>const</strong></span> kday_before_type &amp;, <span class="bold"><strong>const</strong></span> facet_type &amp;) <span class="bold"><strong>const</strong></span>;
  <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
    <span class="type">OutItrT</span> <a href="date_generator_formatter.html#id1113326-bb">put_kday_after</a>(OutItrT, std::ios_base &amp;, CharT, 
                           <span class="bold"><strong>const</strong></span> kday_after_type &amp;, <span class="bold"><strong>const</strong></span> facet_type &amp;) <span class="bold"><strong>const</strong></span>;

  <span class="emphasis"><em>// <a href="date_generator_formatter.html#id1033341-bb">private member functions</a></em></span>
  <span class="type">OutItrT</span> <a href="date_generator_formatter.html#id836227-bb">put_string</a>(OutItrT, <span class="bold"><strong>const</strong></span> string_type &amp;) <span class="bold"><strong>const</strong></span>;

  <span class="bold"><strong>static</strong></span> const char_type first_string;
  <span class="bold"><strong>static</strong></span> const char_type second_string;
  <span class="bold"><strong>static</strong></span> const char_type third_string;
  <span class="bold"><strong>static</strong></span> const char_type fourth_string;
  <span class="bold"><strong>static</strong></span> const char_type fifth_string;
  <span class="bold"><strong>static</strong></span> const char_type last_string;
  <span class="bold"><strong>static</strong></span> const char_type before_string;
  <span class="bold"><strong>static</strong></span> const char_type after_string;
  <span class="bold"><strong>static</strong></span> const char_type of_string;
};</pre></div>
<div class="refsect1" lang="en">
<a name="id1071018"></a><h2>Description</h2>
<p>Formatting of date_generators follows specific orders for the various types of date_generators.</p>
<div class="itemizedlist"><ul type="disc">
<li><p>partial_date =&gt; "dd Month"</p></li>
<li><p>nth_day_of_the_week_in_month =&gt; "nth weekday of month"</p></li>
<li><p>first_day_of_the_week_in_month =&gt; "first weekday of month"</p></li>
<li><p>last_day_of_the_week_in_month =&gt; "last weekday of month"</p></li>
<li><p>first_day_of_the_week_after =&gt; "weekday after"</p></li>
<li><p>first_day_of_the_week_before =&gt; "weekday before" While the order of the elements in these phrases cannot be changed, the elements themselves can be. Weekday and Month get their formats and names from the date_facet. The remaining elements are stored in the date_generator_formatter and can be customized upon construction or via a member function. The default elements are those shown in the examples above. </p></li>
</ul></div>
<div class="refsect2" lang="en">
<a name="id1071052"></a><h3>
<a name="date_generator_formatterconstruct-copy-destruct"></a><code class="computeroutput">date_generator_formatter</code> construct/copy/destruct</h3>
<div class="orderedlist"><ol type="1">
<li><pre class="literallayout"><a name="id1110027-bb"></a>date_generator_formatter();</pre></li>
<li><pre class="literallayout"><a name="id961419-bb"></a>date_generator_formatter(<span class="bold"><strong>const</strong></span> string_type &amp; first, 
                         <span class="bold"><strong>const</strong></span> string_type &amp; second, 
                         <span class="bold"><strong>const</strong></span> string_type &amp; third, 
                         <span class="bold"><strong>const</strong></span> string_type &amp; fourth, 
                         <span class="bold"><strong>const</strong></span> string_type &amp; fifth, <span class="bold"><strong>const</strong></span> string_type &amp; last, 
                         <span class="bold"><strong>const</strong></span> string_type &amp; before, 
                         <span class="bold"><strong>const</strong></span> string_type &amp; after, <span class="bold"><strong>const</strong></span> string_type &amp; of);</pre></li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id1071165"></a><h3>
<a name="id973485-bb"></a><code class="computeroutput">date_generator_formatter</code> public member functions</h3>
<div class="orderedlist"><ol type="1">
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id901972-bb"></a>elements(<span class="bold"><strong>const</strong></span> collection_type &amp; new_strings, 
              phrase_elements beg_pos = first) ;</pre>
<p>The order of the strings in the given collection is important. They must follow:</p>
<div class="itemizedlist"><ul type="disc"><li><p>first, second, third, fourth, fifth, last, before, after, of.</p></li></ul></div>
<p>It is not necessary to send in a complete set if only a few elements are to be replaced as long as the correct beg_pos is used.</p>
<p>Ex: To keep the default first through fifth elements, but replace the rest with a collection of:</p>
<div class="itemizedlist"><ul type="disc"><li><p>"final", "prior", "following", "in". The beg_pos of date_generator_formatter::last would be used. </p></li></ul></div>
</li>
<li><pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
  <span class="type">OutItrT</span> <a name="id835566-bb"></a>put_partial_date(OutItrT next, std::ios_base &amp; a_ios, CharT a_fill, 
                           <span class="bold"><strong>const</strong></span> partial_date_type &amp; pd, 
                           <span class="bold"><strong>const</strong></span> facet_type &amp; facet) <span class="bold"><strong>const</strong></span>;</pre></li>
<li><pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
  <span class="type">OutItrT</span> <a name="id858210-bb"></a>put_nth_kday(OutItrT next, std::ios_base &amp; a_ios, CharT a_fill, 
                       <span class="bold"><strong>const</strong></span> nth_kday_type &amp; nkd, <span class="bold"><strong>const</strong></span> facet_type &amp; facet) <span class="bold"><strong>const</strong></span>;</pre></li>
<li><pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
  <span class="type">OutItrT</span> <a name="id1042356-bb"></a>put_first_kday(OutItrT next, std::ios_base &amp; a_ios, CharT a_fill, 
                         <span class="bold"><strong>const</strong></span> first_kday_type &amp; fkd, 
                         <span class="bold"><strong>const</strong></span> facet_type &amp; facet) <span class="bold"><strong>const</strong></span>;</pre></li>
<li><pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
  <span class="type">OutItrT</span> <a name="id800050-bb"></a>put_last_kday(OutItrT next, std::ios_base &amp; a_ios, CharT a_fill, 
                        <span class="bold"><strong>const</strong></span> last_kday_type &amp; lkd, <span class="bold"><strong>const</strong></span> facet_type &amp; facet) <span class="bold"><strong>const</strong></span>;</pre></li>
<li><pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
  <span class="type">OutItrT</span> <a name="id821874-bb"></a>put_kday_before(OutItrT next, std::ios_base &amp; a_ios, CharT a_fill, 
                          <span class="bold"><strong>const</strong></span> kday_before_type &amp; fkb, 
                          <span class="bold"><strong>const</strong></span> facet_type &amp; facet) <span class="bold"><strong>const</strong></span>;</pre></li>
<li><pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> facet_type&gt; 
  <span class="type">OutItrT</span> <a name="id1113326-bb"></a>put_kday_after(OutItrT next, std::ios_base &amp; a_ios, CharT a_fill, 
                         <span class="bold"><strong>const</strong></span> kday_after_type &amp; fka, 
                         <span class="bold"><strong>const</strong></span> facet_type &amp; facet) <span class="bold"><strong>const</strong></span>;</pre></li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id1071540"></a><h3>
<a name="id1033341-bb"></a><code class="computeroutput">date_generator_formatter</code> private member functions</h3>
<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="type">OutItrT</span> <a name="id836227-bb"></a>put_string(OutItrT next, <span class="bold"><strong>const</strong></span> string_type &amp; str) <span class="bold"><strong>const</strong></span>;</pre></li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ostream_date_formatter.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id899283"><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="date_generator_parser.html"><img src="images/next.png" alt="Next"></a>
</div>
</body>
</html>