00001 #ifndef _DATE_H_
00002 #define _DATE_H_
00003
00004 #include<string>
00005 #include<iostream>
00006 #include<time.h>
00007
00008 using namespace std;
00009
00010
00011 class date {
00012
00013 private:
00014
00015 int day;
00016 int month;
00017 int year;
00018
00019 void swap(date& d);
00020
00021 public:
00022
00023 date();
00024 date(int g, int m, int a);
00025
00026 int get_day() const;
00027 int get_month() const;
00028 int get_year() const;
00029
00030 void set_day(int g);
00031 void set_month(int m);
00032 void set_year(int a);
00033
00034 bool valid();
00039 bool compare(date d);
00040 void nextday();
00041 int diff(date d);
00042 void printdate(char c);
00043 void printdate();
00044
00045 };
00046
00047
00048
00049 std::ostream& operator<<(std::ostream& stream, const date& d);
00050
00051 bool operator==(const date& d1, const date&d2);
00052
00053 bool operator!=(const date& d1, const date&d2);
00054
00055 #endif