]> pilppa.org Git - lib1wire.git/blob - src/Date.hh
Added support for cacheing monthly data.
[lib1wire.git] / src / Date.hh
1 /*
2  * Date.hh
3  *
4  *  Created on: Dec 7, 2010
5  *      Author: lamikr
6  */
7
8 #ifndef DATE_HH_
9 #define DATE_HH_
10
11 #include <string>
12
13 namespace plp {
14         class Date {
15                 public:
16                         Date();
17                         Date(int year_param,
18                              int month_param,
19                              int day_param,
20                              int hour_param,
21                              int min_param,
22                              int sec_param);
23                         virtual ~Date();
24                         void printout();
25                         bool is_leap_year();
26                         void next_hour();
27                         void next_day();
28                         void next_month();
29                         void next_year();
30                         void inc_minutes(int minutes);
31                         void inc_seconds(int seconds);
32                         Date *clone();
33                         void copy(Date *date);
34                         bool before(Date *date2);
35                         bool equals(Date *date2);
36                         bool before_or_equal(Date *date2);
37                         bool before_or_equal_year(Date *date2);
38                         bool before_or_equal_month(Date *date2);
39                         bool before_or_equal_day(Date *date2);
40                         bool before_or_equal_hour(Date *date2);
41                         bool before_or_equal_min(Date *date2);
42                         int     year;
43                         int     month;
44                         int     day;
45                         int     hour;
46                         int     min;
47                         int     sec;
48                         std::string to_string();
49                 protected:
50                         std::string to_sortable_string();
51                         std::string to_sortable_day_string();
52                         std::string to_sortable_hour_string();
53                         std::string to_sortable_min_string();
54                         //static const int arr_days_per_month[];
55         };
56 }
57
58 #endif /* DATE_HH_ */