diff options
author | Douglas Gregor <doug.gregor@gmail.com> | 2005-07-31 16:29:54 +0000 |
---|---|---|
committer | Douglas Gregor <doug.gregor@gmail.com> | 2005-07-31 16:29:54 +0000 |
commit | 231e8e0e87a8575e877f9f55c584d41d4f8c01c1 (patch) | |
tree | 8cdc1a47e9b008e8975efd8bba0f7c43367c6a42 /doc/html/nth_kday_of_month.html | |
parent | 242ff8fef1c80acba2252b4fa13ede4949aed059 (diff) | |
download | boost-231e8e0e87a8575e877f9f55c584d41d4f8c01c1.tar.gz |
Add BoostBook-generated HTML docs
[SVN r30339]
Diffstat (limited to 'doc/html/nth_kday_of_month.html')
-rw-r--r-- | doc/html/nth_kday_of_month.html | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/doc/html/nth_kday_of_month.html b/doc/html/nth_kday_of_month.html new file mode 100644 index 0000000000..77ce7a8af4 --- /dev/null +++ b/doc/html/nth_kday_of_month.html @@ -0,0 +1,90 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Class template nth_kday_of_month</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#id1109842" title="Header <boost/date_time/date_generators.hpp>"> +<link rel="prev" href="partial_date.html" title="Class template partial_date"> +<link rel="next" href="first_kday_of_month.html" title="Class template first_kday_of_month"> +</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="partial_date.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id1109842"><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="first_kday_of_month.html"><img src="images/next.png" alt="Next"></a> +</div> +<div class="refentry" lang="en"> +<a name="nth_kday_of_month"></a><div class="titlepage"></div> +<div class="refnamediv"> +<h2><span class="refentrytitle">Class template nth_kday_of_month</span></h2> +<p>boost::date_time::nth_kday_of_month — Useful generator functor for finding holidays. </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><<span class="bold"><strong>typename</strong></span> date_type> +<span class="bold"><strong>class</strong></span> nth_kday_of_month + : : <span class="bold"><strong>public</strong></span> boost::date_time::year_based_generator< date_type > +{ +<span class="bold"><strong>public</strong></span>: + <span class="emphasis"><em>// types</em></span> + <span class="bold"><strong>typedef</strong></span> date_type::calendar_type calendar_type; + <span class="bold"><strong>typedef</strong></span> calendar_type::day_of_week_type day_of_week_type; + <span class="bold"><strong>typedef</strong></span> calendar_type::month_type month_type; + <span class="bold"><strong>typedef</strong></span> calendar_type::year_type year_type; + <span class="bold"><strong>typedef</strong></span> date_type::duration_type duration_type; + + <span class="emphasis"><em>// <a href="nth_kday_of_month.html#nth_kday_of_monthconstruct-copy-destruct">construct/copy/destruct</a></em></span> + <a href="nth_kday_of_month.html#id933193-bb">nth_kday_of_month</a>(week_num, day_of_week_type, month_type); + + <span class="emphasis"><em>// <a href="nth_kday_of_month.html#id899170-bb">public member functions</a></em></span> + <span class="type">date_type</span> <a href="nth_kday_of_month.html#id899175-bb">get_date</a>(year_type) <span class="bold"><strong>const</strong></span>; + <span class="type">month_type</span> <a href="nth_kday_of_month.html#id962849-bb">month</a>() <span class="bold"><strong>const</strong></span>; + <span class="type">week_num</span> <a href="nth_kday_of_month.html#id962861-bb">nth_week</a>() <span class="bold"><strong>const</strong></span>; + <span class="type">day_of_week_type</span> <a href="nth_kday_of_month.html#id800396-bb">day_of_week</a>() <span class="bold"><strong>const</strong></span>; + <span class="type"><span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> *</span> <a href="nth_kday_of_month.html#id1104045-bb">nth_week_as_str</a>() <span class="bold"><strong>const</strong></span>; + <span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a href="nth_kday_of_month.html#id1073625-bb">to_string</a>() <span class="bold"><strong>const</strong></span>; +};</pre></div> +<div class="refsect1" lang="en"> +<a name="id1074613"></a><h2>Description</h2> +<p>Based on the idea in Cal. Calc. for finding holidays that are the 'first Monday of September'. When instantiated with 'fifth' kday of month, the result will be the last kday of month which can be the fourth or fifth depending on the structure of the month.</p> +<p>The algorithm here basically guesses for the first day of the month. Then finds the first day of the correct type. That is, if the first of the month is a Tuesday and it needs Wenesday then we simply increment by a day and then we can add the length of a week until we get to the 'nth kday'. There are probably more efficient algorithms based on using a mod 7, but this one works reasonably well for basic applications. </p> +<div class="refsect2" lang="en"> +<a name="id1074632"></a><h3> +<a name="nth_kday_of_monthconstruct-copy-destruct"></a><code class="computeroutput">nth_kday_of_month</code> construct/copy/destruct</h3> +<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id933193-bb"></a>nth_kday_of_month(week_num week_no, day_of_week_type dow, month_type m);</pre></li></ol></div> +</div> +<div class="refsect2" lang="en"> +<a name="id1074668"></a><h3> +<a name="id899170-bb"></a><code class="computeroutput">nth_kday_of_month</code> public member functions</h3> +<div class="orderedlist"><ol type="1"> +<li><pre class="literallayout"><span class="type">date_type</span> <a name="id899175-bb"></a>get_date(year_type y) <span class="bold"><strong>const</strong></span>;</pre></li> +<li><pre class="literallayout"><span class="type">month_type</span> <a name="id962849-bb"></a>month() <span class="bold"><strong>const</strong></span>;</pre></li> +<li><pre class="literallayout"><span class="type">week_num</span> <a name="id962861-bb"></a>nth_week() <span class="bold"><strong>const</strong></span>;</pre></li> +<li><pre class="literallayout"><span class="type">day_of_week_type</span> <a name="id800396-bb"></a>day_of_week() <span class="bold"><strong>const</strong></span>;</pre></li> +<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> *</span> <a name="id1104045-bb"></a>nth_week_as_str() <span class="bold"><strong>const</strong></span>;</pre></li> +<li> +<pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a name="id1073625-bb"></a>to_string() <span class="bold"><strong>const</strong></span>;</pre> +<p>Returns a string formatted as "M4.3.0" ==> 3rd Sunday in April. </p> +</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="partial_date.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id1109842"><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="first_kday_of_month.html"><img src="images/next.png" alt="Next"></a> +</div> +</body> +</html> |