]> pilppa.org Git - libplp.git/blob - src/Date.hh
Data read optimizations
[libplp.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                         bool is_last_day_of_month();
27                         void next_second();
28                         void next_min();
29                         void next_hour();
30                         void next_day();
31                         void next_month();
32                         void next_year();
33                         void inc_minutes(int minutes);
34                         void inc_seconds(int seconds);
35                         Date *clone();
36                         void copy(Date *date);
37                         bool before(Date *date2);
38                         bool equals(Date *date2);
39                         bool before_or_equal(Date *date2);
40                         bool before_or_equal_year(Date *date2);
41                         bool before_or_equal_month(Date *date2);
42                         bool before_or_equal_day(Date *date2);
43                         bool before_or_equal_hour(Date *date2);
44                         bool before_or_equal_min(Date *date2);
45                         static plp::Date parse_date_str(std::string date_str);
46                         int     year;
47                         int     month;
48                         int     day;
49                         int     hour;
50                         int     min;
51                         int     sec;
52                         std::string to_string();
53                 protected:
54                         std::string to_sortable_string();
55                         std::string to_sortable_day_string();
56                         std::string to_sortable_hour_string();
57                         std::string to_sortable_min_string();
58                         //static const int arr_days_per_month[];
59         };
60 }
61
62 #endif /* DATE_HH_ */