mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[FileTypes/] Simplify names
This commit is contained in:
@@ -27,14 +27,14 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Represents a TorrentGZip archive for reading and writing
|
||||
/// </summary>
|
||||
public class TorrentGZipArchive : BaseArchive
|
||||
public class GZipArchive : BaseArchive
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create a new TorrentGZipArchive with no base file
|
||||
/// </summary>
|
||||
public TorrentGZipArchive()
|
||||
public GZipArchive()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace SabreTools.Library.FileTypes
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of the file to use as an archive</param>
|
||||
/// <param name="read">True for opening file as read, false for opening file as write</param>
|
||||
public TorrentGZipArchive(string filename)
|
||||
public GZipArchive(string filename)
|
||||
: base(filename)
|
||||
{
|
||||
_archiveType = ArchiveType.GZip;
|
||||
@@ -17,14 +17,14 @@ namespace SabreTools.Library.FileTypes
|
||||
/// Represents a TorrentLRZip archive for reading and writing
|
||||
/// </summary>
|
||||
/// TODO: LRZIP: https://github.com/ckolivas/lrzip
|
||||
public class TorrentLRZArchive : BaseArchive
|
||||
public class LRZArchive : BaseArchive
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create a new TorrentGZipArchive with no base file
|
||||
/// </summary>
|
||||
public TorrentLRZArchive()
|
||||
public LRZArchive()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace SabreTools.Library.FileTypes
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of the file to use as an archive</param>
|
||||
/// <param name="read">True for opening file as read, false for opening file as write</param>
|
||||
public TorrentLRZArchive(string filename)
|
||||
public LRZArchive(string filename)
|
||||
: base(filename)
|
||||
{
|
||||
//_archiveType = ArchiveType.LRZip;
|
||||
@@ -27,14 +27,14 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Represents a TorrentRAR archive for reading and writing
|
||||
/// </summary>
|
||||
public class TorrentRARArchive : BaseArchive
|
||||
public class RarArchive : BaseArchive
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create a new TorrentRARArchive with no base file
|
||||
/// </summary>
|
||||
public TorrentRARArchive()
|
||||
public RarArchive()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace SabreTools.Library.FileTypes
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of the file to use as an archive</param>
|
||||
/// <param name="read">True for opening file as read, false for opening file as write</param>
|
||||
public TorrentRARArchive(string filename)
|
||||
public RarArchive(string filename)
|
||||
: base(filename)
|
||||
{
|
||||
_archiveType = ArchiveType.Rar;
|
||||
@@ -69,7 +69,7 @@ namespace SabreTools.Library.FileTypes
|
||||
Directory.CreateDirectory(outDir);
|
||||
|
||||
// Extract all files to the temp directory
|
||||
RarArchive ra = RarArchive.Open(_filename);
|
||||
SharpCompress.Archives.Rar.RarArchive ra = SharpCompress.Archives.Rar.RarArchive.Open(_filename);
|
||||
foreach (RarArchiveEntry entry in ra.Entries)
|
||||
{
|
||||
entry.WriteToDirectory(outDir, new ExtractionOptions { PreserveFileTime = true, ExtractFullPath = true, Overwrite = true });
|
||||
@@ -153,7 +153,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
try
|
||||
{
|
||||
RarArchive ra = RarArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false, });
|
||||
SharpCompress.Archives.Rar.RarArchive ra = SharpCompress.Archives.Rar.RarArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false, });
|
||||
foreach (RarArchiveEntry entry in ra.Entries)
|
||||
{
|
||||
if (entry != null && !entry.IsDirectory && entry.Key.Contains(entryName))
|
||||
@@ -193,7 +193,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
try
|
||||
{
|
||||
RarArchive ra = RarArchive.Open(FileTools.TryOpenRead(_filename));
|
||||
SharpCompress.Archives.Rar.RarArchive ra = SharpCompress.Archives.Rar.RarArchive.Open(FileTools.TryOpenRead(_filename));
|
||||
foreach (RarArchiveEntry entry in ra.Entries.Where(e => e != null && !e.IsDirectory))
|
||||
{
|
||||
// If secure hashes are disabled, do a quickscan
|
||||
@@ -246,7 +246,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
try
|
||||
{
|
||||
RarArchive ra = RarArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false });
|
||||
SharpCompress.Archives.Rar.RarArchive ra = SharpCompress.Archives.Rar.RarArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false });
|
||||
List<RarArchiveEntry> rarEntries = ra.Entries.OrderBy(e => e.Key, new NaturalSort.NaturalReversedComparer()).ToList();
|
||||
string lastRarEntry = null;
|
||||
foreach (RarArchiveEntry entry in rarEntries)
|
||||
@@ -31,14 +31,14 @@ namespace SabreTools.Library.FileTypes
|
||||
/// Represents a Torrent7zip archive for reading and writing
|
||||
/// </summary>
|
||||
/// TODO: Torrent 7-zip: https://sourceforge.net/p/t7z/code/HEAD/tree/
|
||||
public class TorrentSevenZipArchive : BaseArchive
|
||||
public class SevenZipArchive : BaseArchive
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create a new TorrentSevenZipArchive with no base file
|
||||
/// </summary>
|
||||
public TorrentSevenZipArchive()
|
||||
public SevenZipArchive()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
@@ -48,7 +48,7 @@ namespace SabreTools.Library.FileTypes
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of the file to use as an archive</param>
|
||||
/// <param name="read">True for opening file as read, false for opening file as write</param>
|
||||
public TorrentSevenZipArchive(string filename)
|
||||
public SevenZipArchive(string filename)
|
||||
: base(filename)
|
||||
{
|
||||
_archiveType = ArchiveType.SevenZip;
|
||||
@@ -73,7 +73,7 @@ namespace SabreTools.Library.FileTypes
|
||||
Directory.CreateDirectory(outDir);
|
||||
|
||||
// Extract all files to the temp directory
|
||||
SevenZipArchive sza = SevenZipArchive.Open(FileTools.TryOpenRead(_filename));
|
||||
SharpCompress.Archives.SevenZip.SevenZipArchive sza = SharpCompress.Archives.SevenZip.SevenZipArchive.Open(FileTools.TryOpenRead(_filename));
|
||||
foreach (SevenZipArchiveEntry entry in sza.Entries)
|
||||
{
|
||||
entry.WriteToDirectory(outDir, new ExtractionOptions { PreserveFileTime = true, ExtractFullPath = true, Overwrite = true });
|
||||
@@ -157,7 +157,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
try
|
||||
{
|
||||
SevenZipArchive sza = SevenZipArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false, });
|
||||
SharpCompress.Archives.SevenZip.SevenZipArchive sza = SharpCompress.Archives.SevenZip.SevenZipArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false, });
|
||||
foreach (SevenZipArchiveEntry entry in sza.Entries)
|
||||
{
|
||||
if (entry != null && !entry.IsDirectory && entry.Key.Contains(entryName))
|
||||
@@ -198,7 +198,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
try
|
||||
{
|
||||
SevenZipArchive sza = SevenZipArchive.Open(FileTools.TryOpenRead(_filename));
|
||||
SharpCompress.Archives.SevenZip.SevenZipArchive sza = SharpCompress.Archives.SevenZip.SevenZipArchive.Open(FileTools.TryOpenRead(_filename));
|
||||
foreach (SevenZipArchiveEntry entry in sza.Entries.Where(e => e != null && !e.IsDirectory))
|
||||
{
|
||||
// If secure hashes are disabled, do a quickscan
|
||||
@@ -251,7 +251,7 @@ namespace SabreTools.Library.FileTypes
|
||||
|
||||
try
|
||||
{
|
||||
SevenZipArchive sza = SevenZipArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false });
|
||||
SharpCompress.Archives.SevenZip.SevenZipArchive sza = SharpCompress.Archives.SevenZip.SevenZipArchive.Open(_filename, new ReaderOptions { LeaveStreamOpen = false });
|
||||
List<SevenZipArchiveEntry> sevenZipEntries = sza.Entries.OrderBy(e => e.Key, new NaturalSort.NaturalReversedComparer()).ToList();
|
||||
string lastSevenZipEntry = null;
|
||||
foreach (SevenZipArchiveEntry entry in sevenZipEntries)
|
||||
@@ -30,14 +30,14 @@ namespace SabreTools.Library.FileTypes
|
||||
/// Represents a Torrent7zip archive for reading and writing
|
||||
/// </summary>
|
||||
/// TODO: Don't try to read entries to MemoryStream during write
|
||||
public class TorrentTarArchive : BaseArchive
|
||||
public class TapeArchive : BaseArchive
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create a new TorrentTarArchive with no base file
|
||||
/// </summary>
|
||||
public TorrentTarArchive()
|
||||
public TapeArchive()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
@@ -47,7 +47,7 @@ namespace SabreTools.Library.FileTypes
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of the file to use as an archive</param>
|
||||
/// <param name="read">True for opening file as read, false for opening file as write</param>
|
||||
public TorrentTarArchive(string filename)
|
||||
public TapeArchive(string filename)
|
||||
: base(filename)
|
||||
{
|
||||
_archiveType = ArchiveType.Tar;
|
||||
@@ -26,14 +26,14 @@ namespace SabreTools.Library.FileTypes
|
||||
/// Represents a TorrentXZ archive for reading and writing
|
||||
/// </summary>
|
||||
/// TODO: Wait for XZ write to be enabled by SevenZipSharp library
|
||||
public class TorrentXZArchive : BaseArchive
|
||||
public class XZArchive : BaseArchive
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Create a new TorrentGZipArchive with no base file
|
||||
/// </summary>
|
||||
public TorrentXZArchive()
|
||||
public XZArchive()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
@@ -43,7 +43,7 @@ namespace SabreTools.Library.FileTypes
|
||||
/// </summary>
|
||||
/// <param name="filename">Name of the file to use as an archive</param>
|
||||
/// <param name="read">True for opening file as read, false for opening file as write</param>
|
||||
public TorrentXZArchive(string filename)
|
||||
public XZArchive(string filename)
|
||||
: base(filename)
|
||||
{
|
||||
//_archiveType = ArchiveType.XZip;
|
||||
Reference in New Issue
Block a user