]> gitweb.hhaalo.de Git - discspan-java.git/commitdiff
move files in correct namespace folder
authorBastian Dehn <hhaalo@arcor.de>
Fri, 4 Feb 2022 09:13:01 +0000 (10:13 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 4 Feb 2022 09:13:01 +0000 (10:13 +0100)
CMakeLists.txt
src/de/hhaalo/discspan.java [deleted file]
src/de/hhaalo/discspan/Iparameter.java [new file with mode: 0644]
src/de/hhaalo/discspan/discspan.java [new file with mode: 0644]
src/de/hhaalo/discspan/parameter.java [new file with mode: 0644]
src/de/hhaalo/parameter.java [deleted file]

index c901f299188f09061247c31b40ad3cc3af0ec727..02f64ba92d4d7ca0c50070e5805d478f4eb07da7 100644 (file)
@@ -7,7 +7,7 @@ include(UseJava)
 find_jar(GNUGETOPT "gnu-getopt")
 message("-- gnu-getopt file: ${GNUGETOPT}")
 
-set(SRC_PREFIX "src/de/hhaalo")
+set(SRC_PREFIX "src/de/hhaalo/discspan")
 set(SRC_FILES
        "${SRC_PREFIX}/discspan.java"
        "${SRC_PREFIX}/Iparameter.java"
diff --git a/src/de/hhaalo/discspan.java b/src/de/hhaalo/discspan.java
deleted file mode 100644 (file)
index 6856ccd..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package de.hhaalo.discspan;
-
-import java.io.File;
-
-public class discspan
-{
-       public static void main(String[] args)
-       {
-               Iparameter param = new parameter(args);
-
-               if (param.getInput() == ""
-                               || param.getOutput() == ""
-                               || param.getSplit() < 2048) {
-                       System.err.println("ERROR: missing arguments");
-                       System.exit(1);
-               }
-
-               File inputFile = new File(param.getInput());
-               if (!inputFile.exists()) {
-                       System.err.println("ERROR: " + param.getInput()
-                                       + " file does not exists");
-               }
-       }
-}
diff --git a/src/de/hhaalo/discspan/Iparameter.java b/src/de/hhaalo/discspan/Iparameter.java
new file mode 100644 (file)
index 0000000..a76810e
--- /dev/null
@@ -0,0 +1,8 @@
+package de.hhaalo.discspan;
+
+public interface Iparameter
+{
+       public String getInput();
+       public String getOutput();
+       public long getSplit();
+}
diff --git a/src/de/hhaalo/discspan/discspan.java b/src/de/hhaalo/discspan/discspan.java
new file mode 100644 (file)
index 0000000..6856ccd
--- /dev/null
@@ -0,0 +1,24 @@
+package de.hhaalo.discspan;
+
+import java.io.File;
+
+public class discspan
+{
+       public static void main(String[] args)
+       {
+               Iparameter param = new parameter(args);
+
+               if (param.getInput() == ""
+                               || param.getOutput() == ""
+                               || param.getSplit() < 2048) {
+                       System.err.println("ERROR: missing arguments");
+                       System.exit(1);
+               }
+
+               File inputFile = new File(param.getInput());
+               if (!inputFile.exists()) {
+                       System.err.println("ERROR: " + param.getInput()
+                                       + " file does not exists");
+               }
+       }
+}
diff --git a/src/de/hhaalo/discspan/parameter.java b/src/de/hhaalo/discspan/parameter.java
new file mode 100644 (file)
index 0000000..f1bfc82
--- /dev/null
@@ -0,0 +1,83 @@
+package de.hhaalo.discspan;
+
+import gnu.getopt.Getopt;
+
+public class parameter implements Iparameter
+{
+       private String _input = "";
+       private String _output = "";
+       private long _split = 0;
+
+       public String getInput() { return _input; }
+       public String getOutput() { return _output; }
+       public long getSplit() { return _split; }
+
+       public parameter(String argv[])
+       {
+               final Long bluray = Long.parseUnsignedLong("24159191040");
+               final Long dvd9 = Long.parseUnsignedLong("8500000000");
+               final Long dvd5 = Long.parseUnsignedLong("4700000000");
+               final Long cd = Long.parseUnsignedLong("734003200");
+
+               Getopt g = new Getopt("discspan", argv, ":59bcf:hi:o:v");
+
+               int c = 0;
+               while ((c = g.getopt()) != -1) {
+                       switch (c) {
+                       case 'i':
+                               _input = g.getOptarg();
+                               break;
+                       case 'o':
+                               _output = g.getOptarg();
+                               break;
+                       case '5':
+                               _split = dvd5;
+                               break;
+                       case '9':
+                               _split = dvd9;
+                               break;
+                       case 'b':
+                               _split = bluray;
+                               break;
+                       case 'c':
+                               _split = cd;
+                               break;
+                       case 'f':
+                               _split = Long.parseUnsignedLong(g.getOptarg());
+                               break;
+                       case 'h':
+                               showVersion();
+                               useage();
+                               System.exit(0);
+                               break;
+                       case 'v':
+                               showVersion();
+                               System.exit(0);
+                               break;
+                       default:
+                               System.err.println("WARNING: " + g.getopt() +  " unknown option");
+                               break;
+                       }
+               }
+       }
+
+       private void showVersion()
+       {
+               System.out.println("discspan 0.1");
+       }
+
+       private void useage()
+       {
+               System.out.print("\nUsage: discspan <option> -i <source> -o <prefix>\n\n");
+               System.out.print("   -i <source>\tpath to source file\n");
+               System.out.print("   -o <prefix>\tprefix for output files\n\n");
+               System.out.print("Option:\n\n");
+               System.out.print("   -b\t\tsize of Bluray: 25.000.000.000 bytes\n");
+               System.out.print("   -9\t\tsize of double layer DVD 8.500.000.000 bytes\n");
+               System.out.print("   -5\t\tsize of sigle layer DVD: 4.700.000.000 bytes\n");
+               System.out.print("   -c\t\tsize of CD: 734.003.200 bytes\n");
+               System.out.print("   -f <size>\tsize in bytes\n");
+               System.out.print("   -v\t\tshow version\n");
+               System.out.print("   -h\t\tshow this help\n\n");
+       }
+}
diff --git a/src/de/hhaalo/parameter.java b/src/de/hhaalo/parameter.java
deleted file mode 100644 (file)
index f1bfc82..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-package de.hhaalo.discspan;
-
-import gnu.getopt.Getopt;
-
-public class parameter implements Iparameter
-{
-       private String _input = "";
-       private String _output = "";
-       private long _split = 0;
-
-       public String getInput() { return _input; }
-       public String getOutput() { return _output; }
-       public long getSplit() { return _split; }
-
-       public parameter(String argv[])
-       {
-               final Long bluray = Long.parseUnsignedLong("24159191040");
-               final Long dvd9 = Long.parseUnsignedLong("8500000000");
-               final Long dvd5 = Long.parseUnsignedLong("4700000000");
-               final Long cd = Long.parseUnsignedLong("734003200");
-
-               Getopt g = new Getopt("discspan", argv, ":59bcf:hi:o:v");
-
-               int c = 0;
-               while ((c = g.getopt()) != -1) {
-                       switch (c) {
-                       case 'i':
-                               _input = g.getOptarg();
-                               break;
-                       case 'o':
-                               _output = g.getOptarg();
-                               break;
-                       case '5':
-                               _split = dvd5;
-                               break;
-                       case '9':
-                               _split = dvd9;
-                               break;
-                       case 'b':
-                               _split = bluray;
-                               break;
-                       case 'c':
-                               _split = cd;
-                               break;
-                       case 'f':
-                               _split = Long.parseUnsignedLong(g.getOptarg());
-                               break;
-                       case 'h':
-                               showVersion();
-                               useage();
-                               System.exit(0);
-                               break;
-                       case 'v':
-                               showVersion();
-                               System.exit(0);
-                               break;
-                       default:
-                               System.err.println("WARNING: " + g.getopt() +  " unknown option");
-                               break;
-                       }
-               }
-       }
-
-       private void showVersion()
-       {
-               System.out.println("discspan 0.1");
-       }
-
-       private void useage()
-       {
-               System.out.print("\nUsage: discspan <option> -i <source> -o <prefix>\n\n");
-               System.out.print("   -i <source>\tpath to source file\n");
-               System.out.print("   -o <prefix>\tprefix for output files\n\n");
-               System.out.print("Option:\n\n");
-               System.out.print("   -b\t\tsize of Bluray: 25.000.000.000 bytes\n");
-               System.out.print("   -9\t\tsize of double layer DVD 8.500.000.000 bytes\n");
-               System.out.print("   -5\t\tsize of sigle layer DVD: 4.700.000.000 bytes\n");
-               System.out.print("   -c\t\tsize of CD: 734.003.200 bytes\n");
-               System.out.print("   -f <size>\tsize in bytes\n");
-               System.out.print("   -v\t\tshow version\n");
-               System.out.print("   -h\t\tshow this help\n\n");
-       }
-}