-
Notifications
You must be signed in to change notification settings - Fork 0
/
date_wrap.h
44 lines (39 loc) · 1.04 KB
/
date_wrap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef DATE_WARP_H_
#define DATE_WARP_H_
#include <iostream>
#include "exceptions.h"
namespace mtm
{
class DateWrap;
}
extern "C"{
#include "date.h"
}
class mtm::DateWrap{
int day_data;
int month_data;
int year_data;
Date turnIntoDate() const;
int dateWrapCompare(const DateWrap& date) const;
public:
static const int DAYS_IN_MONTH = 30;
static const int MONTHS_IN_YEAR = 12;
DateWrap(const DateWrap&) = default;
~DateWrap() = default;
DateWrap(int day, int month, int year);
int day() const;
int month() const;
int year() const;
bool operator==(const DateWrap& date) const;
bool operator!=(const DateWrap& date) const;
bool operator<=(const DateWrap& date) const;
bool operator>=(const DateWrap& date) const;
bool operator<(const DateWrap& date) const;
bool operator>(const DateWrap& date) const;
DateWrap operator++(int);
DateWrap operator+=(int days);
DateWrap operator+(int days) const;
friend DateWrap operator+(int days, const DateWrap& date);
friend std::ostream& operator<<(std::ostream& os, const DateWrap& date);
};
#endif