aboutsummaryrefslogtreecommitdiff
path: root/launcher/java/JavaVersion.h
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/java/JavaVersion.h')
-rw-r--r--launcher/java/JavaVersion.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/launcher/java/JavaVersion.h b/launcher/java/JavaVersion.h
new file mode 100644
index 00000000..9bbf0642
--- /dev/null
+++ b/launcher/java/JavaVersion.h
@@ -0,0 +1,49 @@
+#pragma once
+
+#include <QString>
+
+// NOTE: apparently the GNU C library pollutes the global namespace with these... undef them.
+#ifdef major
+ #undef major
+#endif
+#ifdef minor
+ #undef minor
+#endif
+
+class JavaVersion
+{
+ friend class JavaVersionTest;
+public:
+ 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;
+ }
+private:
+ QString m_string;
+ int m_major = 0;
+ int m_minor = 0;
+ int m_security = 0;
+ bool m_parseable = false;
+ QString m_prerelease;
+};