X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Foutput%2FBasicOutput.java;h=30c2ac66642d2608391b8543af76a9366e679b9e;hb=5083ef84efb7e001c0b5de235d3424e1b59c62f4;hp=4607827b14e8010e98b844d0becd3c3df2e61463;hpb=211f7ddb50f68aa8a999023ef6d63d5756bdace6;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/output/BasicOutput.java b/src/be/nikiroo/fanfix/output/BasicOutput.java index 4607827..30c2ac6 100644 --- a/src/be/nikiroo/fanfix/output/BasicOutput.java +++ b/src/be/nikiroo/fanfix/output/BasicOutput.java @@ -110,17 +110,19 @@ public abstract class BasicOutput { /** * Call {@link OutputType#valueOf(String)} after conversion to upper - * case but return NULL for NULL and empty instead of raising an + * case but return def for NULL and empty instead of raising an * exception. * * @param typeName * the possible type name + * @param def + * the default value * * @return NULL or the type */ - public static OutputType valueOfNullOkUC(String typeName) { + public static OutputType valueOfNullOkUC(String typeName, OutputType def) { if (typeName == null || typeName.isEmpty()) { - return null; + return def; } return OutputType.valueOfUC(typeName); @@ -128,19 +130,20 @@ public abstract class BasicOutput { /** * Call {@link OutputType#valueOf(String)} after conversion to upper - * case but return NULL in case of error instead of raising an - * exception. + * case but return def in case of error instead of raising an exception. * * @param typeName * the possible type name + * @param def + * the default value * * @return NULL or the type */ - public static OutputType valueOfAllOkUC(String typeName) { + public static OutputType valueOfAllOkUC(String typeName, OutputType def) { try { return OutputType.valueOfUC(typeName); } catch (Exception e) { - return null; + return def; } } } @@ -237,6 +240,25 @@ public abstract class BasicOutput { return type; } + /** + * Enable the creation of a .info file next to the resulting processed file. + * + * @return TRUE to enable it + */ + protected boolean isWriteInfo() { + return writeInfo; + } + + /** + * Enable the creation of a cover file next to the resulting processed file + * if possible. + * + * @return TRUE to enable it + */ + protected boolean isWriteCover() { + return writeCover; + } + /** * The output type. *