3 releases (breaking)
Uses old Rust 2015
0.3.0 | Sep 26, 2017 |
---|---|
0.2.0 | Sep 25, 2017 |
0.1.0 | Sep 25, 2017 |
#6 in #half-life
23 downloads per month
56KB
1K
SLoC
hldemo-rs
A parser for Goldsource demo files (this includes Half-Life and its mods) written in Rust using nom.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
lib.rs
:
A parser for Goldsource demo files (this includes Half-Life and its mods) written in Rust using nom.
Supports parsing demos completely as well as just header and directory when the frame data isn't needed. Exports both raw nom parsing functions and wrappers which hide all nom-related types and provide convenient errors.
Examples
Check the examples
folder for more complete program examples which output various data from
demos.
#
extern crate hldemo;
use std::fs::File;
use std::io::Read;
let mut bytes = Vec::new();
let mut f = File::open("demo.dem")?;
f.read_to_end(&mut bytes);
let demo = hldemo::Demo::parse(&bytes)?;
#
#
Dependencies
~4.5MB
~92K SLoC