summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/util/JOCLVersion.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-11-18 02:50:04 +0100
committerMichael Bien <[email protected]>2010-11-18 02:50:04 +0100
commit0e7aa3b2d14153e024cd3462ca7179d579a3c99a (patch)
tree055c74eeb94d89a2483394366f2bdf1e3f546bc1 /src/com/jogamp/opencl/util/JOCLVersion.java
parent5fa0a7027a4edcad76f182b344ababfb29a58a8e (diff)
added JOCLVersion utility and integrated in CLPlatform.
added spec version to manifest, updated CLInfo.
Diffstat (limited to 'src/com/jogamp/opencl/util/JOCLVersion.java')
-rw-r--r--src/com/jogamp/opencl/util/JOCLVersion.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/util/JOCLVersion.java b/src/com/jogamp/opencl/util/JOCLVersion.java
new file mode 100644
index 00000000..f4faacef
--- /dev/null
+++ b/src/com/jogamp/opencl/util/JOCLVersion.java
@@ -0,0 +1,65 @@
+/*
+ * Created on Monday, November 15 2010 19:44
+ */
+package com.jogamp.opencl.util;
+
+import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.JogampVersion;
+import com.jogamp.common.util.VersionUtil;
+import java.util.jar.Manifest;
+
+
+/**
+ *
+ * @author Michael Bien
+ */
+public class JOCLVersion extends JogampVersion {
+
+ private static final String PACKAGE = "com.jogamp.opencl";
+
+ private JOCLVersion(Manifest mf) {
+ super(PACKAGE, mf);
+ }
+
+ private static JOCLVersion createInstance(){
+ Manifest manifest = VersionUtil.getManifest(JOCLVersion.class.getClassLoader(), PACKAGE);
+ return new JOCLVersion(manifest);
+ }
+
+ public static String getVersion() {
+ return createInstance().toString();
+ }
+
+ public static String getAllVersions() {
+
+ StringBuilder sb = new StringBuilder();
+
+ sb.append(SEPERATOR).append(Platform.getNewline());
+ sb.append(VersionUtil.getPlatformInfo(null));
+ sb.append(SEPERATOR).append(Platform.getNewline());
+
+ createInstance().toString(sb);
+
+ sb.append(GlueGenVersion.getInstance().toString());
+
+ return sb.toString();
+ }
+
+
+ public StringBuilder toString(StringBuilder sb) {
+ return sb.append(toString((StringBuffer)null));
+ }
+
+ @Override
+ public StringBuffer toString(StringBuffer sb) {
+ if(sb == null) {
+ sb = new StringBuffer();
+ }
+ return super.toString(sb);
+ }
+
+ public static void main(String[] args) {
+ System.out.println(JOCLVersion.getAllVersions());
+ }
+}