rpgcpf 0.1.0

GCPF archive compression and decompression library
Documentation

rpgcpf

⚠️ this is alpha quality software! there may be some unknown bugs! ⚠️

rpgcpf is a rust library and command line tool for compressing and decompressing godot compressed packed format (GCPF) files.

This repository contains a rust library and a command line application.

features

  • compressing a file to the GCPF format
  • decompressing GCPF files
  • supports all five compression modes used by GCPF: brotli, deflate, fastlz, gzip, and zstd
  • rust library
  • command line tool

rpgcpf cli

The rpgcpf cli tool decompresses GCPF files, and compresses uncompressed files to the GCPF format.

Usage: rpgcpf <COMMAND>

Commands:
  pack    Compress an input to an output
  unpack  Decompress an input to an output
  info    Show info and statistics about an input
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

installation

for now rpgcpf is only available through cargo, but there are plans to package it for distribution when it's more stable.

cargo install rpgcpf --git https://git.sr.ht/~absolutely-vivid/rpgcpf

rpgcpf

rpgcpf is a rust library implementing GCPF compression in decompression. It supports the brotli, deflate, fastlz, gzip, and zstd compression modes.

TODO: add docs link

Decompression example:

use rpgcpf::Gcpf;

let data: &[u8] = /* ... */;
let mut uncompressed = Gcpf::read(data)
    .unwrap()
    .decompress()
    .unwrap()

Compression example:

use rpgcpf::{CompressionMode, Gcpf};

let data: &[u8] = /* ... */;
let mut compressed = Gcpf::compress(data, CompressionMode::Zstd).unwrap();

installation

rpgcpf isn't available on crates.io, but there are plans to make it available for distribution when it reaches a more stable release.

cargo add rpgcpf --git https://git.sr.ht/~absolutely-vivid/rpgcpf

cargo features

rpgcpf uses cargo features to enable or disable compression modes at compile time. these features are:

  • brotli: enables the brotli comression mode, depends on the brotli crate
  • deflate: enables the deflate comression mode, depends on the flate2 crate
  • fastlz: enables the fastlz comression mode, depends on the fastlz-rs crate
  • gzip: enables the gzip comression mode, depends on the flate2 crate
  • zstd: enables the zstd comression mode, depends on the zstd crate

the default features are: ["brotli", "deflate", "fastlz", "gzip", "zstd"]

contributing

TODO