2024-01-14 09:38:57 -08:00
|
|
|
#include "ehs/Version.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
|
2023-12-17 15:56:13 -08:00
|
|
|
namespace ehs
|
2023-12-17 03:29:08 -08:00
|
|
|
{
|
|
|
|
Version::Version()
|
|
|
|
: major(0), minor(0), patch(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Version::Version(const UInt_32 major, const UInt_32 minor, const UInt_32 patch)
|
|
|
|
: major(major), minor(minor), patch(patch)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Version::Version(const Version& version)
|
|
|
|
: major(version.major), minor(version.minor), patch(version.patch)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Version& Version::operator=(const Version& version)
|
|
|
|
{
|
|
|
|
if (this == &version)
|
|
|
|
return *this;
|
|
|
|
|
|
|
|
major = version.major;
|
|
|
|
minor = version.minor;
|
|
|
|
patch = version.patch;
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Version::operator==(const Version& version) const
|
|
|
|
{
|
|
|
|
return major == version.major && minor == version.minor && patch == version.patch;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Version::operator!=(const Version& version) const
|
|
|
|
{
|
|
|
|
return major != version.major || minor != version.minor || patch != version.patch;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int Version::operator[](const UInt_32 i) const
|
|
|
|
{
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return major;
|
|
|
|
case 1:
|
|
|
|
return minor;
|
|
|
|
case 2:
|
|
|
|
return patch;
|
|
|
|
default:
|
|
|
|
return major;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int& Version::operator[](const UInt_32 i)
|
|
|
|
{
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return major;
|
|
|
|
case 1:
|
|
|
|
return minor;
|
|
|
|
case 2:
|
|
|
|
return patch;
|
|
|
|
default:
|
|
|
|
return major;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|