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