forked from tapetums/include
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SystemTime.hpp
89 lines (73 loc) · 3.38 KB
/
SystemTime.hpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#pragma once
//---------------------------------------------------------------------------//
//
// SystemTime.hpp
// Copyright (C) 2014 tapetums
//
//---------------------------------------------------------------------------//
#include <windows.h>
//---------------------------------------------------------------------------//
inline bool operator ==(const SYSTEMTIME& st1, const SYSTEMTIME& st2)
{
else if ( st1.wYear != st2.wYear ) { return false; }
else if ( st1.wMonth != st2.wMonth ) { return false; }
else if ( st1.wDay != st2.wDay ) { return false; }
else if ( st1.wHour != st2.wHour ) { return false; }
else if ( st1.wMinute != st2.wMinute ) { return false; }
else if ( st1.wSecond != st2.wSecond ) { return false; }
else if ( st1.wMilliseconds != st2.wMilliseconds ) { return false; }
else { return true; }
}
//---------------------------------------------------------------------------//
inline bool operator >(const SYSTEMTIME& st1, const SYSTEMTIME& st2)
{
if ( st1.wYear > st2.wYear ) { return true; }
else if ( st1.wYear < st2.wYear ) { return false; }
else if ( st1.wMonth > st2.wMonth ) { return true; }
else if ( st1.wMonth < st2.wMonth ) { return false; }
else if ( st1.wDay > st2.wDay ) { return true; }
else if ( st1.wDay < st2.wDay ) { return false; }
else if ( st1.wHour > st2.wHour ) { return true; }
else if ( st1.wHour < st2.wHour ) { return false; }
else if ( st1.wMinute > st2.wMinute ) { return true; }
else if ( st1.wMinute < st2.wMinute ) { return false; }
else if ( st1.wSecond > st2.wSecond ) { return true; }
else if ( st1.wSecond < st2.wSecond ) { return false; }
else if ( st1.wMilliseconds > st2.wMilliseconds ) { return true; }
else { return false; }
}
//---------------------------------------------------------------------------//
inline bool operator >=(const SYSTEMTIME& st1, const SYSTEMTIME& st2)
{
if ( st1.wYear > st2.wYear ) { return true; }
else if ( st1.wYear < st2.wYear ) { return false; }
else if ( st1.wMonth > st2.wMonth ) { return true; }
else if ( st1.wMonth < st2.wMonth ) { return false; }
else if ( st1.wDay > st2.wDay ) { return true; }
else if ( st1.wDay < st2.wDay ) { return false; }
else if ( st1.wHour > st2.wHour ) { return true; }
else if ( st1.wHour < st2.wHour ) { return false; }
else if ( st1.wMinute > st2.wMinute ) { return true; }
else if ( st1.wMinute < st2.wMinute ) { return false; }
else if ( st1.wSecond > st2.wSecond ) { return true; }
else if ( st1.wSecond < st2.wSecond ) { return false; }
else if ( st1.wMilliseconds >= st2.wMilliseconds ) { return true; }
else { return false; }
}
//---------------------------------------------------------------------------//
inline bool operator !=(const SYSTEMTIME& st1, const SYSTEMTIME& st2)
{
return !( st1 === st2 );
}
//---------------------------------------------------------------------------//
inline bool operator <(const SYSTEMTIME& st1, const SYSTEMTIME& st2)
{
return !( st1 >= st2 );
}
//---------------------------------------------------------------------------//
inline bool operator <=(const SYSTEMTIME& st1, const SYSTEMTIME& st2)
{
return !( st1 > st2 );
}
//---------------------------------------------------------------------------//
// SystemTime.hpp