NdsForge.NET 1.0.1
Read, validate, edit, compare, and build Nintendo DS and DSi images from .NET
Loading...
Searching...
No Matches
NdsForge.NdsImageManifest Class Referencesealed

Provides a stable, content-addressed description of one parsed image for CI artifacts, review, and semantic comparison. The manifest contains no ROM payload bytes and cannot reconstruct copyrighted or private content. More...

Public Member Functions

string ToJson (bool indented=true)
 Serializes this contract with enum names and deterministic property order suitable for source review.
async ValueTask WriteJsonAsync (Stream destination, bool indented=true, CancellationToken cancellationToken=default)
 Writes one UTF-8 JSON document at the destination's current position without closing the stream.

Static Public Member Functions

static ValueTask< NdsImageManifestCaptureAsync (NdsImage image, CancellationToken cancellationToken=default)
 Captures hashes and structured metadata from a live image without taking ownership of it.
static NdsImageManifest ParseJson (string json)
 Parses a complete JSON contract and rejects unknown schema versions or incomplete required identity.
static async ValueTask< NdsImageManifestReadJsonAsync (Stream source, CancellationToken cancellationToken=default)
 Reads one UTF-8 JSON document without closing the caller-owned source stream.

Static Public Attributes

const int CurrentSchemaVersion = 1
 Identifies the currently supported JSON contract and prevents silent interpretation of future shapes.

Properties

int SchemaVersion = CurrentSchemaVersion [get]
 Records the contract version required to interpret every other field.
long PhysicalLength [get]
 Records physical source bytes independently from header claims and nominal cartridge capacity.
string ImageSha256 = string.Empty [get]
 Hashes every physical image byte so padding-only changes remain detectable.
NdsManifestHeader Header = new() [get]
 Contains common typed header values plus a hash covering reserved header bytes.
NdsManifestDsiDsi [get]
 Contains extended DSi metadata, or remains absent for an original DS image.
IReadOnlyList< NdsManifestProgramPrograms = [] [get]
 Contains executable snapshots in processor enumeration order.
IReadOnlyList< string > Directories = [] [get]
 Contains every NitroFS directory path, including the root and explicitly empty nodes.
IReadOnlyList< NdsManifestFileFiles = [] [get]
 Contains every named NitroFS entry in canonical ordinal path order.
IReadOnlyList< NdsManifestAllocationAllocations = [] [get]
 Contains every FAT record in numeric File ID order, including unnamed allocations.
IReadOnlyList< NdsManifestOverlayOverlays = [] [get]
 Contains ARM9 then ARM7 Overlay records ordered by runtime Overlay ID.
NdsManifestBannerBanner [get]
 Contains native menu metadata, or remains absent when the image declares no supported banner.

Detailed Description

Provides a stable, content-addressed description of one parsed image for CI artifacts, review, and semantic comparison. The manifest contains no ROM payload bytes and cannot reconstruct copyrighted or private content.

Definition at line 10 of file NdsImageManifest.cs.

Member Function Documentation

◆ CaptureAsync()

ValueTask< NdsImageManifest > NdsForge.NdsImageManifest.CaptureAsync ( NdsImage image,
CancellationToken cancellationToken = default )
inlinestatic

Captures hashes and structured metadata from a live image without taking ownership of it.

Parameters
imageParsed image that must remain undisposed until asynchronous hashing completes.
cancellationTokenCancels between or during region hashes.
Returns
A detached manifest safe to serialize after the image is disposed.

Definition at line 44 of file NdsImageManifest.cs.

◆ ParseJson()

NdsImageManifest NdsForge.NdsImageManifest.ParseJson ( string json)
inlinestatic

Parses a complete JSON contract and rejects unknown schema versions or incomplete required identity.

Parameters
jsonManifest JSON produced by this schema or an equivalent serializer.
Returns
A validated detached manifest.

Definition at line 61 of file NdsImageManifest.cs.

◆ ReadJsonAsync()

async ValueTask< NdsImageManifest > NdsForge.NdsImageManifest.ReadJsonAsync ( Stream source,
CancellationToken cancellationToken = default )
inlinestatic

