2016-01-01 23:35:54 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
2017-03-26 19:40:03 +01:00
|
|
|
// NOTE: apparently the GNU C library pollutes the global namespace with these... undef them.
|
|
|
|
#ifdef major
|
2023-08-14 17:16:53 +01:00
|
|
|
#undef major
|
2017-03-26 19:40:03 +01:00
|
|
|
#endif
|
|
|
|
#ifdef minor
|
2023-08-14 17:16:53 +01:00
|
|
|
#undef minor
|
2017-03-26 19:40:03 +01:00
|
|
|
#endif
|
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
class JavaVersion {
|
2016-01-01 23:35:54 +00:00
|
|
|
friend class JavaVersionTest;
|
2023-08-14 17:16:53 +01:00
|
|
|
|
|
|
|
public:
|
2023-06-05 06:46:05 +01:00
|
|
|
JavaVersion() {}
|
2023-08-14 17:16:53 +01:00
|
|
|
JavaVersion(const QString& rhs);
|
2018-07-15 13:51:05 +01:00
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
JavaVersion& operator=(const QString& rhs);
|
2018-07-15 13:51:05 +01:00
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
bool operator<(const JavaVersion& rhs);
|
|
|
|
bool operator==(const JavaVersion& rhs);
|
|
|
|
bool operator>(const JavaVersion& rhs);
|
2018-07-15 13:51:05 +01:00
|
|
|
|
2016-01-01 23:35:54 +00:00
|
|
|
bool requiresPermGen();
|
2018-07-15 13:51:05 +01:00
|
|
|
|
2023-07-29 10:00:33 +01:00
|
|
|
QString toString() const;
|
2018-07-15 13:51:05 +01:00
|
|
|
|
2023-08-14 17:16:53 +01:00
|
|
|
int major() { return m_major; }
|
|
|
|
int minor() { return m_minor; }
|
|
|
|
int security() { return m_security; }
|
|
|
|
|
|
|
|
private:
|
2016-06-16 01:20:23 +01: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
|
|
|
};
|