1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//! `opticaldiscs` — format-agnostic optical disc image reading and browsing.
//!
//! # Overview
//!
//! This library provides a unified `SectorReader` abstraction that handles the
//! cooked/raw sector translation across three container formats:
//!
//! - **ISO** (`.iso`, `.toast`) — plain 2048-byte cooked sectors
//! - **BIN/CUE** — raw 2352-byte sectors with per-track header stripping
//! - **CHD** — MAME Compressed Hunks of Data, optical variant
//!
//! On top of `SectorReader`, filesystem browsers are provided for:
//! - ISO 9660 (data CDs and DVDs)
//! - HFS (classic Mac CDs)
//! - HFS+ (Mac OS X CDs/DVDs)
//! - SGI EFS (IRIX install/distribution CDs, via SGI Volume Header)
//!
//! # Feature Flags
//!
//! - `toc` — enables `DiscTOC`, `TrackInfo`, MusicBrainz DiscID, and FreeDB ID
//! calculation (requires `sha1` and `base64`).
//! - `drives` — enables `list_drives()` for enumerating physical optical drives
//! on Linux, macOS, and Windows.
//!
//! # Quick Example
//!
//! ```ignore
//! use opticaldiscs::detect::DiscImageInfo;
//! use opticaldiscs::browse;
//!
//! let info = DiscImageInfo::open("disc.iso").unwrap();
//! println!("Volume: {:?}", info.volume_label);
//!
//! let mut fs = browse::open_disc_filesystem(&info).unwrap();
//! let root = fs.root().unwrap();
//! for entry in fs.list_directory(&root).unwrap() {
//! println!("{} ({})", entry.name, entry.size_string());
//! }
//! ```
// ── Modules (implemented progressively per PLAN.md) ──────────────────────────
// Phase 1
// Phase 2-4
// Phase 5
// Phase 6
// El Torito boot-catalog parsing (bootable CDs)
// El Torito boot-catalog editing (write path, raw .iso only)
// Game-disc identification (see docs/GameDiscs_Implementation.md)
// Dreamcast GD-ROM .gdi container
// Compressed container formats: PSP CSO and gzip-compressed images
// CloneCD (.ccd/.img/.sub) container
// Alcohol 120% (.mds/.mdf) container
// Nero (.nrg) container
// DiscJuggler (.cdi) container
// DAEMON Tools (.mdx) container — optional (pulls in a crypto stack)
// Phase 7 (HFS metadata — not browsing, see browse/)
// SGI Volume Header (IRIX install/distribution CDs — see docs/EFS_Implementation.md)
// EFS filesystem on-disk structures.
// Phase 9
// ── Top-level re-exports ──────────────────────────────────────────────────────
// Phase 1
pub use ;
pub use ;
pub use OpticaldiscsError;
pub use ;
// ISO 9660 metadata types
pub use ;
// El Torito boot-catalog types
pub use ;
// El Torito editing (write path)
pub use ;
// Phase 2
pub use SectorReader;
// Phase 3
pub use BinCueSectorReader;
// Phase 4
pub use ChdSectorReader;
// Dreamcast GD-ROM high-density reader (see gdi module for the .gdi container).
pub use ;
// Game-disc identification
pub use ;
// Phase 8
pub use MasterDirectoryBlock;
pub use HfsPlusVolumeHeader;
// SGI
pub use ;
// Filesystem browsers. Most callers use `browse::open_disc_filesystem` and never
// name these directly, but they are re-exported here (and from `browse`) so a
// browser can be constructed from an existing `SectorReader` when needed.
pub use ;
// EFS on-disk structures.
pub use ;