mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
39 lines
1.3 KiB
C#
39 lines
1.3 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);
|
|
#else
|
|
/// <inheritdoc/>
|
|
public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(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();
|
|
}
|
|
}
|
|
}
|