lf2_parse

Crates.iolf2_parse
lib.rslf2_parse
version0.1.0
sourcesrc
created_at2020-09-25 05:15:56.35621
updated_at2020-09-25 05:15:56.35621
descriptionParses Little Fighter 2 (LF2) data files
homepagehttps://github.com/azriel91/lf2_parse
repositoryhttps://github.com/azriel91/lf2_parse
max_upload_size
id292740
size415,107
Azriel Hoh (azriel91)

documentation

https://docs.rs/lf2_parse

README

docs crates.io

LF2 Parse

Parses Little Fighter 2 (LF2) data files into an in-memory model.

Usage

Examples

cargo run --example simple

cargo run --example demo -- \
  examples/frozen.txt \
  examples/frozen.dat

Library

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(())
}

License

Licensed the Zlib license.

Contribution

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.

Commit count: 57

cargo fmt