Crates.io | clauser |
lib.rs | clauser |
version | 0.1.0 |
source | src |
created_at | 2024-06-25 02:09:02.525096 |
updated_at | 2024-06-25 02:09:02.525096 |
description | Library for parsing and deserializing Clausewitz files. |
homepage | |
repository | https://github.com/azrogers/clauser |
max_upload_size | |
id | 1282904 |
size | 122,602 |
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.
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));