Some cleanup around FileTypes

This commit is contained in:
Matt Nadareski
2024-07-19 15:35:23 -04:00
parent 73582779d2
commit 092e9c6876
20 changed files with 42 additions and 530 deletions

View File

@@ -210,12 +210,6 @@ Below are originally from SabreTools / DATabase -
includes two auxilary files, .romba_size and .romba_size.backup, that have the includes two auxilary files, .romba_size and .romba_size.backup, that have the
compressed size of the folder inside for use with Romba. 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] -trar Enable Torrent RAR output [NOT IMPLEMENTED]
Instead of outputting files to folder, files will be rebuilt to Torrent RAR (TRAR) 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 files. This format is based on the RAR propietary format but with custom header

View File

@@ -130,22 +130,25 @@ namespace SabreTools.DatItems
/// <returns>DatItem of the specific internal type that corresponds to the inputs</returns> /// <returns>DatItem of the specific internal type that corresponds to the inputs</returns>
public static DatItem? Create(BaseFile? baseFile) public static DatItem? Create(BaseFile? baseFile)
{ {
return baseFile?.Type switch return baseFile switch
{ {
FileType.AaruFormat => new Media(baseFile), // Disk
FileType.CHD => new Disk(baseFile), FileTypes.CHD.CHDFile => new Disk(baseFile),
FileType.GZipArchive => new Rom(baseFile),
FileType.LRZipArchive => new Rom(baseFile), // Media
FileType.LZ4Archive => new Rom(baseFile), FileTypes.Aaru.AaruFormat => new Media(baseFile),
FileType.None => new Rom(baseFile),
FileType.RarArchive => new Rom(baseFile), // Rom
FileType.SevenZipArchive => new Rom(baseFile), FileTypes.Archives.GZipArchive => new Rom(baseFile),
FileType.TapeArchive => new Rom(baseFile), FileTypes.Archives.RarArchive => new Rom(baseFile),
FileType.XZArchive => new Rom(baseFile), FileTypes.Archives.SevenZipArchive => new Rom(baseFile),
FileType.ZipArchive => new Rom(baseFile), FileTypes.Archives.TapeArchive => new Rom(baseFile),
FileType.ZPAQArchive => new Rom(baseFile), FileTypes.Archives.XZArchive => new Rom(baseFile),
FileType.ZstdArchive => new Rom(baseFile), FileTypes.Archives.ZipArchive => new Rom(baseFile),
_ => null,
// Miscellaneous
null => null,
_ => new Rom(baseFile),
}; };
} }

View File

@@ -332,15 +332,15 @@ namespace SabreTools.DatTools
if (internalFileInfo == null) if (internalFileInfo == null)
internalDatItem = null; internalDatItem = null;
#if NETFRAMEWORK #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
else if (internalFileInfo.Type == FileType.AaruFormat && !asFiles.HasFlag(TreatAsFile.AaruFormat)) else if (internalFileInfo is FileTypes.Aaru.AaruFormat && !asFiles.HasFlag(TreatAsFile.AaruFormat))
#endif #endif
internalDatItem = new Media(internalFileInfo); internalDatItem = new Media(internalFileInfo);
#if NETFRAMEWORK #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
else if (internalFileInfo.Type == FileType.CHD && !asFiles.HasFlag(TreatAsFile.CHD)) else if (internalFileInfo is FileTypes.CHD.CHDFile && !asFiles.HasFlag(TreatAsFile.CHD))
#endif #endif
internalDatItem = new Disk(internalFileInfo); internalDatItem = new Disk(internalFileInfo);
else else
@@ -851,7 +851,6 @@ namespace SabreTools.DatTools
OutputFormat.Torrent7Zip => "Torrent7Z", OutputFormat.Torrent7Zip => "Torrent7Z",
OutputFormat.TorrentGzip => "TorrentGZ", OutputFormat.TorrentGzip => "TorrentGZ",
OutputFormat.TorrentGzipRomba => "TorrentGZ", OutputFormat.TorrentGzipRomba => "TorrentGZ",
OutputFormat.TorrentLRZip => "TorrentLRZ",
OutputFormat.TorrentRar => "TorrentRAR", OutputFormat.TorrentRar => "TorrentRAR",
OutputFormat.TorrentXZ => "TorrentXZ", OutputFormat.TorrentXZ => "TorrentXZ",
OutputFormat.TorrentXZRomba => "TorrentXZ", OutputFormat.TorrentXZRomba => "TorrentXZ",

