The Fast Light Environment Kit



class FDate

Class Hierarchy

FBase
   |
   +----FDate

Include Files

#include <Flek/FDate.H>

Description

FDate provides a date class that stores the day, month and year.

Methods


Variable Descriptions

static const int days[];

An array of days of the month for a non leap year, 1-12. (0 is ignored.)

static const int julian_days[2][13];

An array of total days since the beginning of the year for each month, 1-12. (0 is ignored.)

static const char* month_name[];

An array of month names.

Method Descriptions

FDate

FDate::FDate();

Default constructor.

FDate::FDate(int y, int m, int d);

Three argument constructor. Initializes this object with the year, month and day.

Parameters
yThe year.
mThe month.
dThe day.

FDate::FDate(const FDate& src);

Copy constructor.

Parameters
srcThe FDate object to copy initial values from.

day

void FDate::day(int d);

Sets the day.

Parameters
dThe day of the month to associate with this object.

int FDate::day();

Gets the day.

Return Value
The day of the month associated with this object.

day_of_epoch

static int FDate::day_of_epoch(int y, int m, int d);

Gets the day of the epoch for the passed date.

Parameters
yThe year.
mThe month, 1 through 12.
dThe day, 1 through the numbers of days in that month.

Return Value
The day of the epoch.

int FDate::day_of_epoch();

Gets the day of the epoch for this date.

Return Value
The day of the epoch.

day_of_week

static int FDate::day_of_week(int y, int m, int d);

Gets the day of the week for the passed date.

Parameters
yThe year.
mThe month, 1 through 12.
dThe day, 1 through the numbers of days in that month.

Return Value
The day of the week, 1 through 7.

int FDate::day_of_week();

Gets the day of the week for this date.

Return Value
The day of the week, 1 through 7.

day_of_year

static int FDate::day_of_year(int y, int m, int d);

Gets the day of the year for the passed date.

Parameters
yThe year.
mThe month, 1 through 12.
dThe day, 1 through the numbers of days in that month.

Return Value
The day of the year.

int FDate::day_of_year();

Gets the day of the year for this date.

Return Value
The day of the year.

days_in_month

static int FDate::days_in_month(int m, int leap);

Gets the number of days in the month for a given month and leap value.

Parameters
mThe month, 1 through 12.
leapShould be 1 if the associated year is a leap year, 0 otherwise.

Return Value
The number of days in the month.

int FDate::days_in_month();

Gets the number of days in the month for this date.

Return Value
The number of days in the month.

end_of_month

bool FDate::end_of_month(int d);

ostream operator. Gets wether day d is at the end of the month.

Parameters
dThe day to check.

Return Value
True if d is at the end of the month. False otherwise.

julian_date

double FDate::julian_date();

Gets the Julian date.

Return Value
The julian date value for this object.

leap_year

static bool FDate::leap_year(int y);

Gets wether year y is a leap year.

Parameters
yThe year to check.

Return Value
True if the year is a leap year. False otherwise.

bool FDate::leap_year();

Gets wether the year associated with this object is a leap year.

Return Value
True if the year is a leap year. False otherwise.

month

void FDate::month(int m);

Sets the month.

Parameters
mThe month to associate with this object.

int FDate::month();

Gets the month.

Return Value
The month associated with this object.

next_month

void FDate::next_month();

Increment the date by one month.

next_year

void FDate::next_year();

Increment the date by one year.

operator!=

bool FDate::operator!=(const FDate& src);

Inequality comparison of two dates.

Parameters
srcThe FDate object to compare this one to.

Return Value
True if this object and src are not equal. False otherwise.

operator++

FDate &FDate::operator++();

Pre-increment operator. Increment the date by one day.

FDate FDate::operator++(int);

Post-increment operator. Increment the date by one day.

operator+=

const FDate &FDate::operator+=(int d);

Adds days to the date.

Parameters
dThe number of days to add to this date.

operator<

bool FDate::operator<(const FDate& src);

Comparison of two dates.

Parameters
srcThe FDate object to compare this one to.

Return Value
True if this FDate object is less than the src object. False otherwise.

operator=

void FDate::operator=(const FDate& src);

Sets one date equal to another date.

Parameters
srcThe FDate object to set values from.

operator==

bool FDate::operator==(const FDate& src);

Equality comparison of two dates.

Parameters
srcThe FDate object to compare this one to.

Return Value
True if this object and src are equal. False otherwise.

operator>

bool FDate::operator>(const FDate& src);

Comparison of two dates.

Parameters
srcThe FDate object to compare this one to.

Return Value
True if this FDate object is greater than the src object. False otherwise.

previous_month

void FDate::previous_month();

Decrement the date by one month.

previous_year

void FDate::previous_year();

Decrement the date by one year.

set_date

void FDate::set_date(int y, int m, int d);

Sets the date from the year, month, and day.

Parameters
yThe year.
mThe month, 1 through 12.
dThe day, 1 through the numbers of days in that month.

void FDate::set_date(const FDate& src);

Sets the date value from another FDate object.

Parameters
srcThe FDate object to set values from.

set_format

void FDate::set_format(int fmt);

Sets the date format.

Parameters
fmtThe date format.

to_string

char* FDate::to_string(int fmt);

Convert the date to a string.

Parameters
fmtThe format to use during conversion.

char* FDate::to_string();

Convert the date to a string using the current format.

today

void FDate::today();

Set the date value to today's date.

valid

static bool FDate::valid(int y, int m, int d);

Gets wether the passed date is valid.

Parameters
yThe year.
mThe month, 1 through 12.
dThe day, 1 through the numbers of days in that month.

Return Value
True if the year, month and day make a valid date. False otherwise.

bool FDate::valid();

Gets wether the current date is valid.

Return Value
True if the year, month and day make a valid date. False otherwise.

year

void FDate::year(int);

Sets the year.

Parameters
yThe year to associate with this object.

int FDate::year();

Gets the year.

Return Value
The year associated with this object.


© 2000 the Flek Development team.
Generated by ScanDoc
Last Updated: Tue May 15 8:50:06 2001