-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathversion.hpp
67 lines (48 loc) · 1.39 KB
/
version.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
/* xfs/version.hpp
*
* Copyright (C) 2007 Antonio Di Monaco
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
#pragma once
#ifndef __XFS_VERSION_HPP__
#define __XFS_VERSION_HPP__
#include <iostream>
#include <tuple>
#include <windows.h>
#include "util/operators.hpp"
namespace XFS
{
class Version : private Comparable< Version >
{
WORD _major;
WORD _minor;
public:
explicit Version(WORD wVersion);
explicit Version(BYTE bMajor, BYTE bMinor);
WORD value() const;
WORD major() const;
WORD minor() const;
static Version min(BYTE bMajor);
static Version max(BYTE bMajor);
bool operator<(const Version &o) const;
bool operator==(const Version &o) const;
};
class VersionRange : private EqualComparable< VersionRange >
{
Version _start;
Version _end;
public:
explicit VersionRange(DWORD dwVersion);
explicit VersionRange(const Version &vStart, const Version &vEnd);
Version start() const;
Version end() const;
DWORD value() const;
bool contains(const Version &v) const;
bool operator==(const VersionRange &o) const;
};
std::ostream &operator<<(std::ostream &out,const Version &v);
std::ostream &operator<<(std::ostream &out,const VersionRange &v);
}
#endif