mirror of
https://github.com/SabreTools/SabreTools.Printing.git
synced 2026-02-04 05:36:09 +00:00
Add template interface
This commit is contained in:
@@ -3,7 +3,7 @@ using SabreTools.Models.AACS;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class AACSMediaKeyBlock
|
||||
public class AACSMediaKeyBlock : IPrinter<MediaKeyBlock>
|
||||
{
|
||||
public static void Print(StringBuilder builder, MediaKeyBlock mediaKeyBlock)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.BDPlus;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class BDPlusSVM
|
||||
public class BDPlusSVM : IPrinter<SVM>
|
||||
{
|
||||
public static void Print(StringBuilder builder, SVM svm)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.BFPK;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class BFPK
|
||||
public class BFPK : IPrinter<Archive>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Archive archive)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using static SabreTools.Models.BSP.Constants;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class BSP
|
||||
public class BSP : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
@@ -141,6 +141,5 @@ namespace SabreTools.Printing
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using SabreTools.Models.CFB;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class CFB
|
||||
public class CFB : IPrinter<Binary>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Binary binary)
|
||||
{
|
||||
@@ -116,6 +116,5 @@ namespace SabreTools.Printing
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,9 @@ using SabreTools.Models.N3DS;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class CIA
|
||||
public class CIA : IPrinter<Models.N3DS.CIA>
|
||||
{
|
||||
public static void Print(StringBuilder builder, SabreTools.Models.N3DS.CIA cia)
|
||||
public static void Print(StringBuilder builder, Models.N3DS.CIA cia)
|
||||
{
|
||||
builder.AppendLine("CIA Archive Information:");
|
||||
builder.AppendLine("-------------------------");
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.GCF;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class GCF
|
||||
public class GCF : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
11
SabreTools.Printing/IPrinter.cs
Normal file
11
SabreTools.Printing/IPrinter.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
/// <summary>
|
||||
/// Marks a class as a printer associated with a model
|
||||
/// </summary>
|
||||
/// <typeparam name="TModel">Type of the top-level model</typeparam>
|
||||
public interface IPrinter<TModel>
|
||||
{
|
||||
// Empty interface to associate a model with a printer
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ using System.Text;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class IRD
|
||||
public class IRD : IPrinter<Models.IRD.File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Models.IRD.File ird)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using SabreTools.Models.InstallShieldCabinet;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class InstallShieldCabinet
|
||||
public class InstallShieldCabinet : IPrinter<Cabinet>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Cabinet cabinet)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using System.Text;
|
||||
using SabreTools.Models.LinearExecutable;
|
||||
using SabreTools.Models.MicrosoftCabinet;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class LinearExecutable
|
||||
public class LinearExecutable : IPrinter<Executable>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Executable executable)
|
||||
{
|
||||
@@ -37,7 +36,7 @@ namespace SabreTools.Printing
|
||||
Print(builder, executable.DebugInformation);
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, SabreTools.Models.MSDOS.ExecutableHeader? header)
|
||||
private static void Print(StringBuilder builder, Models.MSDOS.ExecutableHeader? header)
|
||||
{
|
||||
builder.AppendLine(" MS-DOS Stub Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.MSDOS;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class MSDOS
|
||||
public class MSDOS : IPrinter<Executable>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Executable executable)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using SabreTools.Models.MicrosoftCabinet;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class MicrosoftCabinet
|
||||
public class MicrosoftCabinet : IPrinter<Cabinet>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Cabinet cabinet)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.N3DS;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class N3DS
|
||||
public class N3DS : IPrinter<Cart>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Cart cart)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.NCF;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class NCF
|
||||
public class NCF : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using static SabreTools.Serialization.Extensions;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class NewExecutable
|
||||
public class NewExecutable : IPrinter<Executable>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Executable executable)
|
||||
{
|
||||
@@ -29,7 +29,7 @@ namespace SabreTools.Printing
|
||||
Print(builder, executable.NonResidentNameTable);
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, SabreTools.Models.MSDOS.ExecutableHeader? header)
|
||||
private static void Print(StringBuilder builder, Models.MSDOS.ExecutableHeader? header)
|
||||
{
|
||||
builder.AppendLine(" MS-DOS Stub Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
@@ -250,7 +250,7 @@ namespace SabreTools.Printing
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, ModuleReferenceTableEntry?[]? entries, SabreTools.Models.MSDOS.ExecutableHeader? stub, ExecutableHeader? header)
|
||||
private static void Print(StringBuilder builder, ModuleReferenceTableEntry?[]? entries, Models.MSDOS.ExecutableHeader? stub, ExecutableHeader? header)
|
||||
{
|
||||
builder.AppendLine(" Module-Reference Table Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.Nitro;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class Nitro
|
||||
public class Nitro : IPrinter<Cart>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Cart cart)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.PAK;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class PAK
|
||||
public class PAK : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.PFF;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class PFF
|
||||
public class PFF : IPrinter<Archive>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Archive archive)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.PlayJ;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class PlayJAudioFile
|
||||
public class PlayJAudioFile : IPrinter<AudioFile>
|
||||
{
|
||||
public static void Print(StringBuilder builder, AudioFile audio)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using static SabreTools.Serialization.Extensions;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class PortableExecutable
|
||||
public class PortableExecutable : IPrinter<Executable>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Executable executable)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ namespace SabreTools.Printing
|
||||
Print(builder, executable.ResourceDirectoryTable);
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, SabreTools.Models.MSDOS.ExecutableHeader? header)
|
||||
private static void Print(StringBuilder builder, Models.MSDOS.ExecutableHeader? header)
|
||||
{
|
||||
builder.AppendLine(" MS-DOS Stub Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.Quantum;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class Quantum
|
||||
public class Quantum : IPrinter<Archive>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Archive archive)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.SGA;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class SGA
|
||||
public class SGA : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using static SabreTools.Models.VBSP.Constants;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class VBSP
|
||||
public class VBSP : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.VPK;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class VPK
|
||||
public class VPK : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.WAD;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class WAD
|
||||
public class WAD : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using static SabreTools.Models.Xbox.Constants;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class XMID
|
||||
public class XMID : IPrinter<Models.Xbox.XMID>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Models.Xbox.XMID xmid)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using SabreTools.Models.XZP;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class XZP
|
||||
public class XZP : IPrinter<File>
|
||||
{
|
||||
public static void Print(StringBuilder builder, File file)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using static SabreTools.Models.Xbox.Constants;
|
||||
|
||||
namespace SabreTools.Printing
|
||||
{
|
||||
public static class XeMID
|
||||
public class XeMID : IPrinter<Models.Xbox.XeMID>
|
||||
{
|
||||
public static void Print(StringBuilder builder, Models.Xbox.XeMID xemid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user