Files
date_time/doc/date_iterators.html
2002-09-05 17:17:25 +00:00

84 lines
2.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>gregorian::date iterators Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<a href="../../../index.htm">
<img align="left" src="../../../c++boost.gif" alt="C++ Boost">
</a>
<h1>gregorian::date iterators</h1>
<p>&nbsp;</p>
<hr>
<a href="index.html">Overall Index</a> --
<a href="gregorian.html">Gregorian Index</a> --
<a href="posix_time.html">Posix Time Index</a>
<p>
<font class="bold">Date Generators / Algorithms</font>
<p>
<a href="#intro">Introduction</a> --
<a href="#header">Header</a> --
<a href="#classoverview">Class Overview</a>
<p>
<p>
<p>
<h2><a name="intro">Introduction</a></h2>
<p>
Date iterators provide a standard mechanism for iteration through dates.
Date iterators are a model of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>
and can be used to populate collections with dates and other date generation
tasks. For example, the <a href="exp-print_month.html">print month</a> example iterates through all the days in a month and prints them.
<p>
All of the iterators here derive from boost::gregorian::date_iterator.
<p>
<h2><a name="header">Header</a></h2>
<pre>
#include "boost/date_time/gregorian/gregorian.hpp" //include all types plus i/o
or
#include "boost/date_time/gregorian/gregorian_types.hpp" //no i/o just types
</pre>
<p>
<h2><a name="classoverview">Class Overview</a></h2>
<p>
<table border=1 cellspacing=3 cellpadding=3>
<tr><td><b>Class</b></td>
<td><b>Construction Parameters</b></td>
<td><b>Description</b></td></tr>
<tr><td>date_iterator</td>
<td></td>
<td>Common base class for all day level iterators.</td></tr>
<tr><td>day_iterator</td>
<td>date start_date, int day_count=1</td>
<td>Iterate day_count days at a time.</td></tr>
<tr><td>week_iterator</td>
<td>date start_date, int week_offset=1</td>
<td>Iterate week_offset weeks at a time.</td></tr>
<tr><td>month_iterator</td>
<td>date start_date, int month_offset=1</td>
<td>Iterate month_offset months. There are special rules for
handling the end of the month. These are: if start date is last
day of the month, always adjust to last day of the month.
if date is beyond the end of the month (eg: jan 31 + 1 month)
adjust back to end of month.
</td></tr>
<tr><td>year_iterator</td>
<td>date start_date, int year_offset=1</td>
<td>Iterate year_offset years</td></tr>
</table>
<hr><address><small>
<!-- hhmts start -->
Last modified: Thu Sep 5 06:06:41 MST 2002
<!-- hhmts end -->
by <a href="mailto:jeff&#64;crystalclearsoftware.com">Jeff Garland</a> &copy; 2000-2002
</small></address>
</body>
</html>