HMCLauncher: verify if JVM version is between 8 and 10

This commit is contained in:
huanghongxun
2019-02-14 15:34:52 +08:00
parent 394873864f
commit eab4463c2d
12 changed files with 91 additions and 9 deletions

View File

@@ -9,6 +9,18 @@ public:
Version(const std::wstring &rawString);
template <typename T>
Version(std::initializer_list<T> ver_list)
{
int i = 0;
for (const auto &data : ver_list)
{
if (i >= 4)
break;
ver[i++] = data;
}
}
bool operator<(const Version &other) const
{
for (int i = 0; i < 4; ++i)
@@ -16,5 +28,13 @@ public:
return ver[i] < other.ver[i];
return false;
}
bool operator<=(const Version &other) const
{
for (int i = 0; i < 4; ++i)
if (ver[i] != other.ver[i])
return ver[i] < other.ver[i];
return true;
}
};