Crate genie_drs

Source
Expand description

.drs is the resource archive file format for the Genie Engine, used by Age of Empires 1/2 and Star Wars: Galactic Battlegrounds. .drs files contain tables, each of which contain resources of a single type. Resources are identified by a numeric identifier.

§Example

use std::fs::File;
use genie_drs::DRSReader;

let mut file = File::open("test.drs")?;
let drs = DRSReader::new(&mut file)?;

for table in drs.tables() {
    for resource in table.resources() {
        let content = drs.read_resource(&mut file, table.resource_type, resource.id)?;
        println!("{}: {:?}", resource.id, std::str::from_utf8(&content)?);
    }
}

Structs§

DRSHeader
The DRS archive header.
DRSReader
A DRS archive reader.
DRSResource
A single resource in a DRS archive.
DRSTable
A table containing resource entries.
DRSWriter
Generator for .drs archives.
InMemoryStrategy
Create the entire DRS file in memory first, then flush it to the output.
ParseResourceTypeError
An error occurred while parsing a resource type.
ReserveDirectoryStrategy
Writer strategy that reserve space for metadata for the given amount of tables and files at the top of the file, then fills it in at the end.
ResourceType
A resource type name.

Traits§

WriteStrategy
Strategy to use when writing files to the archive.

Type Aliases§

DRSResourceIterator
An iterator over DRS resource metadata structs.
DRSTableIterator
An iterator over DRS table metadata structs.