#esp #esm #serde #ess #mw

nightly esl

A library for reading, writing and processing ESM/ESP/ESS files

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

#504 in Encoding

Download history 75/week @ 2024-09-19 54/week @ 2024-09-26 1/week @ 2024-10-03 1/week @ 2024-10-10 4/week @ 2024-10-17 582/week @ 2024-10-24 138/week @ 2024-10-31 27/week @ 2024-11-07 20/week @ 2024-11-14 22/week @ 2024-11-21 18/week @ 2024-11-28 24/week @ 2024-12-05 23/week @ 2024-12-12

91 downloads per month
Used in espa

MIT/Apache

460KB
11K SLoC

maintenance: actively developed

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
~98K SLoC