summaryrefslogtreecommitdiff
path: root/src/inc/sxshelpers.inl
blob: 3e42051aa914b8697e36a0902af4d2094a95b799 (plain)
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#ifndef _SXSHELPERS_INL_
#define _SXSHELPERS_INL_

AssemblyVersion::AssemblyVersion()
:_major(0)
,_minor(0)
,_build(0)
,_revision(0)
{
    LIMITED_METHOD_CONTRACT;

}

AssemblyVersion::AssemblyVersion(AssemblyVersion& version)
{
    LIMITED_METHOD_CONTRACT;

    _major = version._major;
    _minor = version._minor;
    _build = version._build;
    _revision = version._revision;
}

HRESULT AssemblyVersion::Init(WORD major, WORD minor, WORD build, WORD revision)
{
    LIMITED_METHOD_CONTRACT;

    _major = major;
    _minor = minor;
    _build = build;
    _revision = revision;

    return S_OK;
}


void AssemblyVersion::SetBuild(WORD build)
{
    LIMITED_METHOD_CONTRACT;
    
    _build = build;
}

void AssemblyVersion::SetRevision(WORD revision)
{
    LIMITED_METHOD_CONTRACT;
    
    _revision = revision;
}

AssemblyVersion& AssemblyVersion::operator=(const AssemblyVersion& version)
{
    LIMITED_METHOD_CONTRACT;

    _major = version._major;
    _minor = version._minor;
    _build = version._build;
    _revision = version._revision;

    return *this;
}

BOOL operator<(const AssemblyVersion& version1,
               const AssemblyVersion& version2)
{
    WRAPPER_NO_CONTRACT;

    return !operator>=(version1, version2);
}


#endif /* _SXSHELPERS_INL_ */