Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/doc/html/months_duration.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 12.4 KB
Line 
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>Class template months_duration</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#id2442047" title="Header &lt;boost/date_time/date_duration_types.hpp&gt;">
9<link rel="prev" href="weeks_duration.html" title="Class template weeks_duration">
10<link rel="next" href="years_duration.html" title="Class template years_duration">
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="weeks_duration.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2442047"><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="years_duration.html"><img src="images/next.png" alt="Next"></a>
24</div>
25<div class="refentry" lang="en">
26<a name="months_duration"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Class template months_duration</span></h2>
29<p>boost::date_time::months_duration &#8212; additional duration type that represents a logical month </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>&lt;<span class="bold"><strong>typename</strong></span> base_config&gt; 
33<span class="bold"><strong>class</strong></span> months_duration {
34<span class="bold"><strong>public</strong></span>:
35  <span class="emphasis"><em>// <a href="months_duration.html#months_durationconstruct-copy-destruct">construct/copy/destruct</a></em></span>
36  <a href="months_duration.html#id2396284-bb">months_duration</a>(int_rep);
37  <a href="months_duration.html#id2440140-bb">months_duration</a>(special_values);
38
39  <span class="emphasis"><em>// <a href="months_duration.html#id2527587-bb">public member functions</a></em></span>
40  <span class="type">int_rep</span> <a href="months_duration.html#id2527590-bb">number_of_months</a>() <span class="bold"><strong>const</strong></span>;
41  <span class="type">duration_type</span> <a href="months_duration.html#id2520797-bb">get_neg_offset</a>(<span class="bold"><strong>const</strong></span> date_type &amp;) <span class="bold"><strong>const</strong></span>;
42  <span class="type">duration_type</span> <a href="months_duration.html#id2510313-bb">get_offset</a>(<span class="bold"><strong>const</strong></span> date_type &amp;) <span class="bold"><strong>const</strong></span>;
43  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="months_duration.html#id2393099-bb"><span class="bold"><strong>operator</strong></span>==</a>(<span class="bold"><strong>const</strong></span> months_type &amp;) <span class="bold"><strong>const</strong></span>;
44  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="months_duration.html#id2384126-bb"><span class="bold"><strong>operator</strong></span>!=</a>(<span class="bold"><strong>const</strong></span> months_type &amp;) <span class="bold"><strong>const</strong></span>;
45  <span class="type">months_type</span> <a href="months_duration.html#id2519169-bb"><span class="bold"><strong>operator</strong></span>+</a>(<span class="bold"><strong>const</strong></span> months_type &amp;) <span class="bold"><strong>const</strong></span>;
46  <span class="type">months_type &amp;</span> <a href="months_duration.html#id2495468-bb"><span class="bold"><strong>operator</strong></span>+=</a>(<span class="bold"><strong>const</strong></span> months_type &amp;) ;
47  <span class="type">months_type</span> <a href="months_duration.html#id2527886-bb"><span class="bold"><strong>operator</strong></span>-</a>(<span class="bold"><strong>const</strong></span> months_type &amp;) <span class="bold"><strong>const</strong></span>;
48  <span class="type">months_type &amp;</span> <a href="months_duration.html#id2412028-bb"><span class="bold"><strong>operator</strong></span>-=</a>(<span class="bold"><strong>const</strong></span> months_type &amp;) ;
49  <span class="type">months_type</span> <a href="months_duration.html#id2384936-bb"><span class="bold"><strong>operator</strong></span> *</a>(<span class="bold"><strong>const</strong></span> int_type) <span class="bold"><strong>const</strong></span>;
50  <span class="type">months_type &amp;</span> <a href="months_duration.html#id2446048-bb"><span class="bold"><strong>operator</strong></span> *=</a>(<span class="bold"><strong>const</strong></span> int_type) ;
51  <span class="type">months_type</span> <a href="months_duration.html#id2493050-bb"><span class="bold"><strong>operator</strong></span>/</a>(<span class="bold"><strong>const</strong></span> int_type) <span class="bold"><strong>const</strong></span>;
52  <span class="type">months_type &amp;</span> <a href="months_duration.html#id2439300-bb"><span class="bold"><strong>operator</strong></span>/=</a>(<span class="bold"><strong>const</strong></span> int_type) ;
53  <span class="type">months_type</span> <a href="months_duration.html#id2470026-bb"><span class="bold"><strong>operator</strong></span>+</a>(<span class="bold"><strong>const</strong></span> years_type &amp;) <span class="bold"><strong>const</strong></span>;
54  <span class="type">months_type &amp;</span> <a href="months_duration.html#id2496333-bb"><span class="bold"><strong>operator</strong></span>+=</a>(<span class="bold"><strong>const</strong></span> years_type &amp;) ;
55  <span class="type">months_type</span> <a href="months_duration.html#id2372990-bb"><span class="bold"><strong>operator</strong></span>-</a>(<span class="bold"><strong>const</strong></span> years_type &amp;) <span class="bold"><strong>const</strong></span>;
56  <span class="type">months_type &amp;</span> <a href="months_duration.html#id2525425-bb"><span class="bold"><strong>operator</strong></span>-=</a>(<span class="bold"><strong>const</strong></span> years_type &amp;) ;
57};</pre></div>
58<div class="refsect1" lang="en">
59<a name="id2611736"></a><h2>Description</h2>
60<p>A logical month enables things like: "date(2002,Mar,2) + months(2) -&gt; 2002-May2". If the date is a last day-of-the-month, the result will also be a last-day-of-the-month. </p>
61<div class="refsect2" lang="en">
62<a name="id2611750"></a><h3>
63<a name="months_durationconstruct-copy-destruct"></a><code class="computeroutput">months_duration</code> construct/copy/destruct</h3>
64<div class="orderedlist"><ol type="1">
65<li><pre class="literallayout"><a name="id2396284-bb"></a>months_duration(int_rep num);</pre></li>
66<li><pre class="literallayout"><a name="id2440140-bb"></a>months_duration(special_values sv);</pre></li>
67</ol></div>
68</div>
69<div class="refsect2" lang="en">
70<a name="id2611798"></a><h3>
71<a name="id2527587-bb"></a><code class="computeroutput">months_duration</code> public member functions</h3>
72<div class="orderedlist"><ol type="1">
73<li><pre class="literallayout"><span class="type">int_rep</span> <a name="id2527590-bb"></a>number_of_months() <span class="bold"><strong>const</strong></span>;</pre></li>
74<li><pre class="literallayout"><span class="type">duration_type</span> <a name="id2520797-bb"></a>get_neg_offset(<span class="bold"><strong>const</strong></span> date_type &amp; d) <span class="bold"><strong>const</strong></span>;</pre></li>
75<li><pre class="literallayout"><span class="type">duration_type</span> <a name="id2510313-bb"></a>get_offset(<span class="bold"><strong>const</strong></span> date_type &amp; d) <span class="bold"><strong>const</strong></span>;</pre></li>
76<li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2393099-bb"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> months_type &amp; rhs) <span class="bold"><strong>const</strong></span>;</pre></li>
77<li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2384126-bb"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> months_type &amp; rhs) <span class="bold"><strong>const</strong></span>;</pre></li>
78<li><pre class="literallayout"><span class="type">months_type</span> <a name="id2519169-bb"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> months_type &amp; rhs) <span class="bold"><strong>const</strong></span>;</pre></li>
79<li><pre class="literallayout"><span class="type">months_type &amp;</span> <a name="id2495468-bb"></a><span class="bold"><strong>operator</strong></span>+=(<span class="bold"><strong>const</strong></span> months_type &amp; rhs) ;</pre></li>
80<li><pre class="literallayout"><span class="type">months_type</span> <a name="id2527886-bb"></a><span class="bold"><strong>operator</strong></span>-(<span class="bold"><strong>const</strong></span> months_type &amp; rhs) <span class="bold"><strong>const</strong></span>;</pre></li>
81<li><pre class="literallayout"><span class="type">months_type &amp;</span> <a name="id2412028-bb"></a><span class="bold"><strong>operator</strong></span>-=(<span class="bold"><strong>const</strong></span> months_type &amp; rhs) ;</pre></li>
82<li><pre class="literallayout"><span class="type">months_type</span> <a name="id2384936-bb"></a><span class="bold"><strong>operator</strong></span> *(<span class="bold"><strong>const</strong></span> int_type rhs) <span class="bold"><strong>const</strong></span>;</pre></li>
83<li><pre class="literallayout"><span class="type">months_type &amp;</span> <a name="id2446048-bb"></a><span class="bold"><strong>operator</strong></span> *=(<span class="bold"><strong>const</strong></span> int_type rhs) ;</pre></li>
84<li><pre class="literallayout"><span class="type">months_type</span> <a name="id2493050-bb"></a><span class="bold"><strong>operator</strong></span>/(<span class="bold"><strong>const</strong></span> int_type rhs) <span class="bold"><strong>const</strong></span>;</pre></li>
85<li><pre class="literallayout"><span class="type">months_type &amp;</span> <a name="id2439300-bb"></a><span class="bold"><strong>operator</strong></span>/=(<span class="bold"><strong>const</strong></span> int_type rhs) ;</pre></li>
86<li><pre class="literallayout"><span class="type">months_type</span> <a name="id2470026-bb"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> years_type &amp; y) <span class="bold"><strong>const</strong></span>;</pre></li>
87<li><pre class="literallayout"><span class="type">months_type &amp;</span> <a name="id2496333-bb"></a><span class="bold"><strong>operator</strong></span>+=(<span class="bold"><strong>const</strong></span> years_type &amp; y) ;</pre></li>
88<li><pre class="literallayout"><span class="type">months_type</span> <a name="id2372990-bb"></a><span class="bold"><strong>operator</strong></span>-(<span class="bold"><strong>const</strong></span> years_type &amp; y) <span class="bold"><strong>const</strong></span>;</pre></li>
89<li><pre class="literallayout"><span class="type">months_type &amp;</span> <a name="id2525425-bb"></a><span class="bold"><strong>operator</strong></span>-=(<span class="bold"><strong>const</strong></span> years_type &amp; y) ;</pre></li>
90</ol></div>
91</div>
92</div>
93</div>
94<table width="100%"><tr>
95<td align="left"></td>
96<td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td>
97</tr></table>
98<hr>
99<div class="spirit-nav">
100<a accesskey="p" href="weeks_duration.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2442047"><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="years_duration.html"><img src="images/next.png" alt="Next"></a>
101</div>
102</body>
103</html>
Note: See TracBrowser for help on using the repository browser.