Extract out IO namespace, Part 2

This commit is contained in:
Matt Nadareski
2020-12-07 22:32:37 -08:00
parent 96e2afcfe4
commit 53f5d07ae4
23 changed files with 268 additions and 263 deletions

View File

@@ -2779,7 +2779,7 @@ namespace SabreTools.Library.DatFiles
if (rule.TransformStream(fileStream, transformStream, keepReadOpen: true, keepWriteOpen: true))
{
// Get the file informations that we will be using
Rom headerless = new Rom(transformStream.GetInfo(keepReadOpen: true));
Rom headerless = new Rom(BaseFile.GetInfo(transformStream, keepReadOpen: true));
// If we have duplicates and we're not filtering
if (ShouldRebuild(headerless, transformStream, false, out dupes))
@@ -2851,7 +2851,7 @@ namespace SabreTools.Library.DatFiles
string machinename = null;
// Get the item from the current file
Rom item = new Rom(stream.GetInfo(keepReadOpen: true));
Rom item = new Rom(BaseFile.GetInfo(stream, keepReadOpen: true));
item.Machine.Name = Path.GetFileNameWithoutExtension(item.Name);
item.Machine.Description = Path.GetFileNameWithoutExtension(item.Name);

View File

@@ -181,34 +181,6 @@ namespace SabreTools.Library.DatFiles
SHA512,
}
/// <summary>
/// Available hashing types
/// </summary>
[Flags]
public enum Hash
{
CRC = 1 << 0,
MD5 = 1 << 1,
#if NET_FRAMEWORK
RIPEMD160 = 1 << 2,
#endif
SHA1 = 1 << 3,
SHA256 = 1 << 4,
SHA384 = 1 << 5,
SHA512 = 1 << 6,
SpamSum = 1 << 7,
// Special combinations
Standard = CRC | MD5 | SHA1,
#if NET_FRAMEWORK
DeepHashes = RIPEMD160 | SHA256 | SHA384 | SHA512 | SpamSum,
SecureHashes = MD5 | RIPEMD160 | SHA1 | SHA256 | SHA384 | SHA512 | SpamSum,
#else
DeepHashes = SHA256 | SHA384 | SHA512 | SpamSum,
SecureHashes = MD5 | SHA1 | SHA256 | SHA384 | SHA512 | SpamSum,
#endif
}
/// <summary>
/// Determines merging tag handling for DAT output
/// </summary>

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using SabreTools.Data;
using SabreTools.IO;
using SabreTools.Library.DatItems;
using SabreTools.Library.IO;