#nom #demo #half-life #parser #goldsource

hldemo

A parser for Half-Life (Goldsource) demo files using nom

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

MIT/Apache

56KB
1K SLoC

hldemo-rs

crates.io Build Status Build Status Documentation and examples

A parser for Goldsource demo files (this includes Half-Life and its mods) written in Rust using nom.

License

Licensed under either of

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

~3–8.5MB
~82K SLoC