mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Use StringBuilder in textfile report format
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
using SabreTools.Core.Tools;
|
using SabreTools.Core.Tools;
|
||||||
using SabreTools.DatFiles;
|
using SabreTools.DatFiles;
|
||||||
using SabreTools.DatItems;
|
using SabreTools.DatItems;
|
||||||
@@ -93,29 +94,32 @@ namespace SabreTools.Reports.Formats
|
|||||||
/// <param name="nodumpCol">True if nodumps should be included in output, false otherwise</param>
|
/// <param name="nodumpCol">True if nodumps should be included in output, false otherwise</param>
|
||||||
private static void WriteIndividual(StreamWriter sw, DatStatistics stat, bool baddumpCol, bool nodumpCol)
|
private static void WriteIndividual(StreamWriter sw, DatStatistics stat, bool baddumpCol, bool nodumpCol)
|
||||||
{
|
{
|
||||||
string line = @"'" + stat.DisplayName + @"':
|
var line = new StringBuilder();
|
||||||
--------------------------------------------------
|
|
||||||
Uncompressed size: " + NumberHelper.GetBytesReadable(stat!.TotalSize) + @"
|
line.AppendLine($"'{stat.DisplayName}':");
|
||||||
Games found: " + stat.MachineCount + @"
|
line.AppendLine($"--------------------------------------------------");
|
||||||
Roms found: " + stat.GetItemCount(ItemType.Rom) + @"
|
line.AppendLine($" Uncompressed size: {NumberHelper.GetBytesReadable(stat!.TotalSize)}");
|
||||||
Disks found: " + stat.GetItemCount(ItemType.Disk) + @"
|
line.AppendLine($" Games found: {stat.MachineCount}");
|
||||||
Roms with CRC: " + stat.GetHashCount(HashType.CRC32) + @"
|
line.AppendLine($" Roms found: {stat.GetItemCount(ItemType.Rom)}");
|
||||||
Roms with MD5: " + stat.GetHashCount(HashType.MD5) + @"
|
line.AppendLine($" Disks found: {stat.GetItemCount(ItemType.Disk)}");
|
||||||
Roms with SHA-1: " + stat.GetHashCount(HashType.SHA1) + @"
|
line.AppendLine($" Roms with CRC: {stat.GetHashCount(HashType.CRC32)}");
|
||||||
Roms with SHA-256: " + stat.GetHashCount(HashType.SHA256) + @"
|
line.AppendLine($" Roms with MD5: {stat.GetHashCount(HashType.MD5)}");
|
||||||
Roms with SHA-384: " + stat.GetHashCount(HashType.SHA384) + @"
|
line.AppendLine($" Roms with SHA-1: {stat.GetHashCount(HashType.SHA1)}");
|
||||||
Roms with SHA-512: " + stat.GetHashCount(HashType.SHA512) + "\n";
|
line.AppendLine($" Roms with SHA-256: {stat.GetHashCount(HashType.SHA256)}");
|
||||||
|
line.AppendLine($" Roms with SHA-384: {stat.GetHashCount(HashType.SHA384)}");
|
||||||
|
line.AppendLine($" Roms with SHA-512: {stat.GetHashCount(HashType.SHA512)}");
|
||||||
|
|
||||||
if (baddumpCol)
|
if (baddumpCol)
|
||||||
line += " Roms with BadDump status: " + stat.GetStatusCount(ItemStatus.BadDump) + "\n";
|
line.AppendLine($" Roms with BadDump status: {stat.GetStatusCount(ItemStatus.BadDump)}");
|
||||||
|
|
||||||
if (nodumpCol)
|
if (nodumpCol)
|
||||||
line += " Roms with Nodump status: " + stat.GetStatusCount(ItemStatus.Nodump) + "\n";
|
line.AppendLine($" Roms with Nodump status: {stat.GetStatusCount(ItemStatus.Nodump)}");
|
||||||
|
|
||||||
// For spacing between DATs
|
// For spacing between DATs
|
||||||
line += "\n\n";
|
line.AppendLine();
|
||||||
|
line.AppendLine();
|
||||||
|
|
||||||
sw.Write(line);
|
sw.Write(line.ToString());
|
||||||
sw.Flush();
|
sw.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user