From bc3d4bf24dd22a624580f74d539eaed481dcb92b Mon Sep 17 00:00:00 2001 From: NebelNidas Date: Sat, 18 Nov 2023 20:40:18 +0100 Subject: [PATCH 1/2] 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 c81e5249..22714ca6 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} ("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} ("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} ("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} ("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; } From c756a7232514e88075c2d7452400944d2f277d76 Mon Sep 17 00:00:00 2001 From: NebelNidas Date: Fri, 1 Dec 2023 00:23:44 +0100 Subject: [PATCH 2/2] Add changes to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d39ca3a..d6ec59f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Added `MappingFormat#hasWriter` boolean ## [0.5.1] - 2023-11-30 - Improved documentation
Format