namespace SabreTools.Data.Models.ZArchive
{
///
/// Represents a single ZAR archive
/// Most fields are Big Endian
///
///
public class Archive
{
///
/// Zstd compressed file data, from 65536-byte blocks of the original files
/// Blocks are stored uncompressed if ZStd does not decrease the size
/// Due to the file size, this field is not usually filled in but remains here for completeness
///
public byte[]? CompressedData { get; set; }
///
/// Padding bytes to be added after compressed blocks to ensure 8-byte alignment
/// Padding bytes are all NULL (0x00)
///
public byte[]? Padding { get; set; }
///
/// Records containing the offsets and block sizes of each group of blocks
/// This allows the reader to jump to any 65536-byte boundary in the uncompressed stream.
///
public OffsetRecord[] OffsetRecords { get; set; } = [];
///
/// UTF-8 strings, prepended by string lengths
///
public NameTable NameTable { get; set; } = new();
///
/// Serialized file tree structure using a queue of nodes
///
public FileDirectoryEntry[] FileTree { get; set; } = [];
///
/// Section for custom key-value pairs and properties
///
public Metadata? Metadata { get; set; }
///
/// Archive footer containing the offsets and sizes of all other sections
/// Ends with a SHA256 hash/size of the entire archive, and magic bytes
///
public Footer Footer { get; set; } = new();
}
}