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"
+++ /dev/null
-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");
- }
- }
-}
--- /dev/null
+package de.hhaalo.discspan;
+
+public interface Iparameter
+{
+ public String getInput();
+ public String getOutput();
+ public long getSplit();
+}
--- /dev/null
+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");
+ }
+ }
+}
--- /dev/null
+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");
+ }
+}
+++ /dev/null
-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");
- }
-}