mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Rename CopyToStream to GetEntryStream
This commit is contained in:
@@ -746,7 +746,7 @@ namespace SabreTools.DatTools
|
||||
if (archive != null)
|
||||
{
|
||||
ItemType itemType = datItem.GetStringFieldValue(Models.Metadata.DatItem.TypeKey).AsEnumValue<ItemType>();
|
||||
(stream, _) = archive.CopyToStream(datItem.GetName() ?? itemType.AsStringValue() ?? string.Empty);
|
||||
(stream, _) = archive.GetEntryStream(datItem.GetName() ?? itemType.AsStringValue() ?? string.Empty);
|
||||
}
|
||||
}
|
||||
// Otherwise, just open the filestream
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
public override string? CopyToFile(string entryName, string outDir)
|
||||
{
|
||||
// Try to extract a stream using the given information
|
||||
(Stream? ms, string? realEntry) = CopyToStream(entryName);
|
||||
(Stream? ms, string? realEntry) = GetEntryStream(entryName);
|
||||
|
||||
// If the stream and the entry name are both non-null, we write to file
|
||||
if (ms != null && realEntry != null)
|
||||
@@ -170,7 +170,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
string? realEntry;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
public override string? CopyToFile(string entryName, string outDir)
|
||||
{
|
||||
// Try to extract a stream using the given information
|
||||
(Stream? ms, string? realEntry) = CopyToStream(entryName);
|
||||
(Stream? ms, string? realEntry) = GetEntryStream(entryName);
|
||||
|
||||
// If the stream and the entry name are both non-null, we write to file
|
||||
if (ms != null && realEntry != null)
|
||||
@@ -134,7 +134,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
#if NET462_OR_GREATER || NETCOREAPP
|
||||
var ms = new MemoryStream();
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
public override string? CopyToFile(string entryName, string outDir)
|
||||
{
|
||||
// Try to extract a stream using the given information
|
||||
(Stream? ms, string? realEntry) = CopyToStream(entryName);
|
||||
(Stream? ms, string? realEntry) = GetEntryStream(entryName);
|
||||
|
||||
// If the stream and the entry name are both non-null, we write to file
|
||||
if (ms != null && realEntry != null)
|
||||
@@ -221,7 +221,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
string? realEntry = null;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
public override string? CopyToFile(string entryName, string outDir)
|
||||
{
|
||||
// Try to extract a stream using the given information
|
||||
(Stream? ms, string? realEntry) = CopyToStream(entryName);
|
||||
(Stream? ms, string? realEntry) = GetEntryStream(entryName);
|
||||
|
||||
// If the stream and the entry name are both non-null, we write to file
|
||||
if (ms != null && realEntry != null)
|
||||
@@ -135,7 +135,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
#if NET462_OR_GREATER || NETCOREAPP
|
||||
var ms = new MemoryStream();
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
public override string? CopyToFile(string entryName, string outDir)
|
||||
{
|
||||
// Try to extract a stream using the given information
|
||||
(Stream? ms, string? realEntry) = CopyToStream(entryName);
|
||||
(Stream? ms, string? realEntry) = GetEntryStream(entryName);
|
||||
|
||||
// If the stream and the entry name are both non-null, we write to file
|
||||
if (ms != null && realEntry != null)
|
||||
@@ -152,7 +152,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
#if NET462_OR_GREATER || NETCOREAPP
|
||||
var ms = new MemoryStream();
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
public override string? CopyToFile(string entryName, string outDir)
|
||||
{
|
||||
// Try to extract a stream using the given information
|
||||
(Stream? ms, string? realEntry) = CopyToStream(entryName);
|
||||
(Stream? ms, string? realEntry) = GetEntryStream(entryName);
|
||||
|
||||
// If the stream and the entry name are both non-null, we write to file
|
||||
if (ms != null && realEntry != null)
|
||||
@@ -196,7 +196,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
string? realEntry = null;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (Stream?, string?) CopyToStream(string entryName)
|
||||
public override (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace SabreTools.FileTypes
|
||||
public override abstract string? CopyToFile(string entryName, string outDir);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override abstract (Stream?, string?) CopyToStream(string entryName);
|
||||
public override abstract (Stream?, string?) GetEntryStream(string entryName);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -209,8 +209,8 @@ namespace SabreTools.FileTypes
|
||||
/// Attempt to extract a stream from an archive
|
||||
/// </summary>
|
||||
/// <param name="entryName">Name of the entry to be extracted</param>
|
||||
/// <returns>MemoryStream representing the entry, null on error</returns>
|
||||
public virtual (Stream?, string?) CopyToStream(string entryName)
|
||||
/// <returns>Stream representing the entry, null on error</returns>
|
||||
public virtual (Stream?, string?) GetEntryStream(string entryName)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
string? realentry = null;
|
||||
|
||||
Reference in New Issue
Block a user