Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 06 / Event / Date.h
blob: 2e28ffa04a4cfc32e6f68b51f7875ea6a132037a (plain) (blame)
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
#pragma once

class Date
{
	size_t day;
	size_t month;
	size_t year;

	size_t MAX_DAYS[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

	mutable int dayOfWeek; 
	mutable bool isModified = true;

	bool isLeapYear() const;
	void validateDateByChangedCalendars();
public:
	Date(size_t day, size_t month, size_t year);
	
	size_t getDay() const;
	size_t getMonth() const;
	size_t getYear() const;

	void setDay(size_t);
	void setMonth(size_t);
	void setYear(size_t);

	void print() const;
	void goToNextDay();

	bool areEqual(const Date& other) const;

	int getDayOfWeek() const; //cant be const, because of changings dayOfWeek and isModified 
						// can we get around this ??
};