Skip to content
/ esl Public

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

Notifications You must be signed in to change notification settings

A1-Triard/esl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();
    }
}

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages