studies/bauelemente/Softwarebauelemente-CodeO3-2/Date.h
⇒
download file
1
2
3
4
5
6
7 #if !defined(AFX_DATE_H__A8EA7861_08E1_11D5_9BB7_A8652B9FDD20__INCLUDED_)
8 #define AFX_DATE_H__A8EA7861_08E1_11D5_9BB7_A8652B9FDD20__INCLUDED_
9
10 #if _MSC_VER > 1000
11 #pragma once
12 #endif // _MSC_VER > 1000
13
14
15
16 #include "BasicClass.h"
17
18 #include <string>
19 using namespace std;
20
21
22
23
24
25
26
27 class CDate : public CBasicClass
28 {
29 public:
30
31 CDate();
32
33 CDate(const CDate &date);
34
35 CDate(unsigned int nDay, unsigned int nMonth, unsigned int nYear,
36 unsigned int nHour=0, unsigned int nMinute=0, unsigned int nSecond=0);
37
38
39 virtual string ClassnameOf() const { return "CDate"; }
40
41
42 virtual string Show() const;
43
44 virtual string ShowDebug() const;
45
46
47 static void GetToday(unsigned int &nDay, unsigned int &nMonth, unsigned int &nYear,
48 unsigned int &nHour, unsigned int &nMinute, unsigned int &nSecond);
49
50
51 virtual bool ClassInvariant() const;
52
53 static bool IsLeapYear(unsigned int nYear);
54
55
56
57 CDate& operator = (const CDate &date);
58
59 virtual bool Copy (const CBasicClass *pClass);
60
61
62
63 bool operator == (const CDate &date) const;
64
65 virtual bool EqualValue(const CBasicClass *pClass) const;
66
67
68
69 void SetDay (unsigned int nDay);
70 void SetMonth (unsigned int nMonth);
71 void SetYear (unsigned int nYear);
72 void SetHour (unsigned int nHour);
73 void SetMinute(unsigned int nMinute);
74 void SetSecond(unsigned int nSecond);
75
76
77 unsigned int GetDay () const;
78 unsigned int GetMonth () const;
79 unsigned int GetYear () const;
80 unsigned int GetHour () const;
81 unsigned int GetMinute() const;
82 unsigned int GetSecond() const;
83
84
85 enum { JANUARY = 1, FEBRUARY = 2, MARCH = 3, APRIL = 4,
86 MAY = 5, JUNE = 6, JULY = 7, AUGUST = 8,
87 SEPTEMBER = 9, OCTOBER =10, NOVEMBER =11, DECEMBER =12 };
88
89 private:
90
91 unsigned int m_nDay;
92 unsigned int m_nMonth;
93 unsigned int m_nYear;
94
95 unsigned int m_nHour;
96 unsigned int m_nMinute;
97 unsigned int m_nSecond;
98 };
99
100
101 #endif // !defined(AFX_DATE_H__A8EA7861_08E1_11D5_9BB7_A8652B9FDD20__INCLUDED_)
102