From b1a4bcaca860df34f9611919176fd78f2a25d295 Mon Sep 17 00:00:00 2001 From: NebelNidas Date: Sat, 18 Nov 2023 20:40:18 +0100 Subject: [PATCH] Add `MappingFormat#hasWriter` --- .../mappingio/format/MappingFormat.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/fabricmc/mappingio/format/MappingFormat.java b/src/main/java/net/fabricmc/mappingio/format/MappingFormat.java index f0fa135e..3467d5d2 100644 --- a/src/main/java/net/fabricmc/mappingio/format/MappingFormat.java +++ b/src/main/java/net/fabricmc/mappingio/format/MappingFormat.java @@ -19,7 +19,9 @@ import org.jetbrains.annotations.Nullable; /** - * Represents a supported mapping format. Feature comparison table: + * Represents a supported mapping format. Every format can be assumed to have an associated reader available. + * + *

Feature comparison table: * * * @@ -109,58 +111,59 @@ public enum MappingFormat { /** * The {@code Tiny} mapping format, as specified here. */ - TINY_FILE("Tiny file", "tiny", true, true, false, false, false), + TINY_FILE("Tiny file", "tiny", true, true, false, false, false, true), /** * The {@code Tiny v2} mapping format, as specified here. */ - TINY_2_FILE("Tiny v2 file", "tiny", true, true, true, true, true), + TINY_2_FILE("Tiny v2 file", "tiny", true, true, true, true, true, true), /** * Enigma's mapping format, as specified here. */ - ENIGMA_FILE("Enigma file", "mapping", false, true, true, true, false), + ENIGMA_FILE("Enigma file", "mapping", false, true, true, true, false, true), /** * Enigma's mapping format (in directory form), as specified here. */ - ENIGMA_DIR("Enigma directory", null, false, true, true, true, false), + ENIGMA_DIR("Enigma directory", null, false, true, true, true, false, true), /** * The {@code SRG} ({@code Searge RetroGuard}) mapping format, as specified here. */ - SRG_FILE("SRG file", "srg", false, false, false, false, false), + SRG_FILE("SRG file", "srg", false, false, false, false, false, true), /** * The {@code XSRG} ({@code Extended SRG}) mapping format, as specified here. * Same as SRG, but with field descriptors.. */ - XSRG_FILE("XSRG file", "xsrg", false, true, false, false, false), + XSRG_FILE("XSRG file", "xsrg", false, true, false, false, false, true), /** * The {@code CSRG} ({@code Compact SRG}, since it saves disk space over SRG) mapping format, as specified here. */ - CSRG_FILE("CSRG file", "csrg", false, false, false, false, false), + CSRG_FILE("CSRG file", "csrg", false, false, false, false, false, false), /** * The {@code TSRG} ({@code Tiny SRG}, since it saves disk space over SRG) mapping format, as specified here. * Same as CSRG, but hierarchical instead of flat. */ - TSRG_FILE("TSRG file", "tsrg", false, false, false, false, false), + TSRG_FILE("TSRG file", "tsrg", false, false, false, false, false, false), /** * The {@code TSRG v2} mapping format, as specified here. */ - TSRG_2_FILE("TSRG2 file", "tsrg", true, true, false, true, false), + TSRG_2_FILE("TSRG2 file", "tsrg", true, true, false, true, false, false), /** * ProGuard's mapping format, as specified here. */ - PROGUARD_FILE("ProGuard file", "txt", false, true, false, false, false); + PROGUARD_FILE("ProGuard file", "txt", false, true, false, false, false, true); MappingFormat(String name, @Nullable String fileExt, boolean hasNamespaces, boolean hasFieldDescriptors, - boolean supportsComments, boolean supportsArgs, boolean supportsLocals) { + boolean supportsComments, boolean supportsArgs, boolean supportsLocals, + boolean hasWriter) { this.name = name; this.fileExt = fileExt; this.hasNamespaces = hasNamespaces; @@ -168,6 +171,7 @@ public enum MappingFormat { this.supportsComments = supportsComments; this.supportsArgs = supportsArgs; this.supportsLocals = supportsLocals; + this.hasWriter = hasWriter; } public boolean hasSingleFile() { @@ -188,4 +192,5 @@ public String getGlobPattern() { public final boolean supportsComments; public final boolean supportsArgs; public final boolean supportsLocals; + public final boolean hasWriter; }
Format