45 releases
0.19.3 | Oct 29, 2024 |
---|---|
0.18.1 | Oct 27, 2024 |
0.18.0 | Oct 6, 2023 |
0.17.1 | Dec 22, 2022 |
0.3.1 | Mar 26, 2020 |
#513 in Encoding
779 downloads per month
Used in espa
460KB
11K
SLoC
esl
A library for reading, writing and processing ESM/ESP/ESS files.
use esl::{CodePage, RecordSerde};
use esl::read::{RecordReadMode, Records};
use serde_serialize_seed::{ValueWithSeed, VecSerde};
use std::fs::File;
use std::io::{BufReader, BufWriter};
fn main() {
if let Ok(input) = File::open("Morrowind.esm") {
let mut input = BufReader::new(input);
let records = Records::new(CodePage::Russian, RecordReadMode::Strict, false, 0, &mut input);
let records = records.map(|x| {
match x {
Ok(mut x) => {
x.fit(false);
x
},
Err(e) => panic!("{}", e)
}
}).collect::<Vec<_>>();
let output = File::create("Morrowind.esm.yaml").unwrap();
serde_yaml::to_writer(
BufWriter::new(output),
&ValueWithSeed(&records[..], VecSerde(RecordSerde { code_page: None, omwsave: false }))
).unwrap();
}
}
Dependencies
~5.5MB
~99K SLoC