- Added all source code.

This commit is contained in:
Paul Beckingham 2008-04-19 22:11:59 -04:00
parent 7f8fc1182d
commit b5be083d88
27 changed files with 7842 additions and 0 deletions

60
src/Date.h Normal file
View file

@ -0,0 +1,60 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright 2005 - 2008, Paul Beckingham. All rights reserved.
//
//
////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDED_DATE
#define INCLUDED_DATE
#include <string>
class Date;
class Date
{
public:
Date ();
Date (time_t);
Date (const int, const int, const int);
Date (const std::string&);
Date (const Date&);
virtual ~Date ();
void toEpoch (time_t&);
time_t toEpoch ();
void toMDY (int&, int&, int&);
void toString (std::string&);
std::string toString (void);
static bool valid (const int, const int, const int);
static bool leapYear (int);
static int daysInMonth (int, int);
static std::string monthName (int);
static void dayName (int, std::string&);
static std::string dayName (int);
int dayOfWeek ();
int month ();
int day ();
int year ();
bool operator== (const Date&);
bool operator!= (const Date&);
bool operator< (const Date&);
bool operator> (const Date&);
bool operator<= (const Date&);
bool operator>= (const Date&);
Date operator+ (const int);
Date& operator+= (const int);
Date& operator-= (const int);
time_t operator- (const Date&);
protected:
time_t mT;
};
#endif
////////////////////////////////////////////////////////////////////////////////