Function rstb::calc::calculate_size_with_ext[][src]

pub fn calculate_size_with_ext(
    data: &[u8],
    ext: &str,
    endian: Endian,
    guess: bool
) -> Option<u32>
Expand description

Attempts to calculate the resource size for a file given its contents and file extension, optionally applying a statistical estimate for some complex resource types. Note that the endian parameter should be specified as Big for Wii U and Little for Switch even if the file type itself always uses the same endianness (e.g. AAMP files are always little endian).

Returns None if no value can be calculated. This function always returns None for BFRES files. Use guess_bfres_size() to handle BFRES files.