Files
SabreTools.Models/MoPaQ/HashEntry.cs

46 lines
1.9 KiB
C#
Raw Permalink Normal View History

namespace SabreTools.Models.MoPaQ
2023-09-04 00:11:04 -04:00
{
/// <summary>
/// Hash table is used for searching files by name. The file name is converted to
/// two 32-bit hash values, which are then used for searching in the table. The size
/// of the hash table must always be a power of two. Each entry in the hash table
/// also contains file locale and offset into block table. Size of one entry of hash
/// table is 16 bytes.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
public sealed class HashEntry
{
/// <summary>
/// The hash of the full file name (part A)
/// </summary>
2023-09-10 21:24:10 -04:00
public uint NameHashPartA { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// The hash of the full file name (part B)
/// </summary>
2023-09-10 21:24:10 -04:00
public uint NameHashPartB { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// The language of the file. This is a Windows LANGID data type, and uses the same values.
/// 0 indicates the default language (American English), or that the file is language-neutral.
/// </summary>
2023-09-10 21:24:10 -04:00
public Locale Locale { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// The platform the file is used for. 0 indicates the default platform.
/// No other values have been observed.
/// </summary>
2023-09-10 21:24:10 -04:00
public ushort Platform { get; set; }
2023-09-04 00:11:04 -04:00
/// <summary>
/// If the hash table entry is valid, this is the index into the block table of the file.
/// Otherwise, one of the following two values:
/// - FFFFFFFFh: Hash table entry is empty, and has always been empty.
/// Terminates searches for a given file.
/// - FFFFFFFEh: Hash table entry is empty, but was valid at some point (a deleted file).
/// Does not terminate searches for a given file.
/// </summary>
2023-09-10 21:24:10 -04:00
public uint BlockIndex { get; set; }
2023-09-04 00:11:04 -04:00
}
}