-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDate.h
33 lines (32 loc) · 859 Bytes
/
Date.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
#pragma once
#include <fstream>
#define rcastcc reinterpret_cast<const char*>
#define rcastc reinterpret_cast<char*>
using namespace std;
#define rcastcc reinterpret_cast<const char*>
#define rcastc reinterpret_cast<char*>
static const int maxDayPerMonth[13] = { -1,31,28,31,30, 31, 30, 31, 31, 30, 31, 30, 31 };
using namespace std;
namespace votes
{
class Date
{
private:
int _day;
int _month;
int _year;
public:
//ctors:
Date(int day,int month ,int year);
Date();
// no memory allocation in this class . we use the default Copy ctor and default operator= .
//getters
int getDay() const { return _day; }
int getMonth() const { return _month; }
int getYear() const { return _year; }
friend ostream& operator<<(ostream& os, const Date& date);
//save/load
void loadDate(istream& in);
void saveDate(ostream& out) const;
};
}