diff --git a/SabreTools.Core/README.DEPRECIATED b/SabreTools.Core/README.DEPRECIATED
index b7d89ff1..0ee95875 100644
--- a/SabreTools.Core/README.DEPRECIATED
+++ b/SabreTools.Core/README.DEPRECIATED
@@ -209,12 +209,6 @@ Below are originally from SabreTools / DATabase -
4 bytes of the SHA-1, 1 byte for each layer of the directory name. It also
includes two auxilary files, .romba_size and .romba_size.backup, that have the
compressed size of the folder inside for use with Romba.
-
- -tlrz Enable Torrent Long-Range Zip output [NOT IMPLEMENTED]
- Instead of ouputting 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.
-trar Enable Torrent RAR output [NOT IMPLEMENTED]
Instead of outputting files to folder, files will be rebuilt to Torrent RAR (TRAR)
diff --git a/SabreTools.DatItems/DatItem.cs b/SabreTools.DatItems/DatItem.cs
index d539d1e0..bb3722b3 100644
--- a/SabreTools.DatItems/DatItem.cs
+++ b/SabreTools.DatItems/DatItem.cs
@@ -130,22 +130,25 @@ namespace SabreTools.DatItems
/// DatItem of the specific internal type that corresponds to the inputs
public static DatItem? Create(BaseFile? baseFile)
{
- return baseFile?.Type switch
+ return baseFile switch
{
- FileType.AaruFormat => new Media(baseFile),
- FileType.CHD => new Disk(baseFile),
- FileType.GZipArchive => new Rom(baseFile),
- FileType.LRZipArchive => new Rom(baseFile),
- FileType.LZ4Archive => new Rom(baseFile),
- FileType.None => new Rom(baseFile),
- FileType.RarArchive => new Rom(baseFile),
- FileType.SevenZipArchive => new Rom(baseFile),
- FileType.TapeArchive => new Rom(baseFile),
- FileType.XZArchive => new Rom(baseFile),
- FileType.ZipArchive => new Rom(baseFile),
- FileType.ZPAQArchive => new Rom(baseFile),
- FileType.ZstdArchive => new Rom(baseFile),
- _ => null,
+ // Disk
+ FileTypes.CHD.CHDFile => new Disk(baseFile),
+
+ // Media
+ FileTypes.Aaru.AaruFormat => new Media(baseFile),
+
+ // Rom
+ FileTypes.Archives.GZipArchive => new Rom(baseFile),
+ FileTypes.Archives.RarArchive => new Rom(baseFile),
+ FileTypes.Archives.SevenZipArchive => new Rom(baseFile),
+ FileTypes.Archives.TapeArchive => new Rom(baseFile),
+ FileTypes.Archives.XZArchive => new Rom(baseFile),
+ FileTypes.Archives.ZipArchive => new Rom(baseFile),
+
+ // Miscellaneous
+ null => null,
+ _ => new Rom(baseFile),
};
}
diff --git a/SabreTools.DatTools/Rebuilder.cs b/SabreTools.DatTools/Rebuilder.cs
index 5e3b9302..f36c8c6d 100644
--- a/SabreTools.DatTools/Rebuilder.cs
+++ b/SabreTools.DatTools/Rebuilder.cs
@@ -332,15 +332,15 @@ namespace SabreTools.DatTools
if (internalFileInfo == null)
internalDatItem = null;
#if NETFRAMEWORK
- else if (internalFileInfo.Type == FileType.AaruFormat && (asFiles & TreatAsFile.AaruFormat) == 0)
+ else if (internalFileInfo is FileTypes.Aaru.AaruFormat && (asFiles & TreatAsFile.AaruFormat) == 0)
#else
- else if (internalFileInfo.Type == FileType.AaruFormat && !asFiles.HasFlag(TreatAsFile.AaruFormat))
+ else if (internalFileInfo is FileTypes.Aaru.AaruFormat && !asFiles.HasFlag(TreatAsFile.AaruFormat))
#endif
internalDatItem = new Media(internalFileInfo);
#if NETFRAMEWORK
- else if (internalFileInfo.Type == FileType.CHD && (asFiles & TreatAsFile.CHD) == 0)
+ else if (internalFileInfo is FileTypes.CHD.CHDFile && (asFiles & TreatAsFile.CHD) == 0)
#else
- else if (internalFileInfo.Type == FileType.CHD && !asFiles.HasFlag(TreatAsFile.CHD))
+ else if (internalFileInfo is FileTypes.CHD.CHDFile && !asFiles.HasFlag(TreatAsFile.CHD))
#endif
internalDatItem = new Disk(internalFileInfo);
else
@@ -851,7 +851,6 @@ namespace SabreTools.DatTools
OutputFormat.Torrent7Zip => "Torrent7Z",
OutputFormat.TorrentGzip => "TorrentGZ",
OutputFormat.TorrentGzipRomba => "TorrentGZ",
- OutputFormat.TorrentLRZip => "TorrentLRZ",
OutputFormat.TorrentRar => "TorrentRAR",
OutputFormat.TorrentXZ => "TorrentXZ",
OutputFormat.TorrentXZRomba => "TorrentXZ",
diff --git a/SabreTools.FileTypes/Aaru/AaruFormat.cs b/SabreTools.FileTypes/Aaru/AaruFormat.cs
index fc1120d0..3861a162 100644
--- a/SabreTools.FileTypes/Aaru/AaruFormat.cs
+++ b/SabreTools.FileTypes/Aaru/AaruFormat.cs
@@ -44,7 +44,6 @@ namespace SabreTools.FileTypes.Aaru
///
public AaruFormat()
{
- Type = FileType.AaruFormat;
}
///
@@ -71,12 +70,8 @@ namespace SabreTools.FileTypes.Aaru
if (!validated)
return null;
- // Read and retrun the current AaruFormat
- AaruFormat? generated = Deserialize(aarustream);
- if (generated != null)
- generated.Type = FileType.AaruFormat;
-
- return generated;
+ // Read and return the current AaruFormat
+ return Deserialize(aarustream);
}
catch
{
diff --git a/SabreTools.FileTypes/Archives/GZipArchive.cs b/SabreTools.FileTypes/Archives/GZipArchive.cs
index e6745d11..265e2900 100644
--- a/SabreTools.FileTypes/Archives/GZipArchive.cs
+++ b/SabreTools.FileTypes/Archives/GZipArchive.cs
@@ -55,7 +55,6 @@ namespace SabreTools.FileTypes.Archives
public GZipArchive()
: base()
{
- this.Type = FileType.GZipArchive;
}
///
@@ -67,7 +66,6 @@ namespace SabreTools.FileTypes.Archives
public GZipArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
- this.Type = FileType.GZipArchive;
}
#endregion
diff --git a/SabreTools.FileTypes/Archives/LRZipArchive.cs b/SabreTools.FileTypes/Archives/LRZipArchive.cs
deleted file mode 100644
index 400dc026..00000000
--- a/SabreTools.FileTypes/Archives/LRZipArchive.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace SabreTools.FileTypes.Archives
-{
- ///
- /// Represents a TorrentLRZip archive for reading and writing
- ///
- /// TODO: Implement from source at https://github.com/ckolivas/lrzip
- public class LRZipArchive : BaseArchive
- {
- #region Constructors
-
- ///
- /// Create a new LRZipArchive with no base file
- ///
- public LRZipArchive()
- : base()
- {
- this.Type = FileType.LRZipArchive;
- }
-
- ///
- /// Create a new LRZipArchive from the given file
- ///
- /// Name of the file to use as an archive
- /// True if hashes for this file should be calculated, false otherwise (default)
- public LRZipArchive(string filename, bool getHashes = false)
- : base(filename, getHashes)
- {
- this.Type = FileType.LRZipArchive;
- }
-
- #endregion
-
- #region Extraction
-
- ///
- public override bool CopyAll(string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override string CopyToFile(string entryName, string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override (Stream?, string?) GetEntryStream(string entryName)
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Information
-
- ///
- public override List GetChildren()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override List GetEmptyFolders()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool IsTorrent()
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Writing
-
- ///
- public override bool Write(string inputFile, string outDir, BaseFile? baseFile)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(Stream? inputStream, string outDir, BaseFile? baseFile)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(List inputFiles, string outDir, List? baseFiles)
- {
- throw new NotImplementedException();
- }
-
- #endregion
- }
-}
diff --git a/SabreTools.FileTypes/Archives/LZ4Archive.cs b/SabreTools.FileTypes/Archives/LZ4Archive.cs
deleted file mode 100644
index 63202962..00000000
--- a/SabreTools.FileTypes/Archives/LZ4Archive.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace SabreTools.FileTypes.Archives
-{
- ///
- /// Represents a TorrentLRZip archive for reading and writing
- ///
- /// TODO: Implement from source at https://github.com/lz4/lz4
- public class LZ4Archive : BaseArchive
- {
- #region Constructors
-
- ///
- /// Create a new LZ4Archive with no base file
- ///
- public LZ4Archive()
- : base()
- {
- this.Type = FileType.LZ4Archive;
- }
-
- ///
- /// Create a new LZ4Archive from the given file
- ///
- /// Name of the file to use as an archive
- /// True if hashes for this file should be calculated, false otherwise (default)
- public LZ4Archive(string filename, bool getHashes = false)
- : base(filename, getHashes)
- {
- this.Type = FileType.LZ4Archive;
- }
-
- #endregion
-
- #region Extraction
-
- ///
- public override bool CopyAll(string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override string CopyToFile(string entryName, string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override (Stream?, string?) GetEntryStream(string entryName)
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Information
-
- ///
- public override List GetChildren()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override List GetEmptyFolders()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool IsTorrent()
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Writing
-
- ///
- public override bool Write(string inputFile, string outDir, BaseFile? rom)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(Stream? inputStream, string outDir, BaseFile? rom)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(List inputFiles, string outDir, List? baseFiles)
- {
- throw new NotImplementedException();
- }
-
- #endregion
- }
-}
diff --git a/SabreTools.FileTypes/Archives/RarArchive.cs b/SabreTools.FileTypes/Archives/RarArchive.cs
index 7c7377dc..2647868b 100644
--- a/SabreTools.FileTypes/Archives/RarArchive.cs
+++ b/SabreTools.FileTypes/Archives/RarArchive.cs
@@ -25,7 +25,6 @@ namespace SabreTools.FileTypes.Archives
public RarArchive()
: base()
{
- this.Type = FileType.RarArchive;
}
///
@@ -37,7 +36,6 @@ namespace SabreTools.FileTypes.Archives
public RarArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
- this.Type = FileType.RarArchive;
}
#endregion
diff --git a/SabreTools.FileTypes/Archives/SevenZipArchive.cs b/SabreTools.FileTypes/Archives/SevenZipArchive.cs
index c961a117..f65be0b5 100644
--- a/SabreTools.FileTypes/Archives/SevenZipArchive.cs
+++ b/SabreTools.FileTypes/Archives/SevenZipArchive.cs
@@ -71,7 +71,6 @@ namespace SabreTools.FileTypes.Archives
public SevenZipArchive()
: base()
{
- this.Type = FileType.SevenZipArchive;
}
///
@@ -83,7 +82,6 @@ namespace SabreTools.FileTypes.Archives
public SevenZipArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
- this.Type = FileType.SevenZipArchive;
}
#endregion
diff --git a/SabreTools.FileTypes/Archives/TapeArchive.cs b/SabreTools.FileTypes/Archives/TapeArchive.cs
index e783f7fa..942fc952 100644
--- a/SabreTools.FileTypes/Archives/TapeArchive.cs
+++ b/SabreTools.FileTypes/Archives/TapeArchive.cs
@@ -30,7 +30,6 @@ namespace SabreTools.FileTypes.Archives
public TapeArchive()
: base()
{
- this.Type = FileType.TapeArchive;
}
///
@@ -42,7 +41,6 @@ namespace SabreTools.FileTypes.Archives
public TapeArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
- this.Type = FileType.TapeArchive;
}
#endregion
diff --git a/SabreTools.FileTypes/Archives/XZArchive.cs b/SabreTools.FileTypes/Archives/XZArchive.cs
index b2f4bf42..814572f5 100644
--- a/SabreTools.FileTypes/Archives/XZArchive.cs
+++ b/SabreTools.FileTypes/Archives/XZArchive.cs
@@ -46,7 +46,6 @@ namespace SabreTools.FileTypes.Archives
public XZArchive()
: base()
{
- this.Type = FileType.XZArchive;
}
///
@@ -58,7 +57,6 @@ namespace SabreTools.FileTypes.Archives
public XZArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
- this.Type = FileType.XZArchive;
}
#endregion
diff --git a/SabreTools.FileTypes/Archives/ZPAQArchive.cs b/SabreTools.FileTypes/Archives/ZPAQArchive.cs
deleted file mode 100644
index 93f7a00b..00000000
--- a/SabreTools.FileTypes/Archives/ZPAQArchive.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace SabreTools.FileTypes.Archives
-{
- ///
- /// Represents a ZPAQArchive archive for reading and writing
- ///
- /// TODO: Implement from source at https://github.com/zpaq/zpaq - In progress as external DLL
- public class ZPAQArchive : BaseArchive
- {
- #region Constructors
-
- ///
- /// Create a new ZPAQArchive with no base file
- ///
- public ZPAQArchive()
- : base()
- {
- this.Type = FileType.ZPAQArchive;
- }
-
- ///
- /// Create a new ZPAQArchive from the given file
- ///
- /// Name of the file to use as an archive
- /// True if hashes for this file should be calculated, false otherwise (default)
- public ZPAQArchive(string filename, bool getHashes = false)
- : base(filename, getHashes)
- {
- this.Type = FileType.ZPAQArchive;
- }
-
- #endregion
-
- #region Extraction
-
- ///
- public override bool CopyAll(string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override string CopyToFile(string entryName, string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override (Stream?, string?) GetEntryStream(string entryName)
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Information
-
- ///
- public override List GetChildren()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override List GetEmptyFolders()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool IsTorrent()
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Writing
-
- ///
- public override bool Write(string inputFile, string outDir, BaseFile? baseFile)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(Stream? inputStream, string outDir, BaseFile? baseFile)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(List inputFiles, string outDir, List? baseFiles)
- {
- throw new NotImplementedException();
- }
-
- #endregion
- }
-}
diff --git a/SabreTools.FileTypes/Archives/ZipArchive.cs b/SabreTools.FileTypes/Archives/ZipArchive.cs
index 6b8a004d..4c0132ff 100644
--- a/SabreTools.FileTypes/Archives/ZipArchive.cs
+++ b/SabreTools.FileTypes/Archives/ZipArchive.cs
@@ -51,7 +51,6 @@ namespace SabreTools.FileTypes.Archives
public ZipArchive()
: base()
{
- this.Type = FileType.ZipArchive;
}
///
@@ -63,7 +62,6 @@ namespace SabreTools.FileTypes.Archives
public ZipArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
- this.Type = FileType.ZipArchive;
}
#endregion
diff --git a/SabreTools.FileTypes/Archives/ZstdArchive.cs b/SabreTools.FileTypes/Archives/ZstdArchive.cs
deleted file mode 100644
index 052e8ce9..00000000
--- a/SabreTools.FileTypes/Archives/ZstdArchive.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace SabreTools.FileTypes.Archives
-{
- ///
- /// Represents a ZstdArchive archive for reading and writing
- ///
- /// TODO: Implement from source at https://github.com/skbkontur/ZstdNet
- public class ZstdArchive : BaseArchive
- {
- #region Constructors
-
- ///
- /// Create a new ZstdArchive with no base file
- ///
- public ZstdArchive()
- : base()
- {
- this.Type = FileType.ZstdArchive;
- }
-
- ///
- /// Create a new ZstdArchive from the given file
- ///
- /// Name of the file to use as an archive
- /// True if hashes for this file should be calculated, false otherwise (default)
- public ZstdArchive(string filename, bool getHashes)
- : base(filename, getHashes)
- {
- this.Type = FileType.ZstdArchive;
- }
-
- #endregion
-
- #region Extraction
-
- ///
- public override bool CopyAll(string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override string CopyToFile(string entryName, string outDir)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override (Stream?, string?) GetEntryStream(string entryName)
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Information
-
- ///
- public override List GetChildren()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override List GetEmptyFolders()
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool IsTorrent()
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region Writing
-
- ///
- public override bool Write(string inputFile, string outDir, BaseFile? baseFile)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(Stream? inputStream, string outDir, BaseFile? baseFile)
- {
- throw new NotImplementedException();
- }
-
- ///
- public override bool Write(List inputFiles, string outDir, List? baseFiles)
- {
- throw new NotImplementedException();
- }
-
- #endregion
- }
-}
diff --git a/SabreTools.FileTypes/BaseFile.cs b/SabreTools.FileTypes/BaseFile.cs
index fa54c268..9429b594 100644
--- a/SabreTools.FileTypes/BaseFile.cs
+++ b/SabreTools.FileTypes/BaseFile.cs
@@ -14,40 +14,29 @@ namespace SabreTools.FileTypes
{
#region Constants
- protected static readonly byte[] SevenZipSignature = { 0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c };
- protected static readonly byte[] AaruFormatSignature = { 0x41, 0x41, 0x52, 0x55, 0x46, 0x52, 0x4d, 0x54 };
- protected static readonly byte[] BZ2Signature = { 0x42, 0x5a, 0x68 };
- protected static readonly byte[] CabinetSignature = { 0x4d, 0x53, 0x43, 0x46 };
- protected static readonly byte[] CHDSignature = { 0x4d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x48, 0x44 };
- protected static readonly byte[] ELFSignature = { 0x7f, 0x45, 0x4c, 0x46 };
- protected static readonly byte[] FreeArcSignature = { 0x41, 0x72, 0x43, 0x01 };
- protected static readonly byte[] GzSignature = { 0x1f, 0x8b, 0x08 };
- protected static readonly byte[] LRZipSignature = { 0x4c, 0x52, 0x5a, 0x49 };
- protected static readonly byte[] LZ4Signature = { 0x18, 0x4d, 0x22, 0x04 };
- protected static readonly byte[] LZ4SkippableMinSignature = { 0x18, 0x4d, 0x22, 0x04 };
- protected static readonly byte[] LZ4SkippableMaxSignature = { 0x18, 0x4d, 0x2a, 0x5f };
- protected static readonly byte[] PESignature = { 0x4d, 0x5a };
- protected static readonly byte[] RarSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 };
- protected static readonly byte[] RarFiveSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 };
- protected static readonly byte[] TarSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00 };
- protected static readonly byte[] TarZeroSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30 };
- protected static readonly byte[] XZSignature = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00 };
- protected static readonly byte[] ZipSignature = { 0x50, 0x4b, 0x03, 0x04 };
- protected static readonly byte[] ZipSignatureEmpty = { 0x50, 0x4b, 0x05, 0x06 };
- protected static readonly byte[] ZipSignatureSpanned = { 0x50, 0x4b, 0x07, 0x08 };
- protected static readonly byte[] ZPAQSignature = { 0x7a, 0x50, 0x51 };
- protected static readonly byte[] ZstdSignature = { 0xfd, 0x2f, 0xb5 };
+ protected static readonly byte[] SevenZipSignature = [0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c];
+ protected static readonly byte[] AaruFormatSignature = [0x41, 0x41, 0x52, 0x55, 0x46, 0x52, 0x4d, 0x54];
+ protected static readonly byte[] BZ2Signature = [0x42, 0x5a, 0x68];
+ protected static readonly byte[] CabinetSignature = [0x4d, 0x53, 0x43, 0x46];
+ protected static readonly byte[] CHDSignature = [0x4d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x48, 0x44];
+ protected static readonly byte[] ELFSignature = [0x7f, 0x45, 0x4c, 0x46];
+ protected static readonly byte[] FreeArcSignature = [0x41, 0x72, 0x43, 0x01];
+ protected static readonly byte[] GzSignature = [0x1f, 0x8b, 0x08];
+ protected static readonly byte[] PESignature = [0x4d, 0x5a];
+ protected static readonly byte[] RarSignature = [0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00];
+ protected static readonly byte[] RarFiveSignature = [0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00];
+ protected static readonly byte[] TarSignature = [0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00];
+ protected static readonly byte[] TarZeroSignature = [0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30];
+ protected static readonly byte[] XZSignature = [0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00];
+ protected static readonly byte[] ZipSignature = [0x50, 0x4b, 0x03, 0x04];
+ protected static readonly byte[] ZipSignatureEmpty = [0x50, 0x4b, 0x05, 0x06];
+ protected static readonly byte[] ZipSignatureSpanned = [0x50, 0x4b, 0x07, 0x08];
#endregion
// TODO: Get all of these values automatically so there is no public "set"
#region Fields
- ///
- /// Internal type of the represented file
- ///
- public FileType Type { get; protected set; }
-
///
/// Filename or path to the file
///
@@ -220,16 +209,6 @@ namespace SabreTools.FileTypes
{
outFileType = FileType.GZipArchive;
}
- else if (magic.StartsWith(LRZipSignature))
- {
- outFileType = FileType.LRZipArchive;
- }
- else if (magic.StartsWith(LZ4Signature)
- || magic.StartsWith(LZ4SkippableMinSignature)
- || magic.StartsWith(LZ4SkippableMaxSignature))
- {
- outFileType = FileType.LZ4Archive;
- }
else if (magic.StartsWith(RarSignature)
|| magic.StartsWith(RarFiveSignature))
{
@@ -250,14 +229,6 @@ namespace SabreTools.FileTypes
{
outFileType = FileType.ZipArchive;
}
- else if (magic.StartsWith(ZPAQSignature))
- {
- outFileType = FileType.ZPAQArchive;
- }
- else if (magic.StartsWith(ZstdSignature))
- {
- outFileType = FileType.ZstdArchive;
- }
return outFileType;
}
diff --git a/SabreTools.FileTypes/CHD/CHDFile.cs b/SabreTools.FileTypes/CHD/CHDFile.cs
index 19b515a9..1ef76cfb 100644
--- a/SabreTools.FileTypes/CHD/CHDFile.cs
+++ b/SabreTools.FileTypes/CHD/CHDFile.cs
@@ -57,7 +57,7 @@ namespace SabreTools.FileTypes.CHD
if (validatedVersion == 0)
return null;
- // Read and retrun the current CHD
+ // Read and return the current CHD
CHDFile? generated = ReadAsVersion(chdstream, version);
if (generated != null)
generated.Type = FileType.CHD;
diff --git a/SabreTools.FileTypes/Enums.cs b/SabreTools.FileTypes/Enums.cs
index bc3d404d..0fe17cf6 100644
--- a/SabreTools.FileTypes/Enums.cs
+++ b/SabreTools.FileTypes/Enums.cs
@@ -1274,14 +1274,10 @@ namespace SabreTools.FileTypes
Folder,
SevenZipArchive,
GZipArchive,
- LRZipArchive,
- LZ4Archive,
RarArchive,
TapeArchive,
XZArchive,
ZipArchive,
- ZPAQArchive,
- ZstdArchive,
}
///
@@ -1302,10 +1298,6 @@ namespace SabreTools.FileTypes
// Currently unimplemented fully
Torrent7Zip,
TorrentRar,
- TorrentLRZip,
- TorrentLZ4,
- TorrentZstd,
- TorrentZPAQ,
}
///
diff --git a/SabreTools.FileTypes/Folder.cs b/SabreTools.FileTypes/Folder.cs
index b39c92b9..77bb8f3f 100644
--- a/SabreTools.FileTypes/Folder.cs
+++ b/SabreTools.FileTypes/Folder.cs
@@ -45,7 +45,6 @@ namespace SabreTools.FileTypes
public Folder(bool writeToParent = false)
: base()
{
- this.Type = FileType.Folder;
this.writeToParent = writeToParent;
logger = new Logger(this);
}
@@ -59,7 +58,6 @@ namespace SabreTools.FileTypes
public Folder(string filename, bool getHashes = false)
: base(filename, getHashes)
{
- this.Type = FileType.Folder;
logger = new Logger(this);
}
@@ -78,14 +76,10 @@ namespace SabreTools.FileTypes
OutputFormat.Torrent7Zip => new SevenZipArchive(),
OutputFormat.TorrentGzip => new GZipArchive(),
OutputFormat.TorrentGzipRomba => new GZipArchive(),
- OutputFormat.TorrentLRZip => new LRZipArchive(),
- OutputFormat.TorrentLZ4 => new LZ4Archive(),
OutputFormat.TorrentRar => new RarArchive(),
OutputFormat.TorrentXZ => new XZArchive(),
OutputFormat.TorrentXZRomba => new XZArchive(),
OutputFormat.TorrentZip => new ZipArchive(),
- OutputFormat.TorrentZPAQ => new ZPAQArchive(),
- OutputFormat.TorrentZstd => new ZstdArchive(),
_ => null,
};
}
diff --git a/SabreTools/Features/BaseFeature.cs b/SabreTools/Features/BaseFeature.cs
index 176b38e0..400ebea0 100644
--- a/SabreTools/Features/BaseFeature.cs
+++ b/SabreTools/Features/BaseFeature.cs
@@ -1953,20 +1953,12 @@ Some special strings that can be used:
return OutputFormat.Torrent7Zip;
else if (GetBoolean(features, TorrentGzipValue))
return OutputFormat.TorrentGzip;
- //else if (GetBoolean(features, SharedTorrentLrzipValue))
- // return OutputFormat.TorrentLRZip;
- //else if (GetBoolean(features, SharedTorrentLz4Value))
- // return OutputFormat.TorrentLZ4;
//else if (GetBoolean(features, SharedTorrentRarValue))
// return OutputFormat.TorrentRar;
//else if (GetBoolean(features, SharedTorrentXzValue))
// return OutputFormat.TorrentXZ;
else if (GetBoolean(features, TorrentZipValue))
return OutputFormat.TorrentZip;
- //else if (GetBoolean(features, SharedTorrentZpaqValue))
- // return OutputFormat.TorrentZPAQ;
- //else if (GetBoolean(features, SharedTorrentZstdValue))
- // return OutputFormat.TorrentZstd;
else
return OutputFormat.Folder;
}
diff --git a/SabreTools/Features/Sort.cs b/SabreTools/Features/Sort.cs
index a9026398..a3fed52a 100644
--- a/SabreTools/Features/Sort.cs
+++ b/SabreTools/Features/Sort.cs
@@ -42,14 +42,10 @@ namespace SabreTools.Features
AddFeature(TorrentGzipFlag);
this[TorrentGzipFlag]!.AddFeature(RombaFlag);
this[TorrentGzipFlag]![RombaFlag]!.AddFeature(RombaDepthInt32Input);
- //AddFeature(SharedInputs.TorrentLrzipFlag);
- //AddFeature(SharedInputs.TorrentLz4Flag);
//AddFeature(SharedInputs.TorrentRarFlag);
//AddFeature(SharedInputs.TorrentXzFlag);
//this[SharedInputs.TorrentXzFlag]!.AddFeature(SharedInputs.RombaFlag);
AddFeature(TorrentZipFlag);
- //AddFeature(SharedInputs.TorrentZpaqFlag);
- //AddFeature(SharedInputs.TorrentZstdFlag);
AddFeature(HeaderStringInput);
AddInternalSplitFeatures();