Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::gregorian::gregorian_calendar Class Reference

Gregorian calendar for this implementation, hard work in the base. More...

#include <greg_calendar.hpp>

Inheritance diagram for boost::gregorian::gregorian_calendar:
Collaboration diagram for boost::gregorian::gregorian_calendar:

Public Types

typedef greg_weekday day_of_week_type
 Type to hold a weekday (eg: Sunday, Monday,...) More...
 
typedef greg_day_of_year_rep day_of_year_type
 Counter type from 1 to 366 for gregorian dates. More...
 
typedef fancy_date_rep date_rep_type
 Internal date representation that handles infinity, not a date. More...
 
typedef fancy_date_rep date_traits_type
 Date rep implements the traits stuff as well. More...
 
typedef greg_year_month_day ymd_type
 define a type a date split into components More...
 
typedef ymd_type::month_type month_type
 define a type for representing months More...
 
typedef ymd_type::day_type day_type
 define a type for representing days More...
 
typedef ymd_type::year_type year_type
 Type to hold a stand alone year value (eg: 2002) More...
 
typedef fancy_date_rep::int_type date_int_type
 Define the integer type to use for internal calculations. More...
 

Static Public Member Functions

static unsigned short day_of_week (const ymd_type &ymd)
 Return the day of the week (0==Sunday, 1==Monday, etc) More...
 
static int week_number (const ymd_type &ymd)
 Return the iso week number for the date. More...
 
static date_int_type day_number (const ymd_type &ymd)
 Convert a ymd_type into a day number. More...
 
static date_int_type julian_day_number (const ymd_type &ymd)
 Convert a year-month-day into the julian day number. More...
 
static date_int_type modjulian_day_number (const ymd_type &ymd)
 Convert year-month-day into a modified julian day number. More...
 
static ymd_type from_day_number (date_int_type)
 Change a day number into a year-month-day. More...
 
static ymd_type from_julian_day_number (date_int_type)
 Change a day number into a year-month-day. More...
 
static ymd_type from_modjulian_day_number (date_int_type)
 Change a modified julian day number into a year-month-day. More...
 
static bool is_leap_year (year_type)
 Determine if the provided year is a leap year. More...
 
static unsigned short end_of_month_day (year_type y, month_type m)
 Calculate the last day of the month. More...
 
static ymd_type epoch ()
 Provide the ymd_type specification for the calandar start. More...
 
static unsigned short days_in_week ()
 Defines length of a week for week calculations. More...
 

Detailed Description

Gregorian calendar for this implementation, hard work in the base.

Member Typedef Documentation

Define the integer type to use for internal calculations.

Internal date representation that handles infinity, not a date.

Date rep implements the traits stuff as well.

Type to hold a weekday (eg: Sunday, Monday,...)

Counter type from 1 to 366 for gregorian dates.

define a type for representing days

define a type for representing months

Type to hold a stand alone year value (eg: 2002)

Member Function Documentation

Convert a ymd_type into a day number.

The day number is an absolute number of days since the start of count

static unsigned short boost::date_time::gregorian_calendar_base< greg_year_month_day , fancy_date_rep::int_type >::day_of_week ( const ymd_type ymd)
staticinherited

Return the day of the week (0==Sunday, 1==Monday, etc)

Converts a year-month-day into a day of the week number

static unsigned short boost::date_time::gregorian_calendar_base< greg_year_month_day , fancy_date_rep::int_type >::days_in_week ( )
staticinherited

Defines length of a week for week calculations.

static unsigned short boost::date_time::gregorian_calendar_base< greg_year_month_day , fancy_date_rep::int_type >::end_of_month_day ( year_type  y,
month_type  m 
)
staticinherited

Calculate the last day of the month.

Find the day which is the end of the month given year and month No error checking is performed.

Referenced by boost::gregorian::date::end_of_month().

Provide the ymd_type specification for the calandar start.

Change a day number into a year-month-day.

Change a day number into a year-month-day.

Change a modified julian day number into a year-month-day.

Determine if the provided year is a leap year.

Returns
true if year is a leap year, false otherwise
static date_int_type boost::date_time::gregorian_calendar_base< greg_year_month_day , fancy_date_rep::int_type >::julian_day_number ( const ymd_type ymd)
staticinherited

Convert a year-month-day into the julian day number.

Since this implementation uses julian day internally, this is the same as the day_number.

Referenced by boost::gregorian::date::julian_day().

static date_int_type boost::date_time::gregorian_calendar_base< greg_year_month_day , fancy_date_rep::int_type >::modjulian_day_number ( const ymd_type ymd)
staticinherited

Convert year-month-day into a modified julian day number.

The day number is an absolute number of days. MJD 0 thus started on 17 Nov 1858(Gregorian) at 00:00:00 UTC

Referenced by boost::gregorian::date::modjulian_day().

static int boost::date_time::gregorian_calendar_base< greg_year_month_day , fancy_date_rep::int_type >::week_number ( const ymd_type ymd)
staticinherited

Return the iso week number for the date.

Implements the rules associated with the iso 8601 week number. Basically the rule is that Week 1 of the year is the week that contains January 4th or the week that contains the first Thursday in January. Reference for this algorithm is the Calendar FAQ by Claus Tondering, April 2000.

Referenced by boost::gregorian::date::week_number().


The documentation for this class was generated from the following file: