Namespace CHDSharp

Classes

Chd

Provides static methods for validating, inspecting, and verifying CHD (Compressed Hunks of Data) files using parallel decompression. Supports CHD format versions 1-5 and all MAME codecs (zlib, LZMA, Huffman, FLAC, Zstd, AVHuff and the CD variants).

ChdErrorExtensions

Provides extension methods for ChdError values.

ChdFile

Provides read-only random access to a CHD (Compressed Hunks of Data) file, supporting format versions 1-5 and parent/child differential CHD chains.

ChdHeaders

Parses and validates CHD V1-V5 file headers, reading compression configuration, block maps, checksums, and metadata pointers from the stream.

ChdImageStream

A read-only, seekable Stream that wraps a ChdFile, providing sequential or random access to the decompressed image as a flat byte stream.

ChdReaders

Contains all CHD decompression codec implementations as reader delegates: zlib, LZMA, Huffman, FLAC, Zstd, and their CD-sector variants.

CueConverter

Converts CUE sheets between the three common styles — chdman, Redump, and Redump+CATALOG — and matches generated CUE text against a database hash (CHDlite convert_cue_style / match_cue parity, chd_extractor.cpp:497-670). Style differences are limited to the single-track file name suffix (" (Track 1)" in chdman output) and the CATALOG line.

DiscDetector

Detects the game platform of a disc image by probing sector-0 magic bytes, the ISO-9660 filesystem (PS1/PS2 SYSTEM.CNF, PSP PARAM.SFO, Neo Geo IPL.TXT, DVD Video), and the PC Engine IPL header heuristic (CHDlite detect_game_platform parity, detect_game_platform.cpp:51-318). Sector access is abstracted so both CHD files and raw/disc images can be probed.

Delegates

ChdReader

Delegate for decompressing a single CHD hunk: reads compressed data from buffIn and writes decompressed output to buffOut.

DiscDetector.SectorReader

Reads one cooked 2048-byte sector by LBA; returns null on failure.

ParentResolver

Callback delegate for lazy parent CHD resolution. Called when a child CHD needs to read a parent-referenced hunk but no parent was explicitly provided at open time.