Reads one UTF-8 JSON document without closing the caller-owned source stream.

Parameters
sourceReadable stream positioned at the manifest document.
cancellationTokenCancels parsing before a validated contract is returned.
Returns
A validated detached manifest.

Definition at line 98 of file NdsImageManifest.cs.

◆ ToJson()

string NdsForge.NdsImageManifest.ToJson ( bool indented = true)
inline

Serializes this contract with enum names and deterministic property order suitable for source review.

Parameters
indentedWhether human-facing whitespace is included.
Returns
UTF-16 managed text containing UTF-8-compatible JSON characters.

Definition at line 52 of file NdsImageManifest.cs.

◆ WriteJsonAsync()

async ValueTask NdsForge.NdsImageManifest.WriteJsonAsync ( Stream destination,
bool indented = true,
CancellationToken cancellationToken = default )
inline

Writes one UTF-8 JSON document at the destination's current position without closing the stream.

Parameters
destinationWritable caller-owned stream.
indentedWhether human-facing whitespace is included.
cancellationTokenCancels JSON serialization and stream output.
Returns
A task-like value that completes after the full JSON document has been written.

Definition at line 75 of file NdsImageManifest.cs.

Member Data Documentation

◆ CurrentSchemaVersion

const int NdsForge.NdsImageManifest.CurrentSchemaVersion = 1
static

Identifies the currently supported JSON contract and prevents silent interpretation of future shapes.

Definition at line 13 of file NdsImageManifest.cs.

Property Documentation

◆ Allocations

IReadOnlyList<NdsManifestAllocation> NdsForge.NdsImageManifest.Allocations = []
get

Contains every FAT record in numeric File ID order, including unnamed allocations.

Definition at line 34 of file NdsImageManifest.cs.

◆ Banner

NdsManifestBanner? NdsForge.NdsImageManifest.Banner
get

Contains native menu metadata, or remains absent when the image declares no supported banner.

Definition at line 38 of file NdsImageManifest.cs.

◆ Directories

IReadOnlyList<string> NdsForge.NdsImageManifest.Directories = []
get

Contains every NitroFS directory path, including the root and explicitly empty nodes.

Definition at line 30 of file NdsImageManifest.cs.

◆ Dsi

NdsManifestDsi? NdsForge.NdsImageManifest.Dsi
get

Contains extended DSi metadata, or remains absent for an original DS image.

Definition at line 26 of file NdsImageManifest.cs.

◆ Files

IReadOnlyList<NdsManifestFile> NdsForge.NdsImageManifest.Files = []
get

Contains every named NitroFS entry in canonical ordinal path order.

Definition at line 32 of file NdsImageManifest.cs.

◆ Header

NdsManifestHeader NdsForge.NdsImageManifest.Header = new()
get

Contains common typed header values plus a hash covering reserved header bytes.

Definition at line 24 of file NdsImageManifest.cs.

◆ ImageSha256

string NdsForge.NdsImageManifest.ImageSha256 = string.Empty
get

Hashes every physical image byte so padding-only changes remain detectable.

Definition at line 22 of file NdsImageManifest.cs.

◆ Overlays

IReadOnlyList<NdsManifestOverlay> NdsForge.NdsImageManifest.Overlays = []
get

Contains ARM9 then ARM7 Overlay records ordered by runtime Overlay ID.

Definition at line 36 of file NdsImageManifest.cs.

◆ PhysicalLength

long NdsForge.NdsImageManifest.PhysicalLength
get

Records physical source bytes independently from header claims and nominal cartridge capacity.

Definition at line 20 of file NdsImageManifest.cs.

◆ Programs

IReadOnlyList<NdsManifestProgram> NdsForge.NdsImageManifest.Programs = []
get

Contains executable snapshots in processor enumeration order.

Definition at line 28 of file NdsImageManifest.cs.

◆ SchemaVersion

int NdsForge.NdsImageManifest.SchemaVersion = CurrentSchemaVersion
get

Records the contract version required to interpret every other field.

Definition at line 18 of file NdsImageManifest.cs.


The documentation for this class was generated from the following file: