Class ChdResult

Namespace
CHDSharp.Models
Assembly
CHDSharpLib.dll

Result of a CHD verification or validation operation, consolidating error code, version, and hashes.

public sealed record ChdResult : IEquatable<ChdResult>
Inheritance
ChdResult
Implements
Inherited Members

Constructors

ChdResult(ChdError, uint?, byte[]?, byte[]?)

Creates a new ChdResult with the given error, version, SHA1, and MD5 values.

public ChdResult(ChdError error, uint? version, byte[]? sha1, byte[]? md5)

Parameters

error ChdError
version uint?
sha1 byte[]
md5 byte[]

Properties

Error

The error code indicating success or failure of the operation.

public ChdError Error { get; }

Property Value

ChdError

IsSuccess

true if the operation completed successfully (Error is Chderrnone).

public bool IsSuccess { get; }

Property Value

bool

Md5

The MD5 hash from the header, or null if not available.

public byte[]? Md5 { get; }

Property Value

byte[]

Md5Hex

MD5 hash formatted as a lowercase hex string, or "(none)" if not available.

public string Md5Hex { get; }

Property Value

string

Sha1

The SHA1 hash from the header, or null if not available.

public byte[]? Sha1 { get; }

Property Value

byte[]

Sha1Hex

SHA1 hash formatted as a lowercase hex string, or "(none)" if not available.

public string Sha1Hex { get; }

Property Value

string

Version

The CHD format version (1-5), or null if the file was invalid.

public uint? Version { get; }

Property Value

uint?

Methods

Deconstruct(out ChdError, out uint?, out byte[]?, out byte[]?)

Deconstructs the result into error, version, SHA1, and MD5 components for pattern matching.

public void Deconstruct(out ChdError error, out uint? version, out byte[]? sha1, out byte[]? md5)

Parameters

error ChdError
version uint?
sha1 byte[]
md5 byte[]