diff --git a/README.MD b/README.MD index f9b123bf..656305e0 100644 --- a/README.MD +++ b/README.MD @@ -52,7 +52,7 @@ As the core of the SabreTools suite, the C# library provides nearly all of the f * Stores the header information linked to unheadered hash * **Rebuild From DAT** - Act as a simple rebuilder for files * Two options for rebuild origin: standard folder and Romba depot - * Multiple output formats: unarchived, TAR, TorrentZip, 7zip, XZ, TorrentGZ + * Multiple output formats: unarchived, TAR, TorrentZip, 7zip, TorrentGZ * Can rebuild from multiple DATs at the same time * Cross-check with multiple hashing algorithms, up to SHA-512 * Can output a fixdat based on the rebuilt files diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index a4316d90..084b3650 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; -using System.Runtime.CompilerServices; using System.Threading.Tasks; using SabreTools.Library.Data; @@ -14,8 +13,6 @@ using SabreTools.Library.Skippers; using SabreTools.Library.Tools; using NaturalSort; -[assembly: InternalsVisibleTo("SabreTools")] -[assembly: InternalsVisibleTo("RombaSharp")] namespace SabreTools.Library.DatFiles { /// @@ -23,13 +20,13 @@ namespace SabreTools.Library.DatFiles /// public abstract class DatFile { - #region Private instance variables + #region Publically available fields // Internal DatHeader values - internal DatHeader DatHeader = new DatHeader(); + public DatHeader DatHeader { get; set; } = new DatHeader(); // DatItems dictionary - internal ItemDictionary Items = new ItemDictionary(); + public ItemDictionary Items { get; set; } = new ItemDictionary(); #endregion diff --git a/SabreTools.Library/FileTypes/CHDFileV1.cs b/SabreTools.Library/FileTypes/CHD/CHDFileV1.cs similarity index 97% rename from SabreTools.Library/FileTypes/CHDFileV1.cs rename to SabreTools.Library/FileTypes/CHD/CHDFileV1.cs index 6a689975..500de9d7 100644 --- a/SabreTools.Library/FileTypes/CHDFileV1.cs +++ b/SabreTools.Library/FileTypes/CHD/CHDFileV1.cs @@ -4,12 +4,12 @@ using System.Text; using SabreTools.Library.Tools; -namespace SabreTools.Library.FileTypes +namespace SabreTools.Library.FileTypes.CHD { /// /// CHD V1 File /// - public class CHDFileV1 : CHDFile + internal class CHDFileV1 : CHDFile { /// /// CHD flags diff --git a/SabreTools.Library/FileTypes/CHDFileV2.cs b/SabreTools.Library/FileTypes/CHD/CHDFileV2.cs similarity index 97% rename from SabreTools.Library/FileTypes/CHDFileV2.cs rename to SabreTools.Library/FileTypes/CHD/CHDFileV2.cs index eabedd4a..a7cd21b4 100644 --- a/SabreTools.Library/FileTypes/CHDFileV2.cs +++ b/SabreTools.Library/FileTypes/CHD/CHDFileV2.cs @@ -4,12 +4,12 @@ using System.Text; using SabreTools.Library.Tools; -namespace SabreTools.Library.FileTypes +namespace SabreTools.Library.FileTypes.CHD { /// /// CHD V2 File /// - public class CHDFileV2 : CHDFile + internal class CHDFileV2 : CHDFile { /// /// CHD flags diff --git a/SabreTools.Library/FileTypes/CHDFileV3.cs b/SabreTools.Library/FileTypes/CHD/CHDFileV3.cs similarity index 97% rename from SabreTools.Library/FileTypes/CHDFileV3.cs rename to SabreTools.Library/FileTypes/CHD/CHDFileV3.cs index 9b7600a5..b7fc5f5f 100644 --- a/SabreTools.Library/FileTypes/CHDFileV3.cs +++ b/SabreTools.Library/FileTypes/CHD/CHDFileV3.cs @@ -4,12 +4,12 @@ using System.Text; using SabreTools.Library.Tools; -namespace SabreTools.Library.FileTypes +namespace SabreTools.Library.FileTypes.CHD { /// /// CHD V3 File /// - public class CHDFileV3 : CHDFile + internal class CHDFileV3 : CHDFile { /// /// CHD flags diff --git a/SabreTools.Library/FileTypes/CHDFileV4.cs b/SabreTools.Library/FileTypes/CHD/CHDFileV4.cs similarity index 97% rename from SabreTools.Library/FileTypes/CHDFileV4.cs rename to SabreTools.Library/FileTypes/CHD/CHDFileV4.cs index 9f210897..d64fb395 100644 --- a/SabreTools.Library/FileTypes/CHDFileV4.cs +++ b/SabreTools.Library/FileTypes/CHD/CHDFileV4.cs @@ -4,12 +4,12 @@ using System.Text; using SabreTools.Library.Tools; -namespace SabreTools.Library.FileTypes +namespace SabreTools.Library.FileTypes.CHD { /// /// CHD V4 File /// - public class CHDFileV4 : CHDFile + internal class CHDFileV4 : CHDFile { /// /// CHD flags diff --git a/SabreTools.Library/FileTypes/CHDFileV5.cs b/SabreTools.Library/FileTypes/CHD/CHDFileV5.cs similarity index 97% rename from SabreTools.Library/FileTypes/CHDFileV5.cs rename to SabreTools.Library/FileTypes/CHD/CHDFileV5.cs index 5e5b7a9d..098d8058 100644 --- a/SabreTools.Library/FileTypes/CHDFileV5.cs +++ b/SabreTools.Library/FileTypes/CHD/CHDFileV5.cs @@ -3,12 +3,12 @@ using System.Text; using SabreTools.Library.Tools; -namespace SabreTools.Library.FileTypes +namespace SabreTools.Library.FileTypes.CHD { /// /// CHD V5 File /// - public class CHDFileV5 : CHDFile + internal class CHDFileV5 : CHDFile { /// /// Uncompressed map format diff --git a/SabreTools.Library/FileTypes/CHDFile.cs b/SabreTools.Library/FileTypes/CHDFile.cs index c57c14a8..07a08137 100644 --- a/SabreTools.Library/FileTypes/CHDFile.cs +++ b/SabreTools.Library/FileTypes/CHDFile.cs @@ -3,6 +3,7 @@ using System.IO; using System.Text; using SabreTools.Library.Data; +using SabreTools.Library.FileTypes.CHD; using SabreTools.Library.Tools; namespace SabreTools.Library.FileTypes diff --git a/SabreTools.Library/README.1ST b/SabreTools.Library/README.1ST index 634b4bbe..b1ace859 100644 --- a/SabreTools.Library/README.1ST +++ b/SabreTools.Library/README.1ST @@ -662,31 +662,6 @@ Options: and output for physical files. Where appropriate, Romba depot files will be created as well. - -tlrz, --torrent-lrzip Enable Torrent Long-Range Zip output [UNIMPLEMENTED] - Instead of outputting the files to folder, files will be rebuilt to - Torrent Long-Range Zip (TLRZ) files. This format is based on the - LRZip file format as defined at https://github.com/ckolivas/lrzip but - with custom header information. This is currently unused by any major - application. - - -tlz4, --torrent-lz4 Enable Torrent LZ4 output [UNIMPLEMENTED] - Instead of outputting the files to folder, files will be rebuilt to - Torrent LZ4 (TLZ4) files. This format is based on the LZ4 file format - as defined at https://github.com/lz4/lz4 but with custom header - information. This is currently unused by any major application. - - -trar, --torrent-rar Enable Torrent RAR output [UNIMPLEMENTED] - Instead of outputting files to folder, files will be rebuilt to - Torrent RAR (TRAR) files. This format is based on the RAR propietary - format but with custom header information. This is currently unused - by any major application. - - -txz, --torrent-xz Enable Torrent XZ output [UNIMPLEMENTED] - Instead of outputting files to folder, files will be rebuilt to - Torrent XZ (TXZ) files. This format is based on the LZMA container - format XZ, but with a file name replaced by the SHA-1 of the file - inside. This is currently unused by any major application. - -tzip, --torrent-zip Enable Torrent Zip output Instead of outputting files to folder, files will be rebuilt to TorrentZip (TZip) files. This format is based on the ZIP archive @@ -694,20 +669,6 @@ Options: external tool RomVault (http://www.romvault.com/) and is already widely used. - -tzpaq, --torrent-zpaq Enable Torrent ZPAQ output [UNIMPLEMENTED] - Instead of outputting the files to folder, files will be rebuilt to - Torrent ZPAQ (TZPAQ) files. This format is based on the ZPAQ file - format as defined at https://github.com/zpaq/zpaq but with custom - header information. This is currently unused by any major - application. - - -tzstd, --torrent-zstd Enable Torrent Zstd output [UNIMPLEMENTED] - Instead of outputting the files to folder, files will be rebuilt to - Torrent Zstd (TZstd) files. This format is based on the Zstd file - format as defined at https://github.com/skbkontur/ZstdNet but with - custom header information. This is currently unused by any major - application. - -h=, --header= Set a header skipper to use, blank means all Set the header special field for the output DAT(s). In file rebuilding, this flag allows for either all copier headers (using string.Empty) @@ -1946,13 +1907,7 @@ This section contains remappings from old flag names to new ones. -t7z, --t7z -> -t7z, --torrent-7zip -text, --text -> -srt=text, --report-type=text -tgz, --tgz -> -tgz, --torrent-gzip --tlrz, --tlrz -> -tlrz, --torrent-lrzip --tlz4, --tlz4 -> -tlz4, --torrent-lz4 --trar, --trar -> -trar, --torrent-rar --txz, --txz -> -txz, --torrent-xz -tzip, --tzip -> -tzip, --torrent-zip --tzpaq, --tzpaq -> -tzpaq, --torrent-zpaq --tzstd, --tzstd -> -tzstd, --torrent-zstd -udd, --update-desc -> -udd, --update-description -um, --update-manu -> -um, --update-manufacturer -xof, --exclude-of -> (-ef=romof -ef=cloneof -ef=sampleof diff --git a/SabreTools/SabreTools.Help.cs b/SabreTools/SabreTools.Help.cs index abdbbd19..6219ebf9 100644 --- a/SabreTools/SabreTools.Help.cs +++ b/SabreTools/SabreTools.Help.cs @@ -977,62 +977,6 @@ namespace SabreTools } } - public const string TorrentLrzipValue = "torrent-lrzip"; - private static Feature TorrentLrzipFlag - { - get - { - return new Feature( - TorrentLrzipValue, - new List() { "-tlrz", "--torrent-lrzip" }, - "Enable Torrent Long-Range Zip output [UNIMPLEMENTED]", - FeatureType.Flag, - longDescription: "Instead of outputting the files to folder, files will be rebuilt to Torrent Long-Range Zip (TLRZ) files. This format is based on the LRZip file format as defined at https://github.com/ckolivas/lrzip but with custom header information. This is currently unused by any major application."); - } - } - - public const string TorrentLz4Value = "torrent-lz4"; - private static Feature TorrentLz4Flag - { - get - { - return new Feature( - TorrentLz4Value, - new List() { "-tlz4", "--torrent-lz4" }, - "Enable Torrent LZ4 output [UNIMPLEMENTED]", - FeatureType.Flag, - longDescription: "Instead of outputting the files to folder, files will be rebuilt to Torrent LZ4 (TLZ4) files. This format is based on the LZ4 file format as defined at https://github.com/lz4/lz4 but with custom header information. This is currently unused by any major application."); - } - } - - public const string TorrentRarValue = "torrent-rar"; - private static Feature TorrentRarFlag - { - get - { - return new Feature( - TorrentRarValue, - new List() { "-trar", "--torrent-rar" }, - "Enable Torrent RAR output [UNIMPLEMENTED]", - FeatureType.Flag, - longDescription: "Instead of outputting files to folder, files will be rebuilt to Torrent RAR (TRAR) files. This format is based on the RAR propietary format but with custom header information. This is currently unused by any major application."); - } - } - - public const string TorrentXzValue = "torrent-xz"; - private static Feature TorrentXzFlag - { - get - { - return new Feature( - TorrentXzValue, - new List() { "-txz", "--torrent-xz" }, - "Enable Torrent XZ output [UNIMPLEMENTED]", - FeatureType.Flag, - longDescription: "Instead of outputting files to folder, files will be rebuilt to Torrent XZ (TXZ) files. This format is based on the LZMA container format XZ, but with a file name replaced by the SHA-1 of the file inside. This is currently unused by any major application."); - } - } - public const string TorrentZipValue = "torrent-zip"; private static Feature TorrentZipFlag { @@ -1047,34 +991,6 @@ namespace SabreTools } } - public const string TorrentZpaqValue = "torrent-zpaq"; - private static Feature TorrentZpaqFlag - { - get - { - return new Feature( - TorrentZpaqValue, - new List() { "-tzpaq", "--torrent-zpaq" }, - "Enable Torrent ZPAQ output [UNIMPLEMENTED]", - FeatureType.Flag, - longDescription: "Instead of outputting the files to folder, files will be rebuilt to Torrent ZPAQ (TZPAQ) files. This format is based on the ZPAQ file format as defined at https://github.com/zpaq/zpaq but with custom header information. This is currently unused by any major application."); - } - } - - public const string TorrentZstdValue = "torrent-zstd"; - private static Feature TorrentZstdFlag - { - get - { - return new Feature( - TorrentZstdValue, - new List() { "-tzstd", "--torrent-zstd" }, - "Enable Torrent Zstd output [UNIMPLEMENTED]", - FeatureType.Flag, - longDescription: "Instead of outputting the files to folder, files will be rebuilt to Torrent Zstd (TZstd) files. This format is based on the Zstd file format as defined at https://github.com/skbkontur/ZstdNet but with custom header information. This is currently unused by any major application."); - } - } - public const string TrimValue = "trim"; private static Feature TrimFlag { @@ -2618,20 +2534,20 @@ Some special strings that can be used: return OutputFormat.Torrent7Zip; else if (GetBoolean(features, TorrentGzipValue)) return OutputFormat.TorrentGzip; - else if (GetBoolean(features, TorrentLrzipValue)) - return OutputFormat.TorrentLRZip; - else if (GetBoolean(features, TorrentLz4Value)) - return OutputFormat.TorrentLZ4; - else if (GetBoolean(features, TorrentRarValue)) - return OutputFormat.TorrentRar; - else if (GetBoolean(features, TorrentXzValue)) - return OutputFormat.TorrentXZ; + //else if (GetBoolean(features, TorrentLrzipValue)) + // return OutputFormat.TorrentLRZip; + //else if (GetBoolean(features, TorrentLz4Value)) + // return OutputFormat.TorrentLZ4; + //else if (GetBoolean(features, TorrentRarValue)) + // return OutputFormat.TorrentRar; + //else if (GetBoolean(features, TorrentXzValue)) + // return OutputFormat.TorrentXZ; else if (GetBoolean(features, TorrentZipValue)) return OutputFormat.TorrentZip; - else if (GetBoolean(features, TorrentZpaqValue)) - return OutputFormat.TorrentZPAQ; - else if (GetBoolean(features, TorrentZstdValue)) - return OutputFormat.TorrentZstd; + //else if (GetBoolean(features, TorrentZpaqValue)) + // return OutputFormat.TorrentZPAQ; + //else if (GetBoolean(features, TorrentZstdValue)) + // return OutputFormat.TorrentZstd; else return OutputFormat.Folder; } @@ -3153,13 +3069,14 @@ The following systems have headers that this program can work with: AddFeature(TarFlag); AddFeature(TorrentGzipFlag); this[TorrentGzipFlag].AddFeature(RombaFlag); - AddFeature(TorrentLrzipFlag); - AddFeature(TorrentLz4Flag); - AddFeature(TorrentRarFlag); - AddFeature(TorrentXzFlag); + //AddFeature(TorrentLrzipFlag); + //AddFeature(TorrentLz4Flag); + //AddFeature(TorrentRarFlag); + //AddFeature(TorrentXzFlag); + //this[TorrentXzFlag].AddFeature(RombaFlag); AddFeature(TorrentZipFlag); - AddFeature(TorrentZpaqFlag); - AddFeature(TorrentZstdFlag); + //AddFeature(TorrentZpaqFlag); + //AddFeature(TorrentZstdFlag); AddFeature(HeaderStringInput); AddFeature(DatMergedFlag); AddFeature(DatSplitFlag);