clauser 0.1.0

Library for parsing and deserializing Clausewitz files.
Documentation

clauser

crates.io badge docs.rs badge

clauser is a library for working with configuration, script, and data files from the Clausewitz engine used by Paradox Interactive for their grand strategy games.

It currently implements a Tokenizer, a low-level Reader, a serde-based Deserializer, and an copying Value deserializer for situations where serde won't work. For more information, read the documentation.

Examples

Using serde:

use serde::Deserialize;

#[derive(Deserialize)]
struct TestObject {
  a: i32,
  b: String,
  c: Date
}

let obj = clauser::de::from_str::<TestObject>(
  "a = 1 b = test c = 1940.1.1"
);
assert!(obj.a == 1);
assert!(obj.b == "test");
assert!(obj.c == Date::new(1940, 1, 1, 0));