#include <aflibDateTime.h>
Public Member Functions | |
aflibDateTime () | |
Constructor with no parameters. | |
aflibDateTime (int year, int month, int day, int hour, int minute, int second) | |
Constructor with parameters as integer values. | |
aflibDateTime (string date, string time) | |
Constructor with parameters as strings. | |
~aflibDateTime () | |
Destructor. | |
bool | operator< (const aflibDateTime &date) const |
Comparision operator. | |
bool | operator<= (const aflibDateTime &date) const |
bool | operator== (const aflibDateTime &date) const |
void | setYear (int year) |
Sets the year. | |
int | getYear () const |
Gets the year. | |
void | setMonth (int month) |
Sets the month. | |
int | getMonth () const |
Gets the month. | |
void | setDay (int day) |
Sets the day. | |
int | getDay () const |
Gets the day. | |
void | setHour (int hour) |
Sets the hour. | |
int | getHour () const |
Gets the hour. | |
void | setMinute (int minute) |
Sets the minute. | |
int | getMinute () const |
Gets the minute. | |
void | setSecond (int second) |
Sets the second. | |
int | getSecond () const |
Gets the second. | |
void | setCurrentTime () |
Sets the date and time to the current date and time. | |
Friends | |
ostream & | operator<< (ostream &o, const aflibDateTime &date) |
Outputs data and time to a stream. |
This class simply holds a date and time. It can be used by other classes such as the aflibAudioRecorder class that requires a date and time. It provides for storing a date and time, printing a date and time, and comparing two dates and times.
aflibDateTime::aflibDateTime | ( | ) |
Constructor with no parameters.
aflibDateTime::aflibDateTime | ( | int | year, | |
int | month, | |||
int | day, | |||
int | hour, | |||
int | minute, | |||
int | second | |||
) |
Constructor with parameters as integer values.
aflibDateTime::aflibDateTime | ( | string | date, | |
string | time | |||
) |
Constructor with parameters as strings.
This constructor takes a date and a time as a string. The date must be in the format MM/DD/YYYY. The time must be in the format HH:MM:SS.
aflibDateTime::~aflibDateTime | ( | ) |
Destructor.
bool aflibDateTime::operator< | ( | const aflibDateTime & | date | ) | const |
Comparision operator.
This operator will determine if one date and time is less than another date and time.
bool aflibDateTime::operator<= | ( | const aflibDateTime & | date | ) | const |
bool aflibDateTime::operator== | ( | const aflibDateTime & | date | ) | const |
void aflibDateTime::setYear | ( | int | year | ) |
Sets the year.
int aflibDateTime::getYear | ( | ) | const |
Gets the year.
void aflibDateTime::setMonth | ( | int | month | ) |
Sets the month.
int aflibDateTime::getMonth | ( | ) | const |
Gets the month.
void aflibDateTime::setDay | ( | int | day | ) |
Sets the day.
int aflibDateTime::getDay | ( | ) | const |
Gets the day.
void aflibDateTime::setHour | ( | int | hour | ) |
Sets the hour.
int aflibDateTime::getHour | ( | ) | const |
Gets the hour.
void aflibDateTime::setMinute | ( | int | minute | ) |
Sets the minute.
int aflibDateTime::getMinute | ( | ) | const |
Gets the minute.
void aflibDateTime::setSecond | ( | int | second | ) |
Sets the second.
int aflibDateTime::getSecond | ( | ) | const |
Gets the second.
void aflibDateTime::setCurrentTime | ( | ) |
Sets the date and time to the current date and time.
ostream& operator<< | ( | ostream & | o, | |
const aflibDateTime & | date | |||
) | [friend] |
Outputs data and time to a stream.
This will output the date and time to a stream in the format MM/DD/YYYY and HH:MM:SS.