mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[FileTypes] Rename methods to fit better
This commit is contained in:
@@ -4403,7 +4403,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
Folder archive = Utilities.GetArchive(file);
|
Folder archive = Utilities.GetArchive(file);
|
||||||
if (archive != null)
|
if (archive != null)
|
||||||
{
|
{
|
||||||
(fileStream, realName) = archive.ExtractEntryStream(datItem.Name);
|
(fileStream, realName) = archive.CopyToStream(datItem.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Otherwise, just open the filestream
|
// Otherwise, just open the filestream
|
||||||
@@ -4487,7 +4487,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
Folder archive = Utilities.GetArchive(file);
|
Folder archive = Utilities.GetArchive(file);
|
||||||
if (archive != null)
|
if (archive != null)
|
||||||
{
|
{
|
||||||
(fileStream, realName) = archive.ExtractEntryStream(datItem.Name);
|
(fileStream, realName) = archive.CopyToStream(datItem.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Otherwise, just open the filestream
|
// Otherwise, just open the filestream
|
||||||
@@ -4577,7 +4577,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
Folder archive = Utilities.GetArchive(file);
|
Folder archive = Utilities.GetArchive(file);
|
||||||
if (archive != null)
|
if (archive != null)
|
||||||
{
|
{
|
||||||
(fileStream, realName) = archive.ExtractEntryStream(datItem.Name);
|
(fileStream, realName) = archive.CopyToStream(datItem.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Otherwise, just open the filestream
|
// Otherwise, just open the filestream
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public new abstract bool ExtractAll(string outDir);
|
public override abstract bool CopyAll(string outDir);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempt to extract an entry from an archive
|
/// Attempt to extract an entry from an archive
|
||||||
@@ -56,7 +56,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public new abstract string ExtractEntry(string entryName, string outDir);
|
public override abstract string CopyToFile(string entryName, string outDir);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempt to extract a stream from an archive
|
/// Attempt to extract a stream from an archive
|
||||||
@@ -64,7 +64,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public new abstract (MemoryStream, string) ExtractEntryStream(string entryName);
|
public override abstract (MemoryStream, string) CopyToStream(string entryName);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
||||||
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
||||||
/// <returns>True if the archive was written properly, false otherwise</returns>
|
/// <returns>True if the archive was written properly, false otherwise</returns>
|
||||||
public abstract bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false);
|
public override abstract bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Write an input stream to an archive
|
/// Write an input stream to an archive
|
||||||
@@ -115,7 +115,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
||||||
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
||||||
/// <returns>True if the archive was written properly, false otherwise</returns>
|
/// <returns>True if the archive was written properly, false otherwise</returns>
|
||||||
public abstract bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false);
|
public override abstract bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Write a set of input files to an archive (assuming the same output archive name)
|
/// Write a set of input files to an archive (assuming the same output archive name)
|
||||||
@@ -126,7 +126,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
||||||
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
||||||
/// <returns>True if the archive was written properly, false otherwise</returns>
|
/// <returns>True if the archive was written properly, false otherwise</returns>
|
||||||
public abstract bool Write(List<string> inputFiles, string outDir, List<Rom> roms, bool date = false, bool romba = false);
|
public override abstract bool Write(List<string> inputFiles, string outDir, List<Rom> roms, bool date = false, bool romba = false);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ using SearchOption = System.IO.SearchOption;
|
|||||||
using SeekOrigin = System.IO.SeekOrigin;
|
using SeekOrigin = System.IO.SeekOrigin;
|
||||||
using Stream = System.IO.Stream;
|
using Stream = System.IO.Stream;
|
||||||
#endif
|
#endif
|
||||||
using SharpCompress.Common;
|
|
||||||
|
|
||||||
namespace SabreTools.Library.FileTypes
|
namespace SabreTools.Library.FileTypes
|
||||||
{
|
{
|
||||||
@@ -66,7 +65,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public bool ExtractAll(string outDir)
|
public virtual bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
// Copy all files from the current folder to the output directory recursively
|
// Copy all files from the current folder to the output directory recursively
|
||||||
try
|
try
|
||||||
@@ -92,7 +91,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public string ExtractEntry(string entryName, string outDir)
|
public virtual string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
string realentry = null;
|
string realentry = null;
|
||||||
|
|
||||||
@@ -131,7 +130,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public (MemoryStream, string) ExtractEntryStream(string entryName)
|
public virtual (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
MemoryStream ms = new MemoryStream();
|
MemoryStream ms = new MemoryStream();
|
||||||
string realentry = null;
|
string realentry = null;
|
||||||
@@ -175,7 +174,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="date">True if entry dates should be included, false otherwise (default)</param>
|
/// <param name="date">True if entry dates should be included, false otherwise (default)</param>
|
||||||
/// <returns>List of BaseFile objects representing the found data</returns>
|
/// <returns>List of BaseFile objects representing the found data</returns>
|
||||||
/// <remarks>TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually</remarks>
|
/// <remarks>TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually</remarks>
|
||||||
public List<BaseFile> GetChildren(Hash omitFromScan = Hash.DeepHashes, bool date = false)
|
public virtual List<BaseFile> GetChildren(Hash omitFromScan = Hash.DeepHashes, bool date = false)
|
||||||
{
|
{
|
||||||
if (_children == null || _children.Count == 0)
|
if (_children == null || _children.Count == 0)
|
||||||
{
|
{
|
||||||
@@ -200,7 +199,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input">Input file to get data from</param>
|
/// <param name="input">Input file to get data from</param>
|
||||||
/// <returns>List of empty folders in the folder</returns>
|
/// <returns>List of empty folders in the folder</returns>
|
||||||
public List<string> GetEmptyFolders()
|
public virtual List<string> GetEmptyFolders()
|
||||||
{
|
{
|
||||||
return Utilities.GetEmptyDirectories(_filename).ToList();
|
return Utilities.GetEmptyDirectories(_filename).ToList();
|
||||||
}
|
}
|
||||||
@@ -210,7 +209,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
#region Writing
|
#region Writing
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Write an input file to a torrent LRZip file
|
/// Write an input file to an output folder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputFile">Input filename to be moved</param>
|
/// <param name="inputFile">Input filename to be moved</param>
|
||||||
/// <param name="outDir">Output directory to build to</param>
|
/// <param name="outDir">Output directory to build to</param>
|
||||||
@@ -219,13 +218,13 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
||||||
/// <returns>True if the write was a success, false otherwise</returns>
|
/// <returns>True if the write was a success, false otherwise</returns>
|
||||||
/// <remarks>This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code.</remarks>
|
/// <remarks>This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code.</remarks>
|
||||||
public bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false)
|
public virtual bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Write an input stream to a torrent LRZip file
|
/// Write an input stream to an output folder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputStream">Input stream to be moved</param>
|
/// <param name="inputStream">Input stream to be moved</param>
|
||||||
/// <param name="outDir">Output directory to build to</param>
|
/// <param name="outDir">Output directory to build to</param>
|
||||||
@@ -234,7 +233,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
||||||
/// <returns>True if the write was a success, false otherwise</returns>
|
/// <returns>True if the write was a success, false otherwise</returns>
|
||||||
/// <remarks>This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code.</remarks>
|
/// <remarks>This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code.</remarks>
|
||||||
public bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false)
|
public virtual bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
@@ -308,7 +307,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Write a set of input files to a torrent LRZip archive (assuming the same output archive name)
|
/// Write a set of input files to an output folder (assuming the same output archive name)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputFiles">Input files to be moved</param>
|
/// <param name="inputFiles">Input files to be moved</param>
|
||||||
/// <param name="outDir">Output directory to build to</param>
|
/// <param name="outDir">Output directory to build to</param>
|
||||||
@@ -316,7 +315,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
/// <param name="date">True if the date from the DAT should be used if available, false otherwise (default)</param>
|
||||||
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
||||||
/// <returns>True if the archive was written properly, false otherwise</returns>
|
/// <returns>True if the archive was written properly, false otherwise</returns>
|
||||||
public bool Write(List<string> inputFiles, string outDir, List<Rom> roms, bool date = false, bool romba = false)
|
public virtual bool Write(List<string> inputFiles, string outDir, List<Rom> roms, bool date = false, bool romba = false)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
bool encounteredErrors = true;
|
bool encounteredErrors = true;
|
||||||
|
|
||||||
@@ -103,10 +103,10 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
// Try to extract a stream using the given information
|
// Try to extract a stream using the given information
|
||||||
(MemoryStream ms, string realEntry) = ExtractEntryStream(entryName);
|
(MemoryStream ms, string realEntry) = CopyToStream(entryName);
|
||||||
|
|
||||||
// If the memory stream and the entry name are both non-null, we write to file
|
// If the memory stream and the entry name are both non-null, we write to file
|
||||||
if (ms != null && realEntry != null)
|
if (ms != null && realEntry != null)
|
||||||
@@ -149,7 +149,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
MemoryStream ms = new MemoryStream();
|
MemoryStream ms = new MemoryStream();
|
||||||
string realEntry = null;
|
string realEntry = null;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
bool encounteredErrors = true;
|
bool encounteredErrors = true;
|
||||||
|
|
||||||
@@ -101,10 +101,10 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
// Try to extract a stream using the given information
|
// Try to extract a stream using the given information
|
||||||
(MemoryStream ms, string realEntry) = ExtractEntryStream(entryName);
|
(MemoryStream ms, string realEntry) = CopyToStream(entryName);
|
||||||
|
|
||||||
// If the memory stream and the entry name are both non-null, we write to file
|
// If the memory stream and the entry name are both non-null, we write to file
|
||||||
if (ms != null && realEntry != null)
|
if (ms != null && realEntry != null)
|
||||||
@@ -147,7 +147,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
MemoryStream ms = new MemoryStream();
|
MemoryStream ms = new MemoryStream();
|
||||||
string realEntry = null;
|
string realEntry = null;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
bool encounteredErrors = true;
|
bool encounteredErrors = true;
|
||||||
|
|
||||||
@@ -104,10 +104,10 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
// Try to extract a stream using the given information
|
// Try to extract a stream using the given information
|
||||||
(MemoryStream ms, string realEntry) = ExtractEntryStream(entryName);
|
(MemoryStream ms, string realEntry) = CopyToStream(entryName);
|
||||||
|
|
||||||
// If the memory stream and the entry name are both non-null, we write to file
|
// If the memory stream and the entry name are both non-null, we write to file
|
||||||
if (ms != null && realEntry != null)
|
if (ms != null && realEntry != null)
|
||||||
@@ -150,7 +150,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
MemoryStream ms = new MemoryStream();
|
MemoryStream ms = new MemoryStream();
|
||||||
string realEntry = null;
|
string realEntry = null;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
bool encounteredErrors = true;
|
bool encounteredErrors = true;
|
||||||
|
|
||||||
@@ -104,10 +104,10 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
// Try to extract a stream using the given information
|
// Try to extract a stream using the given information
|
||||||
(MemoryStream ms, string realEntry) = ExtractEntryStream(entryName);
|
(MemoryStream ms, string realEntry) = CopyToStream(entryName);
|
||||||
|
|
||||||
// If the memory stream and the entry name are both non-null, we write to file
|
// If the memory stream and the entry name are both non-null, we write to file
|
||||||
if (ms != null && realEntry != null)
|
if (ms != null && realEntry != null)
|
||||||
@@ -150,7 +150,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
MemoryStream ms = new MemoryStream();
|
MemoryStream ms = new MemoryStream();
|
||||||
string realEntry = null;
|
string realEntry = null;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
bool encounteredErrors = true;
|
bool encounteredErrors = true;
|
||||||
|
|
||||||
@@ -147,10 +147,10 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
// Try to extract a stream using the given information
|
// Try to extract a stream using the given information
|
||||||
(MemoryStream ms, string realEntry) = ExtractEntryStream(entryName);
|
(MemoryStream ms, string realEntry) = CopyToStream(entryName);
|
||||||
|
|
||||||
// If the memory stream and the entry name are both non-null, we write to file
|
// If the memory stream and the entry name are both non-null, we write to file
|
||||||
if (ms != null && realEntry != null)
|
if (ms != null && realEntry != null)
|
||||||
@@ -193,7 +193,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
MemoryStream ms = new MemoryStream();
|
MemoryStream ms = new MemoryStream();
|
||||||
string realEntry = null;
|
string realEntry = null;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
bool encounteredErrors = true;
|
bool encounteredErrors = true;
|
||||||
|
|
||||||
@@ -104,10 +104,10 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
// Try to extract a stream using the given information
|
// Try to extract a stream using the given information
|
||||||
(MemoryStream ms, string realEntry) = ExtractEntryStream(entryName);
|
(MemoryStream ms, string realEntry) = CopyToStream(entryName);
|
||||||
|
|
||||||
// If the memory stream and the entry name are both non-null, we write to file
|
// If the memory stream and the entry name are both non-null, we write to file
|
||||||
if (ms != null && realEntry != null)
|
if (ms != null && realEntry != null)
|
||||||
@@ -150,7 +150,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
MemoryStream ms = new MemoryStream();
|
MemoryStream ms = new MemoryStream();
|
||||||
string realEntry = null;
|
string realEntry = null;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>True if the extraction was a success, false otherwise</returns>
|
/// <returns>True if the extraction was a success, false otherwise</returns>
|
||||||
public override bool ExtractAll(string outDir)
|
public override bool CopyAll(string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="outDir">Output directory for archive extraction</param>
|
/// <param name="outDir">Output directory for archive extraction</param>
|
||||||
/// <returns>Name of the extracted file, null on error</returns>
|
/// <returns>Name of the extracted file, null on error</returns>
|
||||||
public override string ExtractEntry(string entryName, string outDir)
|
public override string CopyToFile(string entryName, string outDir)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ namespace SabreTools.Library.FileTypes
|
|||||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||||
/// <param name="realEntry">Output representing the entry name that was found</param>
|
/// <param name="realEntry">Output representing the entry name that was found</param>
|
||||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||||
public override (MemoryStream, string) ExtractEntryStream(string entryName)
|
public override (MemoryStream, string) CopyToStream(string entryName)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user