From 8af80b79af451c58fba6cd0cb06611825feff1ca Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 15 Jul 2024 21:37:38 -0400 Subject: [PATCH] Rename CopyToStream to GetEntryStream --- SabreTools.DatTools/Rebuilder.cs | 2 +- SabreTools.FileTypes/Archives/GZipArchive.cs | 4 ++-- SabreTools.FileTypes/Archives/LRZipArchive.cs | 2 +- SabreTools.FileTypes/Archives/LZ4Archive.cs | 2 +- SabreTools.FileTypes/Archives/RarArchive.cs | 4 ++-- SabreTools.FileTypes/Archives/SevenZipArchive.cs | 4 ++-- SabreTools.FileTypes/Archives/TapeArchive.cs | 4 ++-- SabreTools.FileTypes/Archives/XZArchive.cs | 4 ++-- SabreTools.FileTypes/Archives/ZPAQArchive.cs | 2 +- SabreTools.FileTypes/Archives/ZipArchive.cs | 4 ++-- SabreTools.FileTypes/Archives/ZstdArchive.cs | 2 +- SabreTools.FileTypes/BaseArchive.cs | 2 +- SabreTools.FileTypes/Folder.cs | 4 ++-- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/SabreTools.DatTools/Rebuilder.cs b/SabreTools.DatTools/Rebuilder.cs index 6f977428..77501ee9 100644 --- a/SabreTools.DatTools/Rebuilder.cs +++ b/SabreTools.DatTools/Rebuilder.cs @@ -746,7 +746,7 @@ namespace SabreTools.DatTools if (archive != null) { ItemType itemType = datItem.GetStringFieldValue(Models.Metadata.DatItem.TypeKey).AsEnumValue(); - (stream, _) = archive.CopyToStream(datItem.GetName() ?? itemType.AsStringValue() ?? string.Empty); + (stream, _) = archive.GetEntryStream(datItem.GetName() ?? itemType.AsStringValue() ?? string.Empty); } } // Otherwise, just open the filestream diff --git a/SabreTools.FileTypes/Archives/GZipArchive.cs b/SabreTools.FileTypes/Archives/GZipArchive.cs index 8c773236..36187600 100644 --- a/SabreTools.FileTypes/Archives/GZipArchive.cs +++ b/SabreTools.FileTypes/Archives/GZipArchive.cs @@ -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 } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { var ms = new MemoryStream(); string? realEntry; diff --git a/SabreTools.FileTypes/Archives/LRZipArchive.cs b/SabreTools.FileTypes/Archives/LRZipArchive.cs index d727dcd3..400dc026 100644 --- a/SabreTools.FileTypes/Archives/LRZipArchive.cs +++ b/SabreTools.FileTypes/Archives/LRZipArchive.cs @@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { throw new NotImplementedException(); } diff --git a/SabreTools.FileTypes/Archives/LZ4Archive.cs b/SabreTools.FileTypes/Archives/LZ4Archive.cs index 6f89ab0b..63202962 100644 --- a/SabreTools.FileTypes/Archives/LZ4Archive.cs +++ b/SabreTools.FileTypes/Archives/LZ4Archive.cs @@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { throw new NotImplementedException(); } diff --git a/SabreTools.FileTypes/Archives/RarArchive.cs b/SabreTools.FileTypes/Archives/RarArchive.cs index f5712a73..f32656b3 100644 --- a/SabreTools.FileTypes/Archives/RarArchive.cs +++ b/SabreTools.FileTypes/Archives/RarArchive.cs @@ -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 } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { #if NET462_OR_GREATER || NETCOREAPP var ms = new MemoryStream(); diff --git a/SabreTools.FileTypes/Archives/SevenZipArchive.cs b/SabreTools.FileTypes/Archives/SevenZipArchive.cs index f60dddb6..3ade8fcb 100644 --- a/SabreTools.FileTypes/Archives/SevenZipArchive.cs +++ b/SabreTools.FileTypes/Archives/SevenZipArchive.cs @@ -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 } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { var ms = new MemoryStream(); string? realEntry = null; diff --git a/SabreTools.FileTypes/Archives/TapeArchive.cs b/SabreTools.FileTypes/Archives/TapeArchive.cs index 5082bc64..27c81601 100644 --- a/SabreTools.FileTypes/Archives/TapeArchive.cs +++ b/SabreTools.FileTypes/Archives/TapeArchive.cs @@ -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 } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { #if NET462_OR_GREATER || NETCOREAPP var ms = new MemoryStream(); diff --git a/SabreTools.FileTypes/Archives/XZArchive.cs b/SabreTools.FileTypes/Archives/XZArchive.cs index 550140e5..d6ae5cb0 100644 --- a/SabreTools.FileTypes/Archives/XZArchive.cs +++ b/SabreTools.FileTypes/Archives/XZArchive.cs @@ -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 } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { #if NET462_OR_GREATER || NETCOREAPP var ms = new MemoryStream(); diff --git a/SabreTools.FileTypes/Archives/ZPAQArchive.cs b/SabreTools.FileTypes/Archives/ZPAQArchive.cs index cb958663..93f7a00b 100644 --- a/SabreTools.FileTypes/Archives/ZPAQArchive.cs +++ b/SabreTools.FileTypes/Archives/ZPAQArchive.cs @@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { throw new NotImplementedException(); } diff --git a/SabreTools.FileTypes/Archives/ZipArchive.cs b/SabreTools.FileTypes/Archives/ZipArchive.cs index 776d1d9c..d8a69520 100644 --- a/SabreTools.FileTypes/Archives/ZipArchive.cs +++ b/SabreTools.FileTypes/Archives/ZipArchive.cs @@ -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 } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { var ms = new MemoryStream(); string? realEntry = null; diff --git a/SabreTools.FileTypes/Archives/ZstdArchive.cs b/SabreTools.FileTypes/Archives/ZstdArchive.cs index 468e6079..052e8ce9 100644 --- a/SabreTools.FileTypes/Archives/ZstdArchive.cs +++ b/SabreTools.FileTypes/Archives/ZstdArchive.cs @@ -49,7 +49,7 @@ namespace SabreTools.FileTypes.Archives } /// - public override (Stream?, string?) CopyToStream(string entryName) + public override (Stream?, string?) GetEntryStream(string entryName) { throw new NotImplementedException(); } diff --git a/SabreTools.FileTypes/BaseArchive.cs b/SabreTools.FileTypes/BaseArchive.cs index 2df1ece4..d0a05b24 100644 --- a/SabreTools.FileTypes/BaseArchive.cs +++ b/SabreTools.FileTypes/BaseArchive.cs @@ -121,7 +121,7 @@ namespace SabreTools.FileTypes public override abstract string? CopyToFile(string entryName, string outDir); /// - public override abstract (Stream?, string?) CopyToStream(string entryName); + public override abstract (Stream?, string?) GetEntryStream(string entryName); #endregion diff --git a/SabreTools.FileTypes/Folder.cs b/SabreTools.FileTypes/Folder.cs index 544d13ae..eed50535 100644 --- a/SabreTools.FileTypes/Folder.cs +++ b/SabreTools.FileTypes/Folder.cs @@ -209,8 +209,8 @@ namespace SabreTools.FileTypes /// Attempt to extract a stream from an archive /// /// Name of the entry to be extracted - /// MemoryStream representing the entry, null on error - public virtual (Stream?, string?) CopyToStream(string entryName) + /// Stream representing the entry, null on error + public virtual (Stream?, string?) GetEntryStream(string entryName) { var ms = new MemoryStream(); string? realentry = null;