-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyear_month.h
More file actions
44 lines (31 loc) · 851 Bytes
/
year_month.h
File metadata and controls
44 lines (31 loc) · 851 Bytes
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 _YEAR_MONTH_H_
#define _YEAR_MONTH_H_
class DateTime;
class YearMonth
{
int m_year, m_month;
public:
YearMonth() : m_year(1), m_month(1) {}
YearMonth(const DateTime & _DT);
YearMonth(const int _y, const int _m);
void newYearMonth(int _y, int _m);
int getYear() const;
int getMonth() const;
bool operator < (const YearMonth & _ym) const;
bool operator > (const YearMonth & _ym) const;
bool operator <= (const YearMonth & _ym) const;
bool operator >= (const YearMonth & _ym) const;
bool operator == (const YearMonth & _ym) const;
bool operator != (const YearMonth & _ym) const;
YearMonth PlusOneMonth() const;
static int GetMonthDifference(const YearMonth & _ym1, const YearMonth & _ym2);
};
inline int YearMonth::getYear() const
{
return m_year;
}
inline int YearMonth::getMonth() const
{
return m_month;
}
#endif