libcommonc++
0.7
|
A representation of a calendar date. More...
#include <Date.h++>
Public Types | |
enum | Weekday { Invalid = 0, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } |
Public Member Functions | |
Date () | |
Construct a new Date of January 1, year 1. More... | |
Date (uint_t day, uint_t month, uint_t year) | |
Construct a new Date with the given components. More... | |
Date (const Date &other) | |
Copy constructor. More... | |
virtual | ~Date () |
Destructor. More... | |
void | setMonth (uint_t month) |
Set the month component of the date. More... | |
void | setDay (uint_t day) |
Set the day-of-month component of the date. More... | |
void | setYear (uint_t year) |
Set the year component of the date. More... | |
void | setDate (uint_t day, uint_t month, uint_t year) |
Set the day, month, and year components of the date. More... | |
uint_t | getMonth () const |
Get the month component of the date. More... | |
uint_t | getDay () const |
Get the day-of-month component of the date. More... | |
uint_t | getYear () const |
Get the year component of the date. More... | |
Weekday | getWeekday () const |
Get the weekday of the date. More... | |
uint_t | getDayOfYear () const |
Get the day of the year. More... | |
uint_t | getWeekOfYear () const |
Get the week number of the year, where weeks are defined as beginning on Monday (ISO standard). More... | |
bool | isValid () const |
Test if the date is valid. More... | |
bool | operator== (const Date &other) const |
bool | operator< (const Date &other) const |
bool | operator<= (const Date &other) const |
bool | operator!= (const Date &other) const |
bool | operator> (const Date &other) const |
bool | operator>= (const Date &other) const |
Date & | operator= (const Date &other) |
Static Public Member Functions | |
static bool | isLeapYear (uint_t year) |
Test if a year is a leap year. More... | |
Static Public Attributes | |
static const uint_t | JAN = 1 |
The month of January. More... | |
static const uint_t | FEB = 2 |
The month of February. More... | |
static const uint_t | MAR = 3 |
The month of March. More... | |
static const uint_t | APR = 4 |
The month of April. More... | |
static const uint_t | MAY = 5 |
The month of May. More... | |
static const uint_t | JUN = 6 |
The month of June. More... | |
static const uint_t | JUL = 7 |
The month of July. More... | |
static const uint_t | AUG = 8 |
The month of August. More... | |
static const uint_t | SEP = 9 |
The month of September. More... | |
static const uint_t | OCT = 10 |
The month of October. More... | |
static const uint_t | NOV = 11 |
The month of November. More... | |
static const uint_t | DEC = 12 |
The month of December. More... | |
A representation of a calendar date.
enum Weekday |
|
virtual |
Destructor.
|
inline |
Get the day-of-month component of the date.
uint_t getDayOfYear | ( | ) | const |
Get the day of the year.
|
inline |
Get the month component of the date.
Date::Weekday getWeekday | ( | ) | const |
Get the weekday of the date.
uint_t getWeekOfYear | ( | ) | const |
Get the week number of the year, where weeks are defined as beginning on Monday (ISO standard).
|
inline |
Get the year component of the date.
|
static |
Test if a year is a leap year.
bool isValid | ( | ) | const |
Test if the date is valid.
|
inline |
bool operator< | ( | const Date & | other | ) | const |
bool operator<= | ( | const Date & | other | ) | const |
bool operator== | ( | const Date & | other | ) | const |
|
inline |
|
inline |
Set the day, month, and year components of the date.
void setDay | ( | uint_t | day | ) |
Set the day-of-month component of the date.
void setMonth | ( | uint_t | month | ) |
Set the month component of the date.
void setYear | ( | uint_t | year | ) |
Set the year component of the date.
|
static |
The month of April.
|
static |
The month of August.
|
static |
The month of December.
|
static |
The month of February.
|
static |
The month of January.
|
static |
The month of July.
|
static |
The month of June.
|
static |
The month of March.
|
static |
The month of May.
|
static |
The month of November.
|
static |
The month of October.
|
static |
The month of September.