summaryrefslogtreecommitdiff
path: root/doc/html/months_duration.html
blob: 2a7e76a76155225f970aabb710586dea6767e887 (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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Class template months_duration</title>
<link rel="stylesheet" href="boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="The Boost C++ Libraries">
<link rel="up" href="date_time/doxy.html#id2442047" title="Header &lt;boost/date_time/date_duration_types.hpp&gt;">
<link rel="prev" href="weeks_duration.html" title="Class template weeks_duration">
<link rel="next" href="years_duration.html" title="Class template years_duration">
</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="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>
</div>
<div class="refentry" lang="en">
<a name="months_duration"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template months_duration</span></h2>
<p>boost::date_time::months_duration &#8212; additional duration type that represents a logical month </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> base_config&gt; 
<span class="bold"><strong>class</strong></span> months_duration {
<span class="bold"><strong>public</strong></span>:
  <span class="emphasis"><em>// <a href="months_duration.html#months_durationconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="months_duration.html#id2396284-bb">months_duration</a>(int_rep);
  <a href="months_duration.html#id2440140-bb">months_duration</a>(special_values);

  <span class="emphasis"><em>// <a href="months_duration.html#id2527587-bb">public member functions</a></em></span>
  <span class="type">int_rep</span> <a href="months_duration.html#id2527590-bb">number_of_months</a>() <span class="bold"><strong>const</strong></span>;
  <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>;
  <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>;
  <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>;
  <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>;
  <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>;
  <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;) ;
  <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>;
  <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;) ;
  <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>;
  <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) ;
  <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>;
  <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) ;
  <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>;
  <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;) ;
  <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>;
  <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;) ;
};</pre></div>
<div class="refsect1" lang="en">
<a name="id2611736"></a><h2>Description</h2>
<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>
<div class="refsect2" lang="en">
<a name="id2611750"></a><h3>
<a name="months_durationconstruct-copy-destruct"></a><code class="computeroutput">months_duration</code> construct/copy/destruct</h3>
<div class="orderedlist"><ol type="1">
<li><pre class="literallayout"><a name="id2396284-bb"></a>months_duration(int_rep num);</pre></li>
<li><pre class="literallayout"><a name="id2440140-bb"></a>months_duration(special_values sv);</pre></li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2611798"></a><h3>
<a name="id2527587-bb"></a><code class="computeroutput">months_duration</code> public member functions</h3>
<div class="orderedlist"><ol type="1">
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
</ol></div>
</div>
</div>
</div>
<table 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="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>
</div>
</body>
</html>