Struct nom_mpq::builder::MPQBuilder
source · pub struct MPQBuilder {
pub archive_header: Option<MPQFileHeader>,
pub user_data: Option<MPQUserData>,
pub hash_table_entries: Vec<MPQHashTableEntry>,
pub block_table_entries: Vec<MPQBlockTableEntry>,
pub encryption_table: HashMap<u32, u32>,
}
Expand description
A builder for the MPQ parsing, allowing for building the archive progressively
Fields§
§archive_header: Option<MPQFileHeader>
Mandatory field, all MPQ Archives must have an archive header.
user_data: Option<MPQUserData>
Optional field, not all MPQ Archives have user_data. The user_data contains in the case of Starcrat 2 Replay file, the build information of the version of the game under whcich is played. Different game versions would become different protocols/details, maybe even units?
hash_table_entries: Vec<MPQHashTableEntry>
The MPQ Hash Table Entries content.
block_table_entries: Vec<MPQBlockTableEntry>
The MPQ Block Table Entries content
encryption_table: HashMap<u32, u32>
An encryption table to lookup, this is shared with the crate::MPQ
object itself.
Implementations§
source§impl MPQBuilder
impl MPQBuilder
sourcepub fn with_archive_header(self, archive_header: MPQFileHeader) -> Self
pub fn with_archive_header(self, archive_header: MPQFileHeader) -> Self
Sets the archive header field
sourcepub fn with_user_data(self, user_data: Option<MPQUserData>) -> Self
pub fn with_user_data(self, user_data: Option<MPQUserData>) -> Self
Sets the user data field
sourcepub fn with_hash_table(self, entries: Vec<MPQHashTableEntry>) -> Self
pub fn with_hash_table(self, entries: Vec<MPQHashTableEntry>) -> Self
Sets the hash table entries
sourcepub fn with_block_table(self, entries: Vec<MPQBlockTableEntry>) -> Self
pub fn with_block_table(self, entries: Vec<MPQBlockTableEntry>) -> Self
Sets the block table entries
sourcepub fn mpq_string_hash(&self, location: &str, hash_type: MPQHashType) -> u32
pub fn mpq_string_hash(&self, location: &str, hash_type: MPQHashType) -> u32
Performs mpq string hashing using the encryption table.