Crates.io | chariot_drs |
lib.rs | chariot_drs |
version | 0.1.2 |
source | src |
created_at | 2017-04-30 18:44:39.583541 |
updated_at | 2017-05-28 22:24:18.621461 |
description | A library for reading/writing Age of Empires (1997) DRS files |
homepage | |
repository | https://github.com/ChariotEngine/Drs |
max_upload_size | |
id | 12573 |
size | 22,877 |
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.
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
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);
}
}