Crates.io | esl |
lib.rs | esl |
version | |
source | src |
created_at | 2020-03-01 12:00:05.823733 |
updated_at | 2024-10-29 17:11:13.448966 |
description | A library for reading, writing and processing ESM/ESP/ESS files. |
homepage | |
repository | https://github.com/A1-Triard/esl |
max_upload_size | |
id | 214157 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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();
}
}