Skip to content

Types for loading and writing ICE archives.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

HybridEidolon/rust-ages-ice-archive

Repository files navigation

ages-ice-archive: ICE archive library for Rust

CI Crate API

Types for loading and writing ICE archives.

ICE is an asset storage format used by SEGA's Phantasy Star Online 2, named after its magic prefix in its header.

This crate should work out-of-the-box on WebAssembly.

You may also install this crate via cargo install to get CLI utilities for unpacking and packing ICE files from the filesystem. These are examples within this package's repository, named agesdeice and agesice respectively.

Usage

Add to your Cargo.toml:

[dependencies]
ages-ice-archive = "0.1"

Within your code:

use std::fs::File;
use std::error::Error;

use ages_ice_archive::{Group, IceArchive};

fn main() -> Result<(), Box<dyn Error>> {
    let file = File::open("my.ice")?;
    let mut archive = IceArchive::new(file)?;

    archive.unpack_group(Group::Group1)?;
    println!("Files in Group 1:");
    for f in archive.iter_group(Group::Group1).unwrap() {
        if let Ok(name) = f.name() {
            println!("\t{} ({} bytes)", name, f.data().len());
        } else {
            println!("\t(non-ascii file name)");
        }
    }

    archive.unpack_group(Group::Group2)?;
    println!("Files in Group 2:");
    for f in archive.iter_group(Group::Group2).unwrap() {
        if let Ok(name) = f.name() {
            println!("\t{} ({} bytes)", name, f.data().len());
        } else {
            println!("\t(non-ascii file name) ({} bytes)", f.data().len());
        }
    }

    Ok(())
}

License

ages-ice-archive is dual-licensed for compatibility with the rest of the Rust public ecosystem.

ages-ice-archive is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

About

Types for loading and writing ICE archives.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published