2016-01-02 05:05:54 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
#include <QString>
|
|
|
|
|
2017-03-27 00:10:03 +05:30
|
|
|
// NOTE: apparently the GNU C library pollutes the global namespace with these... undef them.
|
|
|
|
#ifdef major
|
2018-07-15 18:21:05 +05:30
|
|
|
#undef major
|
2017-03-27 00:10:03 +05:30
|
|
|
#endif
|
|
|
|
#ifdef minor
|
2018-07-15 18:21:05 +05:30
|
|
|
#undef minor
|
2017-03-27 00:10:03 +05:30
|
|
|
#endif
|
|
|
|
|
2016-01-02 05:05:54 +05:30
|
|
|
class MULTIMC_LOGIC_EXPORT JavaVersion
|
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
friend class JavaVersionTest;
|
2016-01-02 05:05:54 +05:30
|
|
|
public:
|
2018-07-15 18:21:05 +05:30
|
|
|
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-02 05:05:54 +05:30
|
|
|
private:
|
2018-07-15 18:21:05 +05:30
|
|
|
QString m_string;
|
|
|
|
int m_major = 0;
|
|
|
|
int m_minor = 0;
|
|
|
|
int m_security = 0;
|
|
|
|
bool m_parseable = false;
|
|
|
|
QString m_prerelease;
|
2016-01-02 05:05:54 +05:30
|
|
|
};
|