ironworks

Crates.ioironworks
lib.rsironworks
version0.4.1
sourcesrc
created_at2022-04-21 10:47:21.967535
updated_at2022-09-26 11:28:43.585486
descriptionModular FFXIV data toolkit written in rust.
homepage
repositoryhttps://github.com/ackwell/ironworks
max_upload_size
id571524
size106,020
Saxon Landers (ackwell)

documentation

README

ironworks

ironworks

Modular FFXIV data toolkit written in rust.

Crates.io docs.rs

ironworks is pre-1.0, and as such its API should be considered unstable. Breaking API changes will be published on new minor versions.


To minimise unused code & dependencies, ironworks is split into a number of discrete features. No features are enabled by default - pick the ones you want to use!

Feature Description
excel Read data from Excel databases.
ffxiv Bindings for using ironworks with FFXIV.
sqpack Navigate and extract files from the SqPack package format.

Additionally, file type readers are opt-in. The feature modules above will automatically enable the file types they need, however if you need additional file types for bespoke purposes, they can be enabled manually. File type features are named by the file's extension, i.e. exl for .exl files.

Getting started

[dependencies]
ironworks = {version = "0.4.1", features = ["excel", "ffxiv", "sqpack"]}
use ironworks::{excel::Excel, ffxiv, file::exl, sqpack::SqPack, Error, Ironworks};

fn main() -> Result<(), Error> {
  // Build the core ironworks instance. Additional resources can be registered
  // for more complicated file layouts.
  let ironworks = Ironworks::new()
    .with_resource(SqPack::new(ffxiv::FsResource::search().unwrap()));

  // Read out files as raw bytes or structured data.
  let bytes = ironworks.file::<Vec<u8>>("exd/root.exl")?;
  let list = ironworks.file::<exl::ExcelList>("exd/root.exl")?;

  // Read fields out of excel.
  let excel = Excel::with()
    .language(ffxiv::Language::English)
    .build(&ironworks, ffxiv::Mapper::new());
  let field = excel.sheet("Item")?.row(37362)?.field(0)?;

  Ok(())
}

Using generated sheets from Excel

In addition to reading individual fields as shown above, it's possible to read entire rows at a time into a struct. To faciliate this, generated sheet definitions are available as a git dependency.

Warning: The data used to generate these structs does not provide any stability guarantees whatsoever. As such, any update to sheet structs should be considered as a semver-major update.

[dependencies]
# ...
ironworks_sheets = {git = "https://github.com/ackwell/ironworks", branch = "sheets/saint-coinach"}
// ...
use ironworks_sheets::{for_type, sheet};

fn main() -> Result<(), Error> {
  // ...
  let field = excel.sheet(for_type::<sheet::Item>())?.row(37362)?.singular;
  // ...
}
Commit count: 898

cargo fmt