DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
Version.h
Go to the documentation of this file.
1
3
4#pragma once
5#include "Common.h"
6#include "System/Object.h"
7#include "System/String.h"
8
9namespace DotNetDupe
10{
11 namespace System
12 {
20 class Version : public Object
21 {
22 public:
28 DOTNETDUPE_API Version(int iMajor, int iMinor, int iBuild, int iRevision);
29
34 DOTNETDUPE_API Version(int iMajor, int iMinor, int iBuild);
35
39 DOTNETDUPE_API Version(int iMajor, int iMinor);
40
43
46 DOTNETDUPE_API int GetMajor() const;
47
50 DOTNETDUPE_API int GetMinor() const;
51
54 DOTNETDUPE_API int GetBuild() const;
55
58 DOTNETDUPE_API int GetRevision() const;
59
63
68 DOTNETDUPE_API static Version Parse(const String& sInput);
69
74 DOTNETDUPE_API static bool TryParse(const String& sInput, Version& vResult);
75
79 DOTNETDUPE_API bool operator==(const Version& vOther) const;
80
84 DOTNETDUPE_API bool operator!=(const Version& vOther) const;
85
86 private:
87 int m_iMajor;
88 int m_iMinor;
89 int m_iBuild;
90 int m_iRevision;
91 };
92 }
93}
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Base object class for DotNetDupe mirroring .NET System.Object.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
int GetMajor() const
Gets the value of the major component of the version number.
Definition Version.cpp:80
bool operator==(const Version &vOther) const
Determines whether two Version instances are equal.
Definition Version.cpp:124
Version(int iMajor, int iMinor, int iBuild, int iRevision)
Initializes a new instance of the Version class using specified major, minor, build,...
Definition Version.cpp:68
int GetMinor() const
Gets the value of the minor component of the version number.
Definition Version.cpp:84
static bool TryParse(const String &sInput, Version &vResult)
Tries to convert the string representation of a version number to an equivalent Version object.
Definition Version.cpp:113
Version()
Initializes a new instance of the Version class to 0.0.0.0.
Definition Version.cpp:77
int GetRevision() const
Gets the value of the revision component of the version number.
Definition Version.cpp:92
static Version Parse(const String &sInput)
Converts the string representation of a version number to an equivalent Version object.
Definition Version.cpp:102
int GetBuild() const
Gets the value of the build component of the version number.
Definition Version.cpp:88
bool operator!=(const Version &vOther) const
Determines whether two Version instances are not equal.
Definition Version.cpp:131
String ToString() const
Converts the value of the current Version object to its equivalent String representation.
Definition Version.cpp:96