Files
SabreTools.Serialization/SabreTools.Data.Models/PKZIP/CentralDirectoryFileHeader.cs
Matt Nadareski 7689c6dd07 Libraries
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
2026-03-21 16:26:56 -04:00

120 lines
3.3 KiB
C#

namespace SabreTools.Data.Models.PKZIP
{
/// <summary>
/// Central directory file header
/// </summary>
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
public class CentralDirectoryFileHeader
{
/// <summary>
/// Central file header signature (0x02014B50)
/// </summary>
public uint Signature { get; set; }
/// <summary>
/// Host system on which the file attributes are compatible
/// </summary>
public HostSystem HostSystem { get; set; }
/// <summary>
/// ZIP specification version
/// </summary>
public byte VersionMadeBy { get; set; }
/// <summary>
/// Version needed to extract
/// </summary>
/// <remarks>TODO: Add mapping of versions</remarks>
public ushort VersionNeededToExtract { get; set; }
/// <summary>
/// General purpose bit flag
/// </summary>
public GeneralPurposeBitFlags Flags { get; set; }
/// <summary>
/// Compression method
/// </summary>
public CompressionMethod CompressionMethod { get; set; }
/// <summary>
/// Last modified file time
/// </summary>
public ushort LastModifedFileTime { get; set; }
/// <summary>
/// Last modified file date
/// </summary>
public ushort LastModifiedFileDate { get; set; }
/// <summary>
/// CRC-32
/// </summary>
public uint CRC32 { get; set; }
/// <summary>
/// Compressed size
/// </summary>
public uint CompressedSize { get; set; }
/// <summary>
/// Uncompressed size
/// </summary>
public uint UncompressedSize { get; set; }
/// <summary>
/// File name length
/// </summary>
public ushort FileNameLength { get; set; }
/// <summary>
/// Extra field length
/// </summary>
public ushort ExtraFieldLength { get; set; }
/// <summary>
/// File comment length
/// </summary>
public ushort FileCommentLength { get; set; }
/// <summary>
/// Disk number start
/// </summary>
public ushort DiskNumberStart { get; set; }
/// <summary>
/// Internal file attributes
/// </summary>
public InternalFileAttributes InternalFileAttributes { get; set; }
/// <summary>
/// External file attributes
/// </summary>
public uint ExternalFileAttributes { get; set; }
/// <summary>
/// Relative offset of local header
/// </summary>
/// <remarks>
/// If ZIP64 and value is 0xFFFFFFFF, size will be in the
/// extended information extra field
/// </remarks>
public uint RelativeOffsetOfLocalHeader { get; set; }
/// <summary>
/// File name (variable size)
/// </summary>
public string? FileName { get; set; }
/// <summary>
/// Extra fields (variable size)
/// </summary>
public ExtensibleDataField[]? ExtraFields { get; set; }
/// <summary>
/// File comment (variable size)
/// </summary>
public string? FileComment { get; set; }
}
}