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,
) -> Result<u32, MPQParserError>
pub fn mpq_string_hash( &self, location: &str, hash_type: MPQHashType, ) -> Result<u32, MPQParserError>
Performs mpq string hashing using the encryption table.
Trait Implementations§
Source§impl Debug for MPQBuilder
impl Debug for MPQBuilder
Auto Trait Implementations§
impl Freeze for MPQBuilder
impl RefUnwindSafe for MPQBuilder
impl Send for MPQBuilder
impl Sync for MPQBuilder
impl Unpin for MPQBuilder
impl UnwindSafe for MPQBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more