pub struct MPQHashTableEntry {
pub hash_a: u32,
pub hash_b: u32,
pub locale: u16,
pub platform: u16,
pub block_table_index: u32,
}
Expand description
The hash table entry definition
Fields§
§hash_a: u32
The hash of the file path, using method A.
hash_b: u32
The hash of the file path, using method B.
locale: u16
The language of the file.
See MPQHashTableEntry::parse_locale
for more information.
platform: u16
The platform the file is used for.
See MPQHashTableEntry::parse_platform
for more information.
block_table_index: u32
Index into the block table of the file.
See MPQHashTableEntry::parse_block_table_index
for more information.
Implementations§
Source§impl MPQHashTableEntry
impl MPQHashTableEntry
Sourcepub fn new(
hash_a: u32,
hash_b: u32,
locale: u16,
platform: u16,
block_table_index: u32,
) -> Self
pub fn new( hash_a: u32, hash_b: u32, locale: u16, platform: u16, block_table_index: u32, ) -> Self
This method is not related to parsing but for testing, maybe we should consider further splitting this into a MPQHashTableEntryParser, maybe overkill.
Sourcepub fn parse_hash_a(input: &[u8]) -> IResult<&[u8], u32>
pub fn parse_hash_a(input: &[u8]) -> IResult<&[u8], u32>
Offset 0x00
: int32 FilePathHashA
The hash of the file path, using method A.
Sourcepub fn parse_hash_b(input: &[u8]) -> IResult<&[u8], u32>
pub fn parse_hash_b(input: &[u8]) -> IResult<&[u8], u32>
Offset 0x04
: int32 FilePathHashB
The hash of the file path, using method B.
Sourcepub fn parse_locale(input: &[u8]) -> IResult<&[u8], u16>
pub fn parse_locale(input: &[u8]) -> IResult<&[u8], u16>
Offset 0x08
: int16 Language
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.
Sourcepub fn parse_platform(input: &[u8]) -> IResult<&[u8], u16>
pub fn parse_platform(input: &[u8]) -> IResult<&[u8], u16>
Offset 0x0a
: int16 Platform
The platform the file is used for. 0 indicates the default platform. No other values have been observed.
Sourcepub fn parse_block_table_index(input: &[u8]) -> IResult<&[u8], u32>
pub fn parse_block_table_index(input: &[u8]) -> IResult<&[u8], u32>
Offset 0x0c
: int32 FileBlockIndex
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:
0xffffffff
- Hash table entry is empty, and has always been empty. Terminates searches for a given file.0xfffffffe
- Hash table entry is empty, but was valid at some point (in other words, the file was deleted). Does not terminate searches for a given file.
Trait Implementations§
Source§impl Clone for MPQHashTableEntry
impl Clone for MPQHashTableEntry
Source§fn clone(&self) -> MPQHashTableEntry
fn clone(&self) -> MPQHashTableEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more