View File

@@ -44,7 +44,6 @@ namespace SabreTools.FileTypes.Aaru
/// </summary> /// </summary>
public AaruFormat() public AaruFormat()
{ {
Type = FileType.AaruFormat;
} }
/// <summary> /// <summary>
@@ -71,12 +70,8 @@ namespace SabreTools.FileTypes.Aaru
if (!validated) if (!validated)
return null; return null;
// Read and retrun the current AaruFormat // Read and return the current AaruFormat
AaruFormat? generated = Deserialize(aarustream); return Deserialize(aarustream);
if (generated != null)
generated.Type = FileType.AaruFormat;
return generated;
} }
catch catch
{ {

View File

@@ -55,7 +55,6 @@ namespace SabreTools.FileTypes.Archives
public GZipArchive() public GZipArchive()
: base() : base()
{ {
this.Type = FileType.GZipArchive;
} }
/// <summary> /// <summary>
@@ -67,7 +66,6 @@ namespace SabreTools.FileTypes.Archives
public GZipArchive(string filename, bool getHashes = false) public GZipArchive(string filename, bool getHashes = false)
: base(filename, getHashes) : base(filename, getHashes)
{ {
this.Type = FileType.GZipArchive;
} }
#endregion #endregion

View File

@@ -1,103 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace SabreTools.FileTypes.Archives
{
/// <summary>
/// Represents a TorrentLRZip archive for reading and writing
/// </summary>
/// TODO: Implement from source at https://github.com/ckolivas/lrzip
public class LRZipArchive : BaseArchive
{
#region Constructors
/// <summary>
/// Create a new LRZipArchive with no base file
/// </summary>
public LRZipArchive()
: base()
{
this.Type = FileType.LRZipArchive;
}
/// <summary>
/// Create a new LRZipArchive from the given file
/// </summary>
/// <param name="filename">Name of the file to use as an archive</param>
/// <param name="getHashes">True if hashes for this file should be calculated, false otherwise (default)</param>
public LRZipArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
this.Type = FileType.LRZipArchive;
}
#endregion
#region Extraction
/// <inheritdoc/>
public override bool CopyAll(string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override string CopyToFile(string entryName, string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override (Stream?, string?) GetEntryStream(string entryName)
{
throw new NotImplementedException();
}
#endregion
#region Information
/// <inheritdoc/>
public override List<BaseFile> GetChildren()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override List<string> GetEmptyFolders()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool IsTorrent()
{
throw new NotImplementedException();
}
#endregion
#region Writing
/// <inheritdoc/>
public override bool Write(string inputFile, string outDir, BaseFile? baseFile)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(Stream? inputStream, string outDir, BaseFile? baseFile)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(List<string> inputFiles, string outDir, List<BaseFile>? baseFiles)
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@@ -1,103 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace SabreTools.FileTypes.Archives
{
/// <summary>
/// Represents a TorrentLRZip archive for reading and writing
/// </summary>
/// TODO: Implement from source at https://github.com/lz4/lz4
public class LZ4Archive : BaseArchive
{
#region Constructors
/// <summary>
/// Create a new LZ4Archive with no base file
/// </summary>
public LZ4Archive()
: base()
{
this.Type = FileType.LZ4Archive;
}
/// <summary>
/// Create a new LZ4Archive from the given file
/// </summary>
/// <param name="filename">Name of the file to use as an archive</param>
/// <param name="getHashes">True if hashes for this file should be calculated, false otherwise (default)</param>
public LZ4Archive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
this.Type = FileType.LZ4Archive;
}
#endregion
#region Extraction
/// <inheritdoc/>
public override bool CopyAll(string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override string CopyToFile(string entryName, string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override (Stream?, string?) GetEntryStream(string entryName)
{
throw new NotImplementedException();
}
#endregion
#region Information
/// <inheritdoc/>
public override List<BaseFile> GetChildren()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override List<string> GetEmptyFolders()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool IsTorrent()
{
throw new NotImplementedException();
}
#endregion
#region Writing
/// <inheritdoc/>
public override bool Write(string inputFile, string outDir, BaseFile? rom)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(Stream? inputStream, string outDir, BaseFile? rom)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(List<string> inputFiles, string outDir, List<BaseFile>? baseFiles)
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@@ -25,7 +25,6 @@ namespace SabreTools.FileTypes.Archives
public RarArchive() public RarArchive()
: base() : base()
{ {
this.Type = FileType.RarArchive;
} }
/// <summary> /// <summary>
@@ -37,7 +36,6 @@ namespace SabreTools.FileTypes.Archives
public RarArchive(string filename, bool getHashes = false) public RarArchive(string filename, bool getHashes = false)
: base(filename, getHashes) : base(filename, getHashes)
{ {
this.Type = FileType.RarArchive;
} }
#endregion #endregion

View File

@@ -71,7 +71,6 @@ namespace SabreTools.FileTypes.Archives
public SevenZipArchive() public SevenZipArchive()
: base() : base()
{ {
this.Type = FileType.SevenZipArchive;
} }
/// <summary> /// <summary>
@@ -83,7 +82,6 @@ namespace SabreTools.FileTypes.Archives
public SevenZipArchive(string filename, bool getHashes = false) public SevenZipArchive(string filename, bool getHashes = false)
: base(filename, getHashes) : base(filename, getHashes)
{ {
this.Type = FileType.SevenZipArchive;
} }
#endregion #endregion

View File

@@ -30,7 +30,6 @@ namespace SabreTools.FileTypes.Archives
public TapeArchive() public TapeArchive()
: base() : base()
{ {
this.Type = FileType.TapeArchive;
} }
/// <summary> /// <summary>
@@ -42,7 +41,6 @@ namespace SabreTools.FileTypes.Archives
public TapeArchive(string filename, bool getHashes = false) public TapeArchive(string filename, bool getHashes = false)
: base(filename, getHashes) : base(filename, getHashes)
{ {
this.Type = FileType.TapeArchive;
} }
#endregion #endregion

View File

@@ -46,7 +46,6 @@ namespace SabreTools.FileTypes.Archives
public XZArchive() public XZArchive()
: base() : base()
{ {
this.Type = FileType.XZArchive;
} }
/// <summary> /// <summary>
@@ -58,7 +57,6 @@ namespace SabreTools.FileTypes.Archives
public XZArchive(string filename, bool getHashes = false) public XZArchive(string filename, bool getHashes = false)
: base(filename, getHashes) : base(filename, getHashes)
{ {
this.Type = FileType.XZArchive;
} }
#endregion #endregion

View File

@@ -1,103 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace SabreTools.FileTypes.Archives
{
/// <summary>
/// Represents a ZPAQArchive archive for reading and writing
/// </summary>
/// TODO: Implement from source at https://github.com/zpaq/zpaq - In progress as external DLL
public class ZPAQArchive : BaseArchive
{
#region Constructors
/// <summary>
/// Create a new ZPAQArchive with no base file
/// </summary>
public ZPAQArchive()
: base()
{
this.Type = FileType.ZPAQArchive;
}
/// <summary>
/// Create a new ZPAQArchive from the given file
/// </summary>
/// <param name="filename">Name of the file to use as an archive</param>
/// <param name="getHashes">True if hashes for this file should be calculated, false otherwise (default)</param>
public ZPAQArchive(string filename, bool getHashes = false)
: base(filename, getHashes)
{
this.Type = FileType.ZPAQArchive;
}
#endregion
#region Extraction
/// <inheritdoc/>
public override bool CopyAll(string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override string CopyToFile(string entryName, string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override (Stream?, string?) GetEntryStream(string entryName)
{
throw new NotImplementedException();
}
#endregion
#region Information
/// <inheritdoc/>
public override List<BaseFile> GetChildren()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override List<string> GetEmptyFolders()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool IsTorrent()
{
throw new NotImplementedException();
}
#endregion
#region Writing
/// <inheritdoc/>
public override bool Write(string inputFile, string outDir, BaseFile? baseFile)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(Stream? inputStream, string outDir, BaseFile? baseFile)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(List<string> inputFiles, string outDir, List<BaseFile>? baseFiles)
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@@ -51,7 +51,6 @@ namespace SabreTools.FileTypes.Archives
public ZipArchive() public ZipArchive()
: base() : base()
{ {
this.Type = FileType.ZipArchive;
} }
/// <summary> /// <summary>
@@ -63,7 +62,6 @@ namespace SabreTools.FileTypes.Archives
public ZipArchive(string filename, bool getHashes = false) public ZipArchive(string filename, bool getHashes = false)
: base(filename, getHashes) : base(filename, getHashes)
{ {
this.Type = FileType.ZipArchive;
} }
#endregion #endregion

View File

@@ -1,103 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace SabreTools.FileTypes.Archives
{
/// <summary>
/// Represents a ZstdArchive archive for reading and writing
/// </summary>
/// TODO: Implement from source at https://github.com/skbkontur/ZstdNet
public class ZstdArchive : BaseArchive
{
#region Constructors
/// <summary>
/// Create a new ZstdArchive with no base file
/// </summary>
public ZstdArchive()
: base()
{
this.Type = FileType.ZstdArchive;
}
/// <summary>
/// Create a new ZstdArchive from the given file
/// </summary>
/// <param name="filename">Name of the file to use as an archive</param>
/// <param name="getHashes">True if hashes for this file should be calculated, false otherwise (default)</param>
public ZstdArchive(string filename, bool getHashes)
: base(filename, getHashes)
{
this.Type = FileType.ZstdArchive;
}
#endregion
#region Extraction
/// <inheritdoc/>
public override bool CopyAll(string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override string CopyToFile(string entryName, string outDir)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override (Stream?, string?) GetEntryStream(string entryName)
{
throw new NotImplementedException();
}
#endregion
#region Information
/// <inheritdoc/>
public override List<BaseFile> GetChildren()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override List<string> GetEmptyFolders()
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool IsTorrent()
{
throw new NotImplementedException();
}
#endregion
#region Writing
/// <inheritdoc/>
public override bool Write(string inputFile, string outDir, BaseFile? baseFile)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(Stream? inputStream, string outDir, BaseFile? baseFile)
{
throw new NotImplementedException();
}
/// <inheritdoc/>
public override bool Write(List<string> inputFiles, string outDir, List<BaseFile>? baseFiles)
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@@ -14,40 +14,29 @@ namespace SabreTools.FileTypes
{ {
#region Constants #region Constants
protected static readonly byte[] SevenZipSignature = { 0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c }; 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[] AaruFormatSignature = [0x41, 0x41, 0x52, 0x55, 0x46, 0x52, 0x4d, 0x54];
protected static readonly byte[] BZ2Signature = { 0x42, 0x5a, 0x68 }; protected static readonly byte[] BZ2Signature = [0x42, 0x5a, 0x68];
protected static readonly byte[] CabinetSignature = { 0x4d, 0x53, 0x43, 0x46 }; 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[] CHDSignature = [0x4d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x48, 0x44];
protected static readonly byte[] ELFSignature = { 0x7f, 0x45, 0x4c, 0x46 }; protected static readonly byte[] ELFSignature = [0x7f, 0x45, 0x4c, 0x46];
protected static readonly byte[] FreeArcSignature = { 0x41, 0x72, 0x43, 0x01 }; protected static readonly byte[] FreeArcSignature = [0x41, 0x72, 0x43, 0x01];
protected static readonly byte[] GzSignature = { 0x1f, 0x8b, 0x08 }; protected static readonly byte[] GzSignature = [0x1f, 0x8b, 0x08];
protected static readonly byte[] LRZipSignature = { 0x4c, 0x52, 0x5a, 0x49 }; protected static readonly byte[] PESignature = [0x4d, 0x5a];
protected static readonly byte[] LZ4Signature = { 0x18, 0x4d, 0x22, 0x04 }; protected static readonly byte[] RarSignature = [0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00];
protected static readonly byte[] LZ4SkippableMinSignature = { 0x18, 0x4d, 0x22, 0x04 }; protected static readonly byte[] RarFiveSignature = [0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00];
protected static readonly byte[] LZ4SkippableMaxSignature = { 0x18, 0x4d, 0x2a, 0x5f }; protected static readonly byte[] TarSignature = [0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00];
protected static readonly byte[] PESignature = { 0x4d, 0x5a }; protected static readonly byte[] TarZeroSignature = [0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30];
protected static readonly byte[] RarSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 }; protected static readonly byte[] XZSignature = [0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00];
protected static readonly byte[] RarFiveSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 }; protected static readonly byte[] ZipSignature = [0x50, 0x4b, 0x03, 0x04];
protected static readonly byte[] TarSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00 }; protected static readonly byte[] ZipSignatureEmpty = [0x50, 0x4b, 0x05, 0x06];
protected static readonly byte[] TarZeroSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30 }; protected static readonly byte[] ZipSignatureSpanned = [0x50, 0x4b, 0x07, 0x08];
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 };
#endregion #endregion
// TODO: Get all of these values automatically so there is no public "set" // TODO: Get all of these values automatically so there is no public "set"
#region Fields #region Fields
/// <summary>
/// Internal type of the represented file
/// </summary>
public FileType Type { get; protected set; }
/// <summary> /// <summary>
/// Filename or path to the file /// Filename or path to the file
/// </summary> /// </summary>
@@ -220,16 +209,6 @@ namespace SabreTools.FileTypes
{ {
outFileType = FileType.GZipArchive; 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) else if (magic.StartsWith(RarSignature)
|| magic.StartsWith(RarFiveSignature)) || magic.StartsWith(RarFiveSignature))
{ {
@@ -250,14 +229,6 @@ namespace SabreTools.FileTypes
{ {
outFileType = FileType.ZipArchive; outFileType = FileType.ZipArchive;
} }
else if (magic.StartsWith(ZPAQSignature))
{
outFileType = FileType.ZPAQArchive;
}
else if (magic.StartsWith(ZstdSignature))
{
outFileType = FileType.ZstdArchive;
}
return outFileType; return outFileType;
} }

View File

@@ -57,7 +57,7 @@ namespace SabreTools.FileTypes.CHD
if (validatedVersion == 0) if (validatedVersion == 0)
return null; return null;
// Read and retrun the current CHD // Read and return the current CHD
CHDFile? generated = ReadAsVersion(chdstream, version); CHDFile? generated = ReadAsVersion(chdstream, version);
if (generated != null) if (generated != null)
generated.Type = FileType.CHD; generated.Type = FileType.CHD;

View File

@@ -1274,14 +1274,10 @@ namespace SabreTools.FileTypes
Folder, Folder,
SevenZipArchive, SevenZipArchive,
GZipArchive, GZipArchive,
LRZipArchive,
LZ4Archive,
RarArchive, RarArchive,
TapeArchive, TapeArchive,
XZArchive, XZArchive,
ZipArchive, ZipArchive,
ZPAQArchive,
ZstdArchive,
} }
/// <summary> /// <summary>
@@ -1302,10 +1298,6 @@ namespace SabreTools.FileTypes
// Currently unimplemented fully // Currently unimplemented fully
Torrent7Zip, Torrent7Zip,
TorrentRar, TorrentRar,
TorrentLRZip,
TorrentLZ4,
TorrentZstd,
TorrentZPAQ,
} }
/// <summary> /// <summary>

View File

@@ -45,7 +45,6 @@ namespace SabreTools.FileTypes
public Folder(bool writeToParent = false) public Folder(bool writeToParent = false)
: base() : base()
{ {
this.Type = FileType.Folder;
this.writeToParent = writeToParent; this.writeToParent = writeToParent;
logger = new Logger(this); logger = new Logger(this);
} }
@@ -59,7 +58,6 @@ namespace SabreTools.FileTypes
public Folder(string filename, bool getHashes = false) public Folder(string filename, bool getHashes = false)
: base(filename, getHashes) : base(filename, getHashes)
{ {
this.Type = FileType.Folder;
logger = new Logger(this); logger = new Logger(this);
} }
@@ -78,14 +76,10 @@ namespace SabreTools.FileTypes
OutputFormat.Torrent7Zip => new SevenZipArchive(), OutputFormat.Torrent7Zip => new SevenZipArchive(),
OutputFormat.TorrentGzip => new GZipArchive(), OutputFormat.TorrentGzip => new GZipArchive(),
OutputFormat.TorrentGzipRomba => new GZipArchive(), OutputFormat.TorrentGzipRomba => new GZipArchive(),
OutputFormat.TorrentLRZip => new LRZipArchive(),
OutputFormat.TorrentLZ4 => new LZ4Archive(),
OutputFormat.TorrentRar => new RarArchive(), OutputFormat.TorrentRar => new RarArchive(),
OutputFormat.TorrentXZ => new XZArchive(), OutputFormat.TorrentXZ => new XZArchive(),
OutputFormat.TorrentXZRomba => new XZArchive(), OutputFormat.TorrentXZRomba => new XZArchive(),
OutputFormat.TorrentZip => new ZipArchive(), OutputFormat.TorrentZip => new ZipArchive(),
OutputFormat.TorrentZPAQ => new ZPAQArchive(),
OutputFormat.TorrentZstd => new ZstdArchive(),
_ => null, _ => null,
}; };
} }

View File

@@ -1953,20 +1953,12 @@ Some special strings that can be used:
return OutputFormat.Torrent7Zip; return OutputFormat.Torrent7Zip;
else if (GetBoolean(features, TorrentGzipValue)) else if (GetBoolean(features, TorrentGzipValue))
return OutputFormat.TorrentGzip; return OutputFormat.TorrentGzip;
//else if (GetBoolean(features, SharedTorrentLrzipValue))
// return OutputFormat.TorrentLRZip;
//else if (GetBoolean(features, SharedTorrentLz4Value))
// return OutputFormat.TorrentLZ4;
//else if (GetBoolean(features, SharedTorrentRarValue)) //else if (GetBoolean(features, SharedTorrentRarValue))
// return OutputFormat.TorrentRar; // return OutputFormat.TorrentRar;
//else if (GetBoolean(features, SharedTorrentXzValue)) //else if (GetBoolean(features, SharedTorrentXzValue))
// return OutputFormat.TorrentXZ; // return OutputFormat.TorrentXZ;
else if (GetBoolean(features, TorrentZipValue)) else if (GetBoolean(features, TorrentZipValue))
return OutputFormat.TorrentZip; return OutputFormat.TorrentZip;
//else if (GetBoolean(features, SharedTorrentZpaqValue))
// return OutputFormat.TorrentZPAQ;
//else if (GetBoolean(features, SharedTorrentZstdValue))
// return OutputFormat.TorrentZstd;
else else
return OutputFormat.Folder; return OutputFormat.Folder;
} }

View File

@@ -42,14 +42,10 @@ namespace SabreTools.Features
AddFeature(TorrentGzipFlag); AddFeature(TorrentGzipFlag);
this[TorrentGzipFlag]!.AddFeature(RombaFlag); this[TorrentGzipFlag]!.AddFeature(RombaFlag);
this[TorrentGzipFlag]![RombaFlag]!.AddFeature(RombaDepthInt32Input); this[TorrentGzipFlag]![RombaFlag]!.AddFeature(RombaDepthInt32Input);
//AddFeature(SharedInputs.TorrentLrzipFlag);
//AddFeature(SharedInputs.TorrentLz4Flag);
//AddFeature(SharedInputs.TorrentRarFlag); //AddFeature(SharedInputs.TorrentRarFlag);
//AddFeature(SharedInputs.TorrentXzFlag); //AddFeature(SharedInputs.TorrentXzFlag);
//this[SharedInputs.TorrentXzFlag]!.AddFeature(SharedInputs.RombaFlag); //this[SharedInputs.TorrentXzFlag]!.AddFeature(SharedInputs.RombaFlag);
AddFeature(TorrentZipFlag); AddFeature(TorrentZipFlag);
//AddFeature(SharedInputs.TorrentZpaqFlag);
//AddFeature(SharedInputs.TorrentZstdFlag);
AddFeature(HeaderStringInput); AddFeature(HeaderStringInput);
AddInternalSplitFeatures(); AddInternalSplitFeatures();