Crates.io | lf2_parse |
lib.rs | lf2_parse |
version | 0.1.0 |
source | src |
created_at | 2020-09-25 05:15:56.35621 |
updated_at | 2020-09-25 05:15:56.35621 |
description | Parses Little Fighter 2 (LF2) data files |
homepage | https://github.com/azriel91/lf2_parse |
repository | https://github.com/azriel91/lf2_parse |
max_upload_size | |
id | 292740 |
size | 415,107 |
Parses Little Fighter 2 (LF2) data files into an in-memory model.
cargo run --example simple
cargo run --example demo -- \
examples/frozen.txt \
examples/frozen.dat
use std::{convert::TryFrom, env, iter::FromIterator, path::PathBuf};
use lf2_parse::{Error, ObjectData};
fn main() -> Result<(), Error<'static>> {
let path = PathBuf::from_iter(&[env!("CARGO_MANIFEST_DIR"), "examples", "frozen.dat"]);
let contents = ObjectData::open(&path)?;
match ObjectData::try_from(contents.as_ref()) {
Ok(object_data) => println!("{:?}", object_data),
Err(e) => eprintln!("{}", e),
}
Ok(())
}
Licensed the Zlib license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.