Crate bfflib

Source
Expand description

githubcrates-iodocs-rs


§Examples

Open an archive file:

use std::{fs::File, io::BufReader};
use bfflib::{attribute, archive::Archive, Result};
 
fn example() -> Result<()> {
    // Open BFF file
    let file = File::open("file.bff")?;
    // Use BufReader for better performance
    let reader = BufReader::new(file);
    let mut archive = Archive::new(reader)?;
 
    // Print filenames of all records in the archive
    archive.records().iter()
        .for_each(|record| println!("{}", record.filename().display()));
 
    // Extract the whole archive
    archive.extract("output_dir")?;
 
    // Extract single file
    archive.extract_file_by_name("./path/file", "output_dir")?;
 
    Ok(())
}

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

archive
Reading an BFF archive
attribute
Attribute constants for file modes
bff
error
huffman
Decoding of compressed BFF record data
util