2016-01-01 23:35:54 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
2017-03-26 18:40:03 +00:00
|
|
|
// NOTE: apparently the GNU C library pollutes the global namespace with these... undef them.
|
|
|
|
#ifdef major
|
2018-07-15 12:51:05 +00:00
|
|
|
#undef major
|
2017-03-26 18:40:03 +00:00
|
|
|
#endif
|
|
|
|
#ifdef minor
|
2018-07-15 12:51:05 +00:00
|
|
|
#undef minor
|
2017-03-26 18:40:03 +00:00
|
|
|
#endif
|
|
|
|
|
2021-07-25 17:11:59 +00:00
|
|
|
class JavaVersion
|
2016-01-01 23:35:54 +00:00
|
|
|
{
|
2018-07-15 12:51:05 +00:00
|
|
|
friend class JavaVersionTest;
|
2016-01-01 23:35:54 +00:00
|
|
|
public:
|
2018-07-15 12:51:05 +00:00
|
|
|
JavaVersion() {};
|
|
|
|
JavaVersion(const QString & rhs);
|
|
|
|
|
|
|
|
JavaVersion & operator=(const QString & rhs);
|
|
|
|
|
|
|
|
bool operator<(const JavaVersion & rhs);
|
|
|
|
bool operator==(const JavaVersion & rhs);
|
|
|
|
bool operator>(const JavaVersion & rhs);
|
|
|
|
|
|
|
|
bool requiresPermGen();
|
|
|
|
|
|
|
|
QString toString();
|
|
|
|
|
|
|
|
int major()
|
|
|
|
{
|
|
|
|
return m_major;
|
|
|
|
}
|
|
|
|
int minor()
|
|
|
|
{
|
|
|
|
return m_minor;
|
|
|
|
}
|
|
|
|
int security()
|
|
|
|
{
|
|
|
|
return m_security;
|
|
|
|
}
|
2016-01-01 23:35:54 +00:00
|
|
|
private:
|
2018-07-15 12:51:05 +00:00
|
|
|
QString m_string;
|
|
|
|
int m_major = 0;
|
|
|
|
int m_minor = 0;
|
|
|
|
int m_security = 0;
|
|
|
|
bool m_parseable = false;
|
|
|
|
QString m_prerelease;
|
2016-01-01 23:35:54 +00:00
|
|
|
};
|