Fix formatting for CHD printing

This commit is contained in:
Matt Nadareski
2024-10-31 13:38:42 -04:00
parent 61b89fbd72
commit 6bc812fc2f

View File

@@ -14,11 +14,10 @@ namespace SabreTools.Serialization.Printers
{
builder.AppendLine("CHD Header Information:");
builder.AppendLine("-------------------------");
builder.AppendLine();
if (header == null)
{
builder.AppendLine(" No header");
builder.AppendLine("No header");
builder.AppendLine();
return;
}
@@ -41,7 +40,7 @@ namespace SabreTools.Serialization.Printers
Print(builder, v5);
break;
default:
builder.AppendLine(" Unrecognized header type");
builder.AppendLine("Unrecognized header type");
builder.AppendLine();
break;
}
@@ -49,88 +48,88 @@ namespace SabreTools.Serialization.Printers
private static void Print(StringBuilder builder, HeaderV1 header)
{
builder.AppendLine(header.Tag, $" Tag");
builder.AppendLine(header.Length, $" Length");
builder.AppendLine(header.Version, $" Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.HunkSize, $" Hunk size");
builder.AppendLine(header.TotalHunks, $" Total hunks");
builder.AppendLine(header.Cylinders, $" Cylinders");
builder.AppendLine(header.Heads, $" Heads");
builder.AppendLine(header.Sectors, $" Sectors");
builder.AppendLine(header.MD5, $" MD5");
builder.AppendLine(header.ParentMD5, $" Parent MD5");
builder.AppendLine(header.Tag, $"Tag");
builder.AppendLine(header.Length, $"Length");
builder.AppendLine(header.Version, $"Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.HunkSize, $"Hunk size");
builder.AppendLine(header.TotalHunks, $"Total hunks");
builder.AppendLine(header.Cylinders, $"Cylinders");
builder.AppendLine(header.Heads, $"Heads");
builder.AppendLine(header.Sectors, $"Sectors");
builder.AppendLine(header.MD5, $"MD5");
builder.AppendLine(header.ParentMD5, $"Parent MD5");
builder.AppendLine();
}
private static void Print(StringBuilder builder, HeaderV2 header)
{
builder.AppendLine(header.Tag, $" Tag");
builder.AppendLine(header.Length, $" Length");
builder.AppendLine(header.Version, $" Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.HunkSize, $" Hunk size");
builder.AppendLine(header.TotalHunks, $" Total hunks");
builder.AppendLine(header.Cylinders, $" Cylinders");
builder.AppendLine(header.Heads, $" Heads");
builder.AppendLine(header.Sectors, $" Sectors");
builder.AppendLine(header.MD5, $" MD5");
builder.AppendLine(header.ParentMD5, $" Parent MD5");
builder.AppendLine(header.BytesPerSector, $" Bytes per sector");
builder.AppendLine(header.Tag, $"Tag");
builder.AppendLine(header.Length, $"Length");
builder.AppendLine(header.Version, $"Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.HunkSize, $"Hunk size");
builder.AppendLine(header.TotalHunks, $"Total hunks");
builder.AppendLine(header.Cylinders, $"Cylinders");
builder.AppendLine(header.Heads, $"Heads");
builder.AppendLine(header.Sectors, $"Sectors");
builder.AppendLine(header.MD5, $"MD5");
builder.AppendLine(header.ParentMD5, $"Parent MD5");
builder.AppendLine(header.BytesPerSector, $"Bytes per sector");
builder.AppendLine();
}
private static void Print(StringBuilder builder, HeaderV3 header)
{
builder.AppendLine(header.Tag, $" Tag");
builder.AppendLine(header.Length, $" Length");
builder.AppendLine(header.Version, $" Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.TotalHunks, $" Total hunks");
builder.AppendLine(header.LogicalBytes, $" Logical bytes");
builder.AppendLine(header.MetaOffset, $" Meta offset");
builder.AppendLine(header.MD5, $" MD5");
builder.AppendLine(header.ParentMD5, $" Parent MD5");
builder.AppendLine(header.HunkBytes, $" Hunk bytes");
builder.AppendLine(header.SHA1, $" SHA-1");
builder.AppendLine(header.ParentSHA1, $" Parent SHA-1");
builder.AppendLine(header.Tag, $"Tag");
builder.AppendLine(header.Length, $"Length");
builder.AppendLine(header.Version, $"Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.TotalHunks, $"Total hunks");
builder.AppendLine(header.LogicalBytes, $"Logical bytes");
builder.AppendLine(header.MetaOffset, $"Meta offset");
builder.AppendLine(header.MD5, $"MD5");
builder.AppendLine(header.ParentMD5, $"Parent MD5");
builder.AppendLine(header.HunkBytes, $"Hunk bytes");
builder.AppendLine(header.SHA1, $"SHA-1");
builder.AppendLine(header.ParentSHA1, $"Parent SHA-1");
builder.AppendLine();
}
private static void Print(StringBuilder builder, HeaderV4 header)
{
builder.AppendLine(header.Tag, $" Tag");
builder.AppendLine(header.Length, $" Length");
builder.AppendLine(header.Version, $" Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.TotalHunks, $" Total hunks");
builder.AppendLine(header.LogicalBytes, $" Logical bytes");
builder.AppendLine(header.MetaOffset, $" Meta offset");
builder.AppendLine(header.HunkBytes, $" Hunk bytes");
builder.AppendLine(header.SHA1, $" SHA-1");
builder.AppendLine(header.ParentSHA1, $" Parent SHA-1");
builder.AppendLine(header.RawSHA1, $" Raw SHA-1");
builder.AppendLine(header.Tag, $"Tag");
builder.AppendLine(header.Length, $"Length");
builder.AppendLine(header.Version, $"Version");
builder.AppendLine($" Flags: {header.Flags} (0x{header.Flags:X})");
builder.AppendLine($" Compression: {header.Compression} (0x{header.Compression:X})");
builder.AppendLine(header.TotalHunks, $"Total hunks");
builder.AppendLine(header.LogicalBytes, $"Logical bytes");
builder.AppendLine(header.MetaOffset, $"Meta offset");
builder.AppendLine(header.HunkBytes, $"Hunk bytes");
builder.AppendLine(header.SHA1, $"SHA-1");
builder.AppendLine(header.ParentSHA1, $"Parent SHA-1");
builder.AppendLine(header.RawSHA1, $"Raw SHA-1");
builder.AppendLine();
}
private static void Print(StringBuilder builder, HeaderV5 header)
{
builder.AppendLine(header.Tag, $" Tag");
builder.AppendLine(header.Length, $" Length");
builder.AppendLine(header.Version, $" Version");
builder.AppendLine(header.Compressors, $" Compressors");
builder.AppendLine(header.LogicalBytes, $" Logical bytes");
builder.AppendLine(header.MapOffset, $" Map offset");
builder.AppendLine(header.MetaOffset, $" Meta offset");
builder.AppendLine(header.HunkBytes, $" Hunk bytes");
builder.AppendLine(header.UnitBytes, $" Unit bytes");
builder.AppendLine(header.RawSHA1, $" Raw SHA-1");
builder.AppendLine(header.SHA1, $" SHA-1");
builder.AppendLine(header.ParentSHA1, $" Parent SHA-1");
builder.AppendLine(header.Tag, $"Tag");
builder.AppendLine(header.Length, $"Length");
builder.AppendLine(header.Version, $"Version");
builder.AppendLine(header.Compressors, $"Compressors");
builder.AppendLine(header.LogicalBytes, $"Logical bytes");
builder.AppendLine(header.MapOffset, $"Map offset");
builder.AppendLine(header.MetaOffset, $"Meta offset");
builder.AppendLine(header.HunkBytes, $"Hunk bytes");
builder.AppendLine(header.UnitBytes, $"Unit bytes");
builder.AppendLine(header.RawSHA1, $"Raw SHA-1");
builder.AppendLine(header.SHA1, $"SHA-1");
builder.AppendLine(header.ParentSHA1, $"Parent SHA-1");
builder.AppendLine();
}
}