#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

#528 in Encoding

Download history 87/week @ 2024-09-25 2/week @ 2024-10-02 1/week @ 2024-10-09 4/week @ 2024-10-16 508/week @ 2024-10-23 205/week @ 2024-10-30 32/week @ 2024-11-06 18/week @ 2024-11-13 22/week @ 2024-11-20 21/week @ 2024-11-27 21/week @ 2024-12-04 30/week @ 2024-12-11 25/week @ 2024-12-18 249/week @ 2024-12-25 19/week @ 2025-01-01 24/week @ 2025-01-08

324 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