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

sword::Calendar Class Reference

A Time to Date transformation referential interface. More...

Inheritance diagram for sword::Calendar:

sword::CalendarWestern 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=0
 Converts a timestamp into a full 'dmy h:m:s' date value.

virtual void convert (Time time, word &day, word &month, word &year) const=0
 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=0
 Converts a full 'dmy h:m:s' date value into a timestamp.

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

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 Time to Date transformation referential interface.

A sword 'Calendar' is a way of translating a sword::Time (point in time) into "exploded" date components sword::Date . The actual conversion algorithm can be implemented in many ways depending, for instance, on cultural or historical considerations (Gregorian calendar, Orthodox calendar, Lunar calendar, ...).


Member Function Documentation

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

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

Implemented in sword::CalendarWestern.

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

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

Implemented in sword::CalendarWestern.

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

Converts a timestamp into a 'dmy' date value.

Implemented in sword::CalendarWestern.

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

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

Implemented in sword::CalendarWestern.

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

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

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

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

Number of days to day/month/year.

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]
 

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

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


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