HatchKeeper
0.90
The Free Open-Source Egg Incubation Software
|
A Class For Managing Dates. More...
#include <Date.h>
Public Member Functions | |
HK_Date () | |
The Default Constructor. Sets Date To Today. More... | |
HK_Date (int Days, int Month, int Year) | |
A Constructor That Sets Day, Month, Year. Call IsValid() To Check If The Date Is Valid. More... | |
HK_Date (std::string Date) | |
A Constructor That Sets Date From A Year/Month/Day String. Call IsValid() To Check If The Date Is Valid. More... | |
~HK_Date () | |
Destructor. More... | |
bool | AddDays (int Days) |
Adds Days To This HK_Date. More... | |
int | DaysInMonth () |
Returns The Number Of Days In HK_Month. LeapYear Is Checked. More... | |
int | Difference (HK_Date Date) |
Returns The Number Of Days Difference Between This HK_Date And The Supplied Date. More... | |
int | GetDay () |
Returns Day Value. More... | |
int | GetMonth () |
Returns Month Value. More... | |
int | GetYear () |
Returns Year Value. More... | |
std::string | IntToMonth (int Month) |
Returns The Selected Month Name As A String. Expects 1 - 12. More... | |
bool | IsAfter (HK_Date Date) |
Checks To See If The Input Date Is After The Stored Date. More... | |
bool | IsBefore (HK_Date Date) |
Checks To See If The Input Date Is Before The Stored Date. More... | |
bool | IsEqual (HK_Date Date) |
Checks To See If The Input Date Is Same As Stored Date. More... | |
bool | IsEqualMonth (HK_Date Date) |
Checks To See If The Input Date's Month and Year Is Same As Stored Date. More... | |
bool | IsEqualYear (HK_Date Date) |
Checks To See If The Input Date's Year Is Same As Stored Date. More... | |
bool | IsLeapYear () |
Returns True If HK_Year Is A Leap Year. More... | |
bool | IsValid () |
Checks If This HK_Date Contains A Valid Date. More... | |
bool | IsValidDate (int Days, int Month, int Year) |
Takes Day, Month And Year And Generates A Readable String. More... | |
bool | ModifyDate (int Days, bool Operator) |
Adds Or Subtracts Days From This HK_Date. More... | |
std::string | MonthName () |
Returns HK_Month's Name As String. More... | |
int | MonthToInt (std::string Month) |
Converts Month Name To An Int. More... | |
void | Reset () |
Resets Date To Today. More... | |
bool | SetDate (int Days, int Month, int Year) |
Sets Day, Month, and Year. More... | |
bool | SetDate (std::string Date) |
Sets Day, Month, and Year From A Year/Month/Day String. More... | |
void | SetDay (int Days) |
Sets Day Value, Doesn't Check If Its Valid. More... | |
void | SetMonth (int Month) |
Sets Month Value, Doesn't Check If Its Valid. More... | |
void | SetYear (int Year) |
Sets Year Value, Doesn't Check If Its Valid. More... | |
std::vector< std::string > | SplitStrings (std::string In, std::string Split) |
Splits In By Split And Returns A Vector With Data. More... | |
int | StartDayOfWeek () |
Returns What Day Of The Week This HK_Date Month Starts. More... | |
bool | SubtractDays (int Days) |
Subtracts Days To This HK_Date. More... | |
std::string | ToReadable (std::string Separator, int Mode) |
Generate A Readable String. More... | |
std::string | ToSortable (std::string Separator) |
Generate A Sortable String For Database. More... | |
Private Attributes | |
int | HK_Day |
Holds The Day Part Of The Date. More... | |
int | HK_Month |
Holds The Month Part Of The Date. More... | |
int | HK_Year |
Holds The Year Part Of The Date. More... | |
A Class For Managing Dates.
This class only supports days, months, and years. It doesn't support hour, minutes, seconds, etc;
HK_Date::HK_Date | ( | ) |
The Default Constructor. Sets Date To Today.
Definition at line 12 of file HK_Date.cpp.
HK_Date::HK_Date | ( | int | Days, |
int | Month, | ||
int | Year | ||
) |
A Constructor That Sets Day, Month, Year. Call IsValid() To Check If The Date Is Valid.
Definition at line 20 of file HK_Date.cpp.
HK_Date::HK_Date | ( | std::string | Date | ) |
A Constructor That Sets Date From A Year/Month/Day String. Call IsValid() To Check If The Date Is Valid.
Definition at line 26 of file HK_Date.cpp.
HK_Date::~HK_Date | ( | ) |
Destructor.
Definition at line 29 of file HK_Date.cpp.
bool HK_Date::AddDays | ( | int | Days | ) |
Adds Days To This HK_Date.
Definition at line 70 of file HK_Date.cpp.
int HK_Date::DaysInMonth | ( | ) |
Returns The Number Of Days In HK_Month. LeapYear Is Checked.
Definition at line 432 of file HK_Date.cpp.
int HK_Date::Difference | ( | HK_Date | Date | ) |
Returns The Number Of Days Difference Between This HK_Date And The Supplied Date.
Definition at line 84 of file HK_Date.cpp.
int HK_Date::GetDay | ( | ) |
Returns Day Value.
Definition at line 57 of file HK_Date.cpp.
int HK_Date::GetMonth | ( | ) |
Returns Month Value.
Definition at line 60 of file HK_Date.cpp.
int HK_Date::GetYear | ( | ) |
Returns Year Value.
Definition at line 63 of file HK_Date.cpp.
std::string HK_Date::IntToMonth | ( | int | Month | ) |
Returns The Selected Month Name As A String. Expects 1 - 12.
Definition at line 168 of file HK_Date.cpp.
bool HK_Date::IsAfter | ( | HK_Date | Date | ) |
Checks To See If The Input Date Is After The Stored Date.
Definition at line 253 of file HK_Date.cpp.
bool HK_Date::IsBefore | ( | HK_Date | Date | ) |
Checks To See If The Input Date Is Before The Stored Date.
Definition at line 289 of file HK_Date.cpp.
bool HK_Date::IsEqual | ( | HK_Date | Date | ) |
Checks To See If The Input Date Is Same As Stored Date.
Definition at line 325 of file HK_Date.cpp.
bool HK_Date::IsEqualMonth | ( | HK_Date | Date | ) |
Checks To See If The Input Date's Month and Year Is Same As Stored Date.
Definition at line 336 of file HK_Date.cpp.
bool HK_Date::IsEqualYear | ( | HK_Date | Date | ) |
Checks To See If The Input Date's Year Is Same As Stored Date.
Definition at line 345 of file HK_Date.cpp.
bool HK_Date::IsLeapYear | ( | ) |
Returns True If HK_Year Is A Leap Year.
Definition at line 423 of file HK_Date.cpp.
bool HK_Date::IsValid | ( | ) |
Checks If This HK_Date Contains A Valid Date.
Definition at line 194 of file HK_Date.cpp.
bool HK_Date::IsValidDate | ( | int | Day, |
int | Month, | ||
int | Year | ||
) |
Takes Day, Month And Year And Generates A Readable String.
Separator | i.e. "/" month/day/year |
Checks If The Args Form A Valid Date
Definition at line 377 of file HK_Date.cpp.
bool HK_Date::ModifyDate | ( | int | Days, |
bool | Operator | ||
) |
Adds Or Subtracts Days From This HK_Date.
Operator | true == Add, false == Subtract |
Definition at line 207 of file HK_Date.cpp.
std::string HK_Date::MonthName | ( | ) |
Returns HK_Month's Name As String.
Definition at line 188 of file HK_Date.cpp.
int HK_Date::MonthToInt | ( | std::string | Month | ) |
void HK_Date::Reset | ( | ) |
Resets Date To Today.
Definition at line 400 of file HK_Date.cpp.
bool HK_Date::SetDate | ( | int | Days, |
int | Month, | ||
int | Year | ||
) |
bool HK_Date::SetDate | ( | std::string | Date | ) |
Sets Day, Month, and Year From A Year/Month/Day String.
Definition at line 40 of file HK_Date.cpp.
void HK_Date::SetDay | ( | int | Days | ) |
Sets Day Value, Doesn't Check If Its Valid.
Definition at line 48 of file HK_Date.cpp.
void HK_Date::SetMonth | ( | int | Month | ) |
Sets Month Value, Doesn't Check If Its Valid.
Definition at line 51 of file HK_Date.cpp.
void HK_Date::SetYear | ( | int | Year | ) |
Sets Year Value, Doesn't Check If Its Valid.
Definition at line 54 of file HK_Date.cpp.
std::vector< std::string > HK_Date::SplitStrings | ( | std::string | In, |
std::string | Split | ||
) |
Splits In By Split And Returns A Vector With Data.
Definition at line 444 of file HK_Date.cpp.
int HK_Date::StartDayOfWeek | ( | ) |
Returns What Day Of The Week This HK_Date Month Starts.
Definition at line 411 of file HK_Date.cpp.
bool HK_Date::SubtractDays | ( | int | Days | ) |
Subtracts Days To This HK_Date.
Definition at line 79 of file HK_Date.cpp.
std::string HK_Date::ToReadable | ( | std::string | Separator, |
int | Mode | ||
) |
Generate A Readable String.
Separator | i.e. "/" day/month/year |
Mode |
Definition at line 132 of file HK_Date.cpp.
std::string HK_Date::ToSortable | ( | std::string | Separator | ) |
Generate A Sortable String For Database.
Separator | i.e. "/" Year/Month/Day |
Definition at line 163 of file HK_Date.cpp.
|
private |