3 个不稳定版本
0.2.1 | 2020年5月18日 |
---|---|
0.2.0 | 2019年8月4日 |
0.1.1 | 2019年4月9日 |
#1972 in 解析器实现
每月下载 43 次
用于 genie
30KB
623 行
genie-drs
.drs 是 Genie 引擎的资源归档文件格式,由 Age of Empires 1/2 和 Star Wars: Galactic Battlegrounds 使用。.drs 文件包含表,每个表包含单一类型的资源。资源通过数字标识符识别。
此包目前仅支持读取文件。
安装
添加到 Cargo.toml
[dependencies]
genie-drs = "^0.1.1"
示例
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)?);
}
}
愿望清单
许可证
依赖项
~0.5–1MB
~22K SLoC