studies/bauelemente/Softwarebauelemente-CodeC2-1/Moment.h
⇒
download file
1
2
3
4
5
6
7 #if !defined(AFX_MOMENT_H__BA324DAD_872B_11D5_9BB8_AB7BB57BD00C__INCLUDED_)
8 #define AFX_MOMENT_H__BA324DAD_872B_11D5_9BB8_AB7BB57BD00C__INCLUDED_
9
10 #if _MSC_VER > 1000
11 #pragma once
12 #endif // _MSC_VER > 1000
13
14 class CMoment : public CObject
15 {
16 DECLARE_SERIAL(CMoment)
17
18 public:
19
20 CMoment();
21
22 CMoment(const CMoment& moment);
23
24 CMoment(unsigned int nDay, unsigned int nMonth, unsigned int nYear,
25 unsigned int nHour=0, unsigned int nMinute=0, unsigned int nSecond=0);
26
27
28 virtual ~CMoment();
29
30
31 void Serialize(CArchive &ar);
32
33 virtual void AssertValid() const;
34
35 virtual void Dump(CDumpContext& dc) const;
36
37
38 static void GetCurrent(unsigned int& nDay, unsigned int& nMonth, unsigned int& nYear,
39 unsigned int& nHour, unsigned int& nMinute, unsigned int& nSecond);
40
41
42 static bool IsLeapYear(unsigned int nYear);
43
44
45 virtual CMoment& operator = (const CMoment& moment);
46 virtual CMoment& Copy (const CMoment& moment);
47
48 virtual CMoment& operator = (const CTime& time);
49
50
51 virtual bool operator ==(const CMoment& moment) const;
52 virtual bool EqualValue (const CMoment& moment) const;
53
54
55 virtual operator CTime() const;
56
57
58 void SetDay (unsigned int nDay);
59 void SetMonth (unsigned int nMonth);
60 void SetYear (unsigned int nYear);
61 void SetHour (unsigned int nHour);
62 void SetMinute(unsigned int nMinute);
63 void SetSecond(unsigned int nSecond);
64
65
66 unsigned int GetDay () const;
67 unsigned int GetMonth () const;
68 unsigned int GetYear () const;
69 unsigned int GetHour () const;
70 unsigned int GetMinute() const;
71 unsigned int GetSecond() const;
72
73
74 enum { JANUARY = 1, FEBRUARY = 2, MARCH = 3, APRIL = 4,
75 MAY = 5, JUNE = 6, JULY = 7, AUGUST = 8,
76 SEPTEMBER = 9, OCTOBER = 10, NOVEMBER = 11, DECEMBER = 12 };
77
78 private:
79
80 unsigned int m_nDay;
81 unsigned int m_nMonth;
82 unsigned int m_nYear;
83
84 unsigned int m_nHour;
85 unsigned int m_nMinute;
86 unsigned int m_nSecond;
87 };
88
89 #endif // !defined(AFX_MOMENT_H__BA324DAD_872B_11D5_9BB8_AB7BB57BD00C__INCLUDED_)
90
91