unshield/
lib.rs

1//! Extract files from InstallShield Z archives.
2//!
3//! This crate can open and extract files from [InstallShield Z
4//! archives][z]. This archive format is used by version 3 of
5//! InstallShield.
6//!
7//!  [z]: http://fileformats.archiveteam.org/wiki/InstallShield_Z
8//!
9//! # Command Line
10//!
11//! This crate comes with a simple command line tool for extracting
12//! and inspecting Z archives.
13//!
14//! ```bash
15//! unshield list src/examples/demo.z
16//! unshield extract src/examples/demo.z demo-out
17//! ```
18//! # Examples
19//!
20//! Anything that implements [`Read`][Read] and [`Seek`][Seek] can be
21//! read as an archive. Most commonly, this will be a [`File`][File].
22//!
23//!  [Read]: https://doc.rust-lang.org/std/io/trait.Read.html
24//!  [Seek]: https://doc.rust-lang.org/std/io/trait.Seek.html
25//!  [File]: https://doc.rust-lang.org/std/io/struct.File.html
26//!
27//! ```
28//! # fn main() -> explode::Result<()> {
29//! let mut some_file = std::fs::File::open("src/examples/demo.z")?;
30//! let mut ar = unshield::Archive::new(some_file)?;
31//!
32//! let data = ar.load("subdir\\test.txt")?;
33//!
34//! for fileinfo in ar.list() {
35//!     println!("{}", fileinfo.path);
36//! }
37//! # assert_eq!(data, b"fnord");
38//! # Ok(()) }
39//! ```
40
41// we want feature tags in documentation on docsrs
42#![cfg_attr(docsrs, feature(doc_cfg))]
43
44mod archive;
45mod examples;
46mod format;
47
48pub use archive::Archive;
49pub use format::FileInfo;
50
51#[cfg(feature = "async")]
52mod asyncarchive;
53#[cfg(feature = "async")]
54pub use asyncarchive::AsyncArchive;