Module parser

Module parser 

Source
Expand description

Nom Parsing the MPQ file format

NOTES:

  • All numbers in the MoPaQ format are in little endian byte order
  • Signed numbers use the two’s complement system.
  • Structure members are listed in the following general form:
    • offset from the beginning of the structure: data type(array size) member name : member description

Re-exports§

pub use mpq_block_table_entry::MPQBlockTableEntry;
pub use mpq_file_header::MPQFileHeader;
pub use mpq_file_header_ext::MPQFileHeaderExt;
pub use mpq_hash_table_entry::MPQHashTableEntry;
pub use mpq_user_data::MPQUserData;

Modules§

mpq_block_table_entry
The Block Table Parsing
mpq_file_header
Nom Parsing The MPQ File Header NOTES:
mpq_file_header_ext
Nom Parsing The MPQ File Header Extended NOTES:
mpq_hash_table_entry
The Hash Table Parsing
mpq_user_data
Nom Parsing The MPQ User Data Section NOTES:

Enums§

MPQHashType
Different HashTypes used in MPQ Archives, they are used to identify embedded filenames.
MPQSectionType
The type of sections that are available in an MPQ archive

Constants§

LITTLE_ENDIAN
The numeric values read are encoded in little endian LE
MPQ_ARCHIVE_HEADER_TYPE
Final byte of the magic to identify particularly the Archive Header.
MPQ_USER_DATA_HEADER_TYPE
Final byte of the magic to identify particularly the User Data.

Statics§

CHARS
The characters used as displayable by peek_hex

Functions§

get_header_type
Gets the header type from the MPQ file
parse
Parses the whole input into an MPQ
peek_hex
A helper function that shows only up to the first 8 bytes of an u8 slice in xxd format.
read_file
Convenience function to read a file to parse, mostly for testing.
read_headers
Reads the file headers, headers must contain the Archive File Header but they may optionally contain the User Data Headers.