Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azriel91/lf2_parse
Parses Little Fighter 2 (LF2) data files into an in-memory model
https://github.com/azriel91/lf2_parse
Last synced: about 1 month ago
JSON representation
Parses Little Fighter 2 (LF2) data files into an in-memory model
- Host: GitHub
- URL: https://github.com/azriel91/lf2_parse
- Owner: azriel91
- License: zlib
- Created: 2020-08-02T11:27:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-25T05:16:49.000Z (over 4 years ago)
- Last Synced: 2024-11-16T04:50:52.930Z (about 1 month ago)
- Language: Rust
- Size: 177 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-ZLIB.md
Awesome Lists containing this project
README
[![docs](https://docs.rs/lf2_parse/badge.svg)](https://docs.rs/lf2_parse)
[![crates.io](https://img.shields.io/crates/v/lf2_parse.svg)](https://crates.io/crates/lf2_parse)# LF2 Parse
Parses Little Fighter 2 (LF2) data files into an in-memory model.
## Usage
### Examples
```sh
cargo run --example simplecargo run --example demo -- \
examples/frozen.txt \
examples/frozen.dat
```### Library
```rust
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](LICENSE-ZLIB.md).
### 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.