Skip to main content

s2mod_packer/
lib.rs

1// s2mod-packer – pack/unpack .s2mod Content Pack archives for OpenStranded
2// Copyright (C) 2025  s2mod-packer contributors
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program.  If not, see <https://www.gnu.org/licenses/>.
16
17//! .s2mod archive packing / unpacking.
18//!
19//! .s2mod is a zip archive (or plain directory) containing converted
20//! assets and a manifest.toml.
21//!
22//! # Example (compile-only, requires real paths at runtime)
23//!
24//! ```rust,ignore
25//! use s2mod_packer::{S2ModPackage, ContentPackManifest};
26//!
27//! // Pack a directory into a .s2mod zip archive
28//! S2ModPackage::pack_to_zip("my_mod_dir", "output.s2mod").unwrap();
29//!
30//! // Open an existing archive
31//! let pack = S2ModPackage::open("pack.s2mod").unwrap();
32//! println!("Pack: {}", pack.manifest().pack.name);
33//!
34//! // Unpack an archive
35//! S2ModPackage::unpack_to_dir("pack.s2mod", "output_dir").unwrap();
36//! ```
37
38pub mod cli;
39pub mod manifest;
40pub mod package;
41
42pub use manifest::*;
43pub use package::*;