Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

sword::CalendarWestern Class Reference

A base class for western-culture calendars. More...

Inheritance diagram for sword::CalendarWestern:

sword::Calendar sword::CalendarGregorian sword::CalendarJulian

Public Methods

virtual void convert (Time time, word &day, word &month, word &year, word &hour, word &minute, word &second, word &millisecond) const
 Converts a timestamp into a full 'dmy h:m:s' date value.

virtual void convert (Time time, word &day, word &month, word &year) const
 Converts a timestamp into a 'dmy' date value.

virtual Time convert (word day, word month, word year, word hour, word minute, word second, word millisecond) const
 Converts a full 'dmy h:m:s' date value into a timestamp.

virtual Time convert (word day, word month, word year) const
 Converts a 'dmy' date value into a timestamp (assuming hour is 0:0:0).

virtual bool isLeapYear (word year) const=0
 Checks whether a year is a leap year or not.

virtual int64 daysInMonth (word month, word year) const=0
 Computes the number of days in a month.

virtual int64 daysInYear (word year) const=0
 Computes the number of days in a year.

virtual int64 daysWithinYear (word day, word month, word year) const=0
 Computes the number of this day within its year (Jan 1st returns 0).

virtual int64 daysBeforeYear (word year) const=0
 Number of days from 1/1/1601 to 1/1/year.

virtual word weekDay (Time time) const=0
 Computes the day of the week (0=Sunday to 6=Saturday).

virtual Time easter (word year) const=0
 Computes the easter date for a given year.

virtual bool isValid (word day, word month, word year, word hour, word minute, word second, word millisecond) const=0
 Validates a 'dmy h:m:s' date value within this Calendar.

virtual int64 dmy2days_ (word day, word month, word year) const=0
 Number of days to day/month/year.

virtual void days2dmy_ (int64 days, word &day, word &month, word &year) const=0
 Computes the day/month/year from the number of days.


Detailed Description

A base class for western-culture calendars.

All western-culture calendars assume the same basic calendar structure, as follows, but may differ on other aspects such as the precise definition of the leap years. This class must not be used, it is only a base class.

See also:
CalendarGregorian, CalendarJulian


Member Function Documentation

virtual Time sword::CalendarWestern::convert word    day,
word    month,
word    year
const [virtual]
 

Converts a 'dmy' date value into a timestamp (assuming hour is 0:0:0).

Implements sword::Calendar.

virtual Time sword::CalendarWestern::convert word    day,
word    month,
word    year,
word    hour,
word    minute,
word    second,
word    millisecond
const [virtual]
 

Converts a full 'dmy h:m:s' date value into a timestamp.

Implements sword::Calendar.

virtual void sword::CalendarWestern::convert Time    time,
word &    day,
word &    month,
word &    year
const [virtual]
 

Converts a timestamp into a 'dmy' date value.

Implements sword::Calendar.

virtual void sword::CalendarWestern::convert Time    time,
word &    day,
word &    month,
word &    year,
word &    hour,
word &    minute,
word &    second,
word &    millisecond
const [virtual]
 

Converts a timestamp into a full 'dmy h:m:s' date value.

Implements sword::Calendar.

virtual void sword::Calendar::days2dmy_ int64    days,
word &    day,
word &    month,
word &    year
const [pure virtual, inherited]
 

Computes the day/month/year from the number of days.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual int64 sword::CalendarWestern::daysBeforeYear word    year const [pure virtual]
 

Number of days from 1/1/1601 to 1/1/year.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual int64 sword::CalendarWestern::daysInMonth word    month,
word    year
const [pure virtual]
 

Computes the number of days in a month.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual int64 sword::CalendarWestern::daysInYear word    year const [pure virtual]
 

Computes the number of days in a year.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual int64 sword::CalendarWestern::daysWithinYear word    day,
word    month,
word    year
const [pure virtual]
 

Computes the number of this day within its year (Jan 1st returns 0).

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual int64 sword::Calendar::dmy2days_ word    day,
word    month,
word    year
const [pure virtual, inherited]
 

Number of days to day/month/year.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual Time sword::CalendarWestern::easter word    year const [pure virtual]
 

Computes the easter date for a given year.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual bool sword::CalendarWestern::isLeapYear word    year const [pure virtual]
 

Checks whether a year is a leap year or not.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual bool sword::Calendar::isValid word    day,
word    month,
word    year,
word    hour,
word    minute,
word    second,
word    millisecond
const [pure virtual, inherited]
 

Validates a 'dmy h:m:s' date value within this Calendar.

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.

virtual word sword::CalendarWestern::weekDay Time    time const [pure virtual]
 

Computes the day of the week (0=Sunday to 6=Saturday).

Implemented in sword::CalendarGregorian, and sword::CalendarJulian.


Generated on Tue Dec 23 20:08:56 2003 for SWORD by doxygen1.3-rc2