mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-05-06 20:43:36 +00:00
Quantum model cleanup
This commit is contained in:
@@ -9,16 +9,16 @@ namespace SabreTools.Data.Models.Quantum
|
||||
/// <summary>
|
||||
/// Quantum header
|
||||
/// </summary>
|
||||
public Header? Header { get; set; }
|
||||
public Header Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This is immediately followed by the list of files
|
||||
/// </summary>
|
||||
public FileDescriptor[]? FileList { get; set; }
|
||||
public FileDescriptor[] FileList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Immediately following the list of files is the compressed data
|
||||
/// </summary>
|
||||
public long CompressedDataOffset { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ namespace SabreTools.Data.Models.Quantum
|
||||
|
||||
public const ushort SignatureUInt16 = 0x5344;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ namespace SabreTools.Data.Models.Quantum
|
||||
/// Length of file name
|
||||
/// </summary>
|
||||
public int FileNameSize { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// File name, variable length string, not zero-terminated
|
||||
/// </summary>
|
||||
public string? FileName { get; set; }
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of comment field
|
||||
@@ -24,7 +24,7 @@ namespace SabreTools.Data.Models.Quantum
|
||||
/// <summary>
|
||||
/// Comment field, variable length string, not zero-terminated
|
||||
/// </summary>
|
||||
public string? CommentField { get; set; }
|
||||
public string CommentField { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fully expanded file size in bytes
|
||||
@@ -32,12 +32,12 @@ namespace SabreTools.Data.Models.Quantum
|
||||
public uint ExpandedFileSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File time (DOS format)
|
||||
/// File time (DOS format)
|
||||
/// </summary>
|
||||
public ushort FileTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File date (DOS format)
|
||||
/// File date (DOS format)
|
||||
/// </summary>
|
||||
public ushort FileDate { get; set; }
|
||||
|
||||
@@ -47,4 +47,4 @@ namespace SabreTools.Data.Models.Quantum
|
||||
/// <remarks>Minor version 22</remarks>
|
||||
public ushort? Unknown { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace SabreTools.Data.Models.Quantum
|
||||
/// Quantum signature: 0x44 0x53
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
|
||||
public string? Signature;
|
||||
public string Signature;
|
||||
|
||||
/// <summary>
|
||||
/// Quantum major version number
|
||||
@@ -40,4 +40,4 @@ namespace SabreTools.Data.Models.Quantum
|
||||
/// </summary>
|
||||
public byte CompressionFlags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,17 +24,10 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, Header? header)
|
||||
private static void Print(StringBuilder builder, Header header)
|
||||
{
|
||||
builder.AppendLine(" Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (header == null)
|
||||
{
|
||||
builder.AppendLine(" No header");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(header.Signature, " Signature");
|
||||
builder.AppendLine(header.MajorVersion, " Major version");
|
||||
builder.AppendLine(header.MinorVersion, " Minor version");
|
||||
@@ -44,11 +37,11 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, FileDescriptor[]? entries)
|
||||
private static void Print(StringBuilder builder, FileDescriptor[] entries)
|
||||
{
|
||||
builder.AppendLine(" File List Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (entries == null || entries.Length == 0)
|
||||
if (entries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No file list items");
|
||||
builder.AppendLine();
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace SabreTools.Serialization.Wrappers
|
||||
public long CompressedDataOffset => Model.CompressedDataOffset;
|
||||
|
||||
/// <inheritdoc cref="Header.FileCount"/>
|
||||
public ushort FileCount => Header?.FileCount ?? 0;
|
||||
public ushort FileCount => Header.FileCount;
|
||||
|
||||
/// <inheritdoc cref="Archive.FileList"/>
|
||||
public FileDescriptor[] FileList => Model.FileList ?? [];
|
||||
public FileDescriptor[] FileList => Model.FileList;
|
||||
|
||||
/// <inheritdoc cref="Archive.Header"/>
|
||||
public Header? Header => Model.Header;
|
||||
public Header Header => Model.Header;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user