From 88479f674b361425ed64814162cb5ccf865fe345 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 31 Oct 2024 12:06:25 -0400 Subject: [PATCH] Add CHD printer --- SabreTools.Serialization/Printer.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SabreTools.Serialization/Printer.cs b/SabreTools.Serialization/Printer.cs index 48c3a5f6..6fea86e3 100644 --- a/SabreTools.Serialization/Printer.cs +++ b/SabreTools.Serialization/Printer.cs @@ -39,6 +39,7 @@ namespace SabreTools.Serialization Wrapper.BFPK item => item.PrettyPrint(), Wrapper.BSP item => item.PrettyPrint(), Wrapper.CFB item => item.PrettyPrint(), + Wrapper.CHD item => item.PrettyPrint(), Wrapper.CIA item => item.PrettyPrint(), Wrapper.GCF item => item.PrettyPrint(), Wrapper.InstallShieldCabinet item => item.PrettyPrint(), @@ -83,6 +84,7 @@ namespace SabreTools.Serialization Wrapper.BFPK item => item.ExportJSON(), Wrapper.BSP item => item.ExportJSON(), Wrapper.CFB item => item.ExportJSON(), + Wrapper.CHD item => item.ExportJSON(), Wrapper.CIA item => item.ExportJSON(), Wrapper.GCF item => item.ExportJSON(), Wrapper.InstallShieldCabinet item => item.ExportJSON(), @@ -167,6 +169,16 @@ namespace SabreTools.Serialization return builder; } + /// + /// Export the item information as pretty-printed text + /// + private static StringBuilder PrettyPrint(this Wrapper.CHD item) + { + var builder = new StringBuilder(); + CHD.Print(builder, item.Model); + return builder; + } + /// /// Export the item information as pretty-printed text ///