mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-05 22:01:33 +00:00
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using System.Text;
|
|
using SabreTools.Data.Models.LZ;
|
|
using SabreTools.Text.Extensions;
|
|
|
|
namespace SabreTools.Wrappers
|
|
{
|
|
public partial class LZSZDD : IPrintable
|
|
{
|
|
#if NETCOREAPP
|
|
/// <inheritdoc/>
|
|
public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions);
|
|
#endif
|
|
|
|
/// <inheritdoc/>
|
|
public void PrintInformation(StringBuilder builder)
|
|
{
|
|
builder.AppendLine("LZ-compressed File, SZDD Variant Information:");
|
|
builder.AppendLine("-------------------------");
|
|
builder.AppendLine();
|
|
|
|
Print(builder, Model.Header);
|
|
}
|
|
|
|
private static void Print(StringBuilder builder, SZDDHeader header)
|
|
{
|
|
builder.AppendLine(" Header Information:");
|
|
builder.AppendLine(" -------------------------");
|
|
builder.AppendLine(header.Magic, " Magic number");
|
|
builder.AppendLine($" Compression type: {header.CompressionType} (0x{header.CompressionType:X})");
|
|
builder.AppendLine(header.LastChar, " Last char");
|
|
builder.AppendLine(header.RealLength, " Real length");
|
|
builder.AppendLine();
|
|
}
|
|
}
|
|
}
|