14#ifndef WPIUTIL_WPI_VERSIONTUPLE_H
15#define WPIUTIL_WPI_VERSIONTUPLE_H
24template <
typename HasherT, wpi::endianness Endianness>
class HashBuilder;
32 unsigned HasMinor : 1;
34 unsigned Subminor : 31;
35 unsigned HasSubminor : 1;
38 unsigned HasBuild : 1;
42 : Major(0), Minor(0), HasMinor(false), Subminor(0), HasSubminor(false),
43 Build(0), HasBuild(false) {}
46 : Major(Major), Minor(0), HasMinor(false), Subminor(0),
47 HasSubminor(false), Build(0), HasBuild(false) {}
50 : Major(Major), Minor(Minor), HasMinor(true), Subminor(0),
51 HasSubminor(false), Build(0), HasBuild(false) {}
55 : Major(Major), Minor(Minor), HasMinor(true), Subminor(Subminor),
56 HasSubminor(true), Build(0), HasBuild(false) {}
59 unsigned Subminor,
unsigned Build)
60 : Major(Major), Minor(Minor), HasMinor(true), Subminor(Subminor),
61 HasSubminor(true), Build(Build), HasBuild(true) {}
66 return Major == 0 && Minor == 0 && Subminor == 0 && Build == 0;
109 if (Result.Build == 0) {
110 Result.HasBuild =
false;
111 if (Result.Subminor == 0) {
112 Result.HasSubminor =
false;
113 if (Result.Minor == 0)
114 Result.HasMinor =
false;
123 return X.Major == Y.Major && X.Minor == Y.Minor &&
124 X.Subminor == Y.Subminor && X.Build == Y.Build;
140 return std::tie(X.Major, X.Minor, X.Subminor, X.Build) <
141 std::tie(Y.Major, Y.Minor, Y.Subminor, Y.Build);
This file defines DenseMapInfo traits for DenseMap.
Definition VersionTuple.h:24
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition VersionTuple.h:28
friend bool operator<=(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes or is equivalent to another.
Definition VersionTuple.h:157
VersionTuple withoutBuild() const
Return a version tuple that contains only the first 3 version components.
Definition VersionTuple.h:94
constexpr VersionTuple()
Definition VersionTuple.h:41
std::optional< unsigned > getBuild() const
Retrieve the build version number, if provided.
Definition VersionTuple.h:87
constexpr VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor)
Definition VersionTuple.h:53
std::optional< unsigned > getSubminor() const
Retrieve the subminor version number, if provided.
Definition VersionTuple.h:80
friend bool operator!=(const VersionTuple &X, const VersionTuple &Y)
Determine if two version numbers are not equivalent.
Definition VersionTuple.h:131
constexpr VersionTuple(unsigned Major, unsigned Minor)
Definition VersionTuple.h:49
friend bool operator<(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number precedes another.
Definition VersionTuple.h:139
friend bool operator>=(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number follows or is equivalent to another.
Definition VersionTuple.h:166
VersionTuple normalize() const
Return a version tuple that contains only components that are non-zero.
Definition VersionTuple.h:107
std::optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
Definition VersionTuple.h:73
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero).
Definition VersionTuple.h:65
VersionTuple withMajorReplaced(unsigned NewMajor) const
Return a version tuple that contains a different major version but everything else is the same.
Definition VersionTuple.h:102
constexpr VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, unsigned Build)
Definition VersionTuple.h:58
unsigned getMajor() const
Retrieve the major version number.
Definition VersionTuple.h:70
friend bool operator==(const VersionTuple &X, const VersionTuple &Y)
Determine if two version numbers are equivalent.
Definition VersionTuple.h:122
friend bool operator>(const VersionTuple &X, const VersionTuple &Y)
Determine whether one version number follows another.
Definition VersionTuple.h:148
constexpr VersionTuple(unsigned Major)
Definition VersionTuple.h:45
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:43
Foonathan namespace.
Definition ntcore_cpp.h:26