Struct infinite_rs::ModuleFile
source · pub struct ModuleFile {
pub header: ModuleHeader,
pub files: Vec<ModuleFileEntry>,
pub string_list: Vec<u8>,
pub resources: Vec<u32>,
pub blocks: Vec<ModuleBlockEntry>,
pub file_data_offset: u64,
/* private fields */
}Expand description
Module structure which contains the layout of the entire module file. Also stores file_path for re-use in read_tag.
Fields§
§header: ModuleHeaderInfo relating to how the other fields should be read.
files: Vec<ModuleFileEntry>Metadata regarding compression and layout of files (tags)
string_list: Vec<u8>String slice of file names seperated by a null terminator. Does not exist after module version 52.
resources: Vec<u32>Indices (?) of resource files present in module.
blocks: Vec<ModuleBlockEntry>Uncompressed/compressed blocks making up a file.
file_data_offset: u64Offset in BufReader where file data starts.
Implementations§
source§impl ModuleFile
impl ModuleFile
sourcepub fn read(&mut self, file_path: String) -> Result<()>
pub fn read(&mut self, file_path: String) -> Result<()>
Reads the module file from the given file path. This function reads the entire structure of the module file. It also calculates and stores important offsets within the file.
§Arguments
file_path- A string slice that holds the path to the module file
§Returns
Returns Ok(()) if the read operation is successful, or an Err containing
the I/O error if any reading operation fails/header checks fail.