chariot_drs

Crates.iochariot_drs
lib.rschariot_drs
version0.1.2
sourcesrc
created_at2017-04-30 18:44:39.583541
updated_at2017-05-28 22:24:18.621461
descriptionA library for reading/writing Age of Empires (1997) DRS files
homepage
repositoryhttps://github.com/ChariotEngine/Drs
max_upload_size
id12573
size22,877
Taryn (Phrohdoh)

documentation

https://docs.rs/chariot_drs/

README

Chariot DRS Crate

This crate handles the DRS archive file format used by Age of Empires (1997). Currently, it can read DRS files, and includes an example that can be used to extract DRS archives.

While the ability to write a DRS file is a nice to have, it's not strictly necessary for the rest of the Chariot project, and thus, is not implemented at this time.

The code herein falls under the same license as the rest of the Chariot project.

Building

You'll need the Rust compiler and Cargo build system. Once you have those, you can compile with:

$ cargo build

To build the example program that can extract DRS archives, run:

$ cargo build --example extract-drs

Example

extern crate chariot_drs as drs;

let file_name = "/path/to/archive.drs";
match drs::DrsFile::read_from_file(file_name) {
    Ok(drs_file) => {
        println!("Successfully loaded the DRS file");
        println!("Table count: {}", drs_file.header.table_count);
        for table in &drs_file.tables {
            println!("Table \"{}\":", table.header.file_extension());
            println!("  file count: {}", table.header.file_count);
        }
    },
    Err(err) => {
        println!("Failed to read the DRS file: {}", err);
    }
}
Commit count: 4

cargo fmt