Crates.io | mpq |
lib.rs | mpq |
version | 0.8.1 |
source | src |
created_at | 2016-09-07 14:03:59.257564 |
updated_at | 2024-08-14 14:28:19.783383 |
description | A library for reading MPQ archives |
homepage | |
repository | https://github.com/msierks/mpq-rust |
max_upload_size | |
id | 6273 |
size | 50,232 |
A library for reading MPQ archives.
# Cargo.toml
[dependencies]
mpq = "0.8"
extern crate mpq;
use std::str;
use mpq::Archive;
fn main() {
let mut a = Archive::open("common.MPQ").unwrap();
let file = a.open_file("(listfile)").unwrap();
let mut buf: Vec<u8> = vec![0; file.size(&a) as usize];
file.read(&mut a, &mut buf).unwrap();
print!("{}", str::from_utf8(&buf).unwrap());
}
git clone https://github.com/msierks/mpq-rust.git && cd mpq-rust && cargo build --release
print '(listfile)' contents:
target/release/mpq -l common.MPQ
extract file:
target/release/mpq -x "(listfile)" common.MPQ
More help:
target/release/mpq -h
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.