tw_pack_lib 0.1.21

A Total War series pack file library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use fs;
use std::fs::File;
use std::path::Path;

use tw_pack_lib;

#[test]
fn test_read_header() {
    fs::copy("tests/twa_boot.pack.bk", "tests/read_header_twa_boot.pack").unwrap();
    let f = File::open(Path::new("tests/read_header_twa_boot.pack")).expect("file not found");
    let pack = tw_pack_lib::parse_pack(f).unwrap();

    for item in pack.into_iter() {
        println!("{}", item);
        item.get_data().unwrap();
    }
}