mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
File type tango
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,13 +20,13 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ using System.Text;
|
||||
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
namespace SabreTools.Library.FileTypes.CHD
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD V1 File
|
||||
/// </summary>
|
||||
public class CHDFileV1 : CHDFile
|
||||
internal class CHDFileV1 : CHDFile
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD flags
|
||||
@@ -4,12 +4,12 @@ using System.Text;
|
||||
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
namespace SabreTools.Library.FileTypes.CHD
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD V2 File
|
||||
/// </summary>
|
||||
public class CHDFileV2 : CHDFile
|
||||
internal class CHDFileV2 : CHDFile
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD flags
|
||||
@@ -4,12 +4,12 @@ using System.Text;
|
||||
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
namespace SabreTools.Library.FileTypes.CHD
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD V3 File
|
||||
/// </summary>
|
||||
public class CHDFileV3 : CHDFile
|
||||
internal class CHDFileV3 : CHDFile
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD flags
|
||||
@@ -4,12 +4,12 @@ using System.Text;
|
||||
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
namespace SabreTools.Library.FileTypes.CHD
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD V4 File
|
||||
/// </summary>
|
||||
public class CHDFileV4 : CHDFile
|
||||
internal class CHDFileV4 : CHDFile
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD flags
|
||||
@@ -3,12 +3,12 @@ using System.Text;
|
||||
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
namespace SabreTools.Library.FileTypes.CHD
|
||||
{
|
||||
/// <summary>
|
||||
/// CHD V5 File
|
||||
/// </summary>
|
||||
public class CHDFileV5 : CHDFile
|
||||
internal class CHDFileV5 : CHDFile
|
||||
{
|
||||
/// <summary>
|
||||
/// Uncompressed map format
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -977,62 +977,6 @@ namespace SabreTools
|
||||
}
|
||||
}
|
||||
|
||||
public const string TorrentLrzipValue = "torrent-lrzip";
|
||||
private static Feature TorrentLrzipFlag
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Feature(
|
||||
TorrentLrzipValue,
|
||||
new List<string>() { "-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<string>() { "-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<string>() { "-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<string>() { "-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<string>() { "-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<string>() { "-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);
|
||||
|
||||
Reference in New Issue
Block a user