| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
|---|
| 4 | <title>Class template gregorian_calendar_base</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#id2479605" title="Header <boost/date_time/gregorian_calendar.hpp>"> |
|---|
| 9 | <link rel="prev" href="var_string_to_int.html" title="Function template var_string_to_int"> |
|---|
| 10 | <link rel="next" href="int_adapter.html" title="Class template int_adapter"> |
|---|
| 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="var_string_to_int.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2479605"><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="int_adapter.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 24 | </div> |
|---|
| 25 | <div class="refentry" lang="en"> |
|---|
| 26 | <a name="gregorian_calendar_base"></a><div class="titlepage"></div> |
|---|
| 27 | <div class="refnamediv"> |
|---|
| 28 | <h2><span class="refentrytitle">Class template gregorian_calendar_base</span></h2> |
|---|
| 29 | <p>boost::date_time::gregorian_calendar_base — An implementation of the Gregorian calendar. </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><<span class="bold"><strong>typename</strong></span> ymd_type_, <span class="bold"><strong>typename</strong></span> date_int_type_> |
|---|
| 33 | <span class="bold"><strong>class</strong></span> gregorian_calendar_base { |
|---|
| 34 | <span class="bold"><strong>public</strong></span>: |
|---|
| 35 | <span class="emphasis"><em>// types</em></span> |
|---|
| 36 | <span class="bold"><strong>typedef</strong></span> ymd_type_ ymd_type; <span class="emphasis"><em>// define a type a date split into components </em></span> |
|---|
| 37 | <span class="bold"><strong>typedef</strong></span> ymd_type::month_type month_type; <span class="emphasis"><em>// define a type for representing months </em></span> |
|---|
| 38 | <span class="bold"><strong>typedef</strong></span> ymd_type::day_type day_type; <span class="emphasis"><em>// define a type for representing days </em></span> |
|---|
| 39 | <span class="bold"><strong>typedef</strong></span> ymd_type::year_type year_type; <span class="emphasis"><em>// Type to hold a stand alone year value (eg: 2002). </em></span> |
|---|
| 40 | <span class="bold"><strong>typedef</strong></span> date_int_type_ date_int_type; <span class="emphasis"><em>// Define the integer type to use for internal calculations. </em></span> |
|---|
| 41 | |
|---|
| 42 | <span class="emphasis"><em>// <a href="gregorian_calendar_base.html#id2406811-bb">public static functions</a></em></span> |
|---|
| 43 | <span class="type"><span class="bold"><strong>unsigned</strong></span> <span class="bold"><strong>short</strong></span></span> <a href="gregorian_calendar_base.html#id2406815-bb">day_of_week</a>(<span class="bold"><strong>const</strong></span> ymd_type &) ; |
|---|
| 44 | <span class="type"><span class="bold"><strong>int</strong></span></span> <a href="gregorian_calendar_base.html#id2426593-bb">week_number</a>(<span class="bold"><strong>const</strong></span> ymd_type &) ; |
|---|
| 45 | <span class="type">date_int_type</span> <a href="gregorian_calendar_base.html#id2400875-bb">day_number</a>(<span class="bold"><strong>const</strong></span> ymd_type &) ; |
|---|
| 46 | <span class="type">date_int_type</span> <a href="gregorian_calendar_base.html#id2485159-bb">julian_day_number</a>(<span class="bold"><strong>const</strong></span> ymd_type &) ; |
|---|
| 47 | <span class="type"><span class="bold"><strong>long</strong></span></span> <a href="gregorian_calendar_base.html#id2418122-bb">modjulian_day_number</a>(<span class="bold"><strong>const</strong></span> ymd_type &) ; |
|---|
| 48 | <span class="type">ymd_type</span> <a href="gregorian_calendar_base.html#id2511677-bb">from_day_number</a>(date_int_type) ; |
|---|
| 49 | <span class="type">ymd_type</span> <a href="gregorian_calendar_base.html#id2463489-bb">from_julian_day_number</a>(date_int_type) ; |
|---|
| 50 | <span class="type">ymd_type</span> <a href="gregorian_calendar_base.html#id2521883-bb">from_modjulian_day_number</a>(<span class="bold"><strong>long</strong></span>) ; |
|---|
| 51 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="gregorian_calendar_base.html#id2407026-bb">is_leap_year</a>(year_type) ; |
|---|
| 52 | <span class="type"><span class="bold"><strong>unsigned</strong></span> <span class="bold"><strong>short</strong></span></span> <a href="gregorian_calendar_base.html#id2529051-bb">end_of_month_day</a>(year_type, month_type) ; |
|---|
| 53 | <span class="type">ymd_type</span> <a href="gregorian_calendar_base.html#id2419898-bb">epoch</a>() ; |
|---|
| 54 | <span class="type"><span class="bold"><strong>unsigned</strong></span> <span class="bold"><strong>short</strong></span></span> <a href="gregorian_calendar_base.html#id2419910-bb">days_in_week</a>() ; |
|---|
| 55 | };</pre></div> |
|---|
| 56 | <div class="refsect1" lang="en"> |
|---|
| 57 | <a name="id2636338"></a><h2>Description</h2> |
|---|
| 58 | <p>This is a parameterized implementation of a proleptic Gregorian Calendar that can be used in the creation of date systems or just to perform calculations. All the methods of this class are static functions, so the intent is to never create instances of this class. |
|---|
| 59 | </p> |
|---|
| 60 | <div class="refsect2" lang="en"> |
|---|
| 61 | <a name="id2636348"></a><h3> |
|---|
| 62 | <a name="id2406811-bb"></a><code class="computeroutput">gregorian_calendar_base</code> public static functions</h3> |
|---|
| 63 | <div class="orderedlist"><ol type="1"> |
|---|
| 64 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>unsigned</strong></span> <span class="bold"><strong>short</strong></span></span> <a name="id2406815-bb"></a>day_of_week(<span class="bold"><strong>const</strong></span> ymd_type & ymd) ;</pre></li> |
|---|
| 65 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>int</strong></span></span> <a name="id2426593-bb"></a>week_number(<span class="bold"><strong>const</strong></span> ymd_type & ymd) ;</pre></li> |
|---|
| 66 | <li><pre class="literallayout"><span class="type">date_int_type</span> <a name="id2400875-bb"></a>day_number(<span class="bold"><strong>const</strong></span> ymd_type & ymd) ;</pre></li> |
|---|
| 67 | <li><pre class="literallayout"><span class="type">date_int_type</span> <a name="id2485159-bb"></a>julian_day_number(<span class="bold"><strong>const</strong></span> ymd_type & ymd) ;</pre></li> |
|---|
| 68 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>long</strong></span></span> <a name="id2418122-bb"></a>modjulian_day_number(<span class="bold"><strong>const</strong></span> ymd_type & ymd) ;</pre></li> |
|---|
| 69 | <li><pre class="literallayout"><span class="type">ymd_type</span> <a name="id2511677-bb"></a>from_day_number(date_int_type ) ;</pre></li> |
|---|
| 70 | <li><pre class="literallayout"><span class="type">ymd_type</span> <a name="id2463489-bb"></a>from_julian_day_number(date_int_type ) ;</pre></li> |
|---|
| 71 | <li><pre class="literallayout"><span class="type">ymd_type</span> <a name="id2521883-bb"></a>from_modjulian_day_number(<span class="bold"><strong>long</strong></span> ) ;</pre></li> |
|---|
| 72 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2407026-bb"></a>is_leap_year(year_type ) ;</pre></li> |
|---|
| 73 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>unsigned</strong></span> <span class="bold"><strong>short</strong></span></span> <a name="id2529051-bb"></a>end_of_month_day(year_type y, month_type m) ;</pre></li> |
|---|
| 74 | <li><pre class="literallayout"><span class="type">ymd_type</span> <a name="id2419898-bb"></a>epoch() ;</pre></li> |
|---|
| 75 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>unsigned</strong></span> <span class="bold"><strong>short</strong></span></span> <a name="id2419910-bb"></a>days_in_week() ;</pre></li> |
|---|
| 76 | </ol></div> |
|---|
| 77 | </div> |
|---|
| 78 | </div> |
|---|
| 79 | </div> |
|---|
| 80 | <table width="100%"><tr> |
|---|
| 81 | <td align="left"></td> |
|---|
| 82 | <td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td> |
|---|
| 83 | </tr></table> |
|---|
| 84 | <hr> |
|---|
| 85 | <div class="spirit-nav"> |
|---|
| 86 | <a accesskey="p" href="var_string_to_int.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2479605"><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="int_adapter.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 87 | </div> |
|---|
| 88 | </body> |
|---|
| 89 | </html> |
|---|