NdsForge.NET 1.0.1
Read, validate, edit, compare, and build Nintendo DS and DSi images from .NET
Loading...
Searching...
No Matches
NdsDirectoryImportOptions.cs
1namespace NdsForge;
2
4public sealed record NdsDirectoryImportOptions
5{
7 public static NdsDirectoryImportOptions Default => new();
8
11
13 public NdsHostLinkPolicy LinkPolicy { get; init; }
14
16 public int MaximumFiles { get; init; } = 65_536;
17
19 public long MaximumTotalBytes { get; init; } = 512L * 1024 * 1024;
20
22 internal void Validate()
23 {
24 if (!Enum.IsDefined(CollisionPolicy) || !Enum.IsDefined(LinkPolicy) ||
25 MaximumFiles <= 0 || MaximumTotalBytes < 0)
26 {
27 throw new ArgumentOutOfRangeException(nameof(MaximumFiles), "Directory import policies and resource bounds are invalid.");
28 }
29 }
30}
Bounds host-directory materialization and makes merge and link behavior explicit.
long MaximumTotalBytes
Limits the sum of host file lengths copied into memory for one transactional import.
NdsHostLinkPolicy LinkPolicy
Rejects host links by default because following them can escape the selected source tree.
int MaximumFiles
Limits staged payload count before any builder mutation occurs.
NdsFileCollisionPolicy CollisionPolicy
Controls duplicate file paths while never allowing file-versus-directory structural ambiguity.
static NdsDirectoryImportOptions Default
Returns a fresh conservative policy so one caller cannot mutate another import's defaults.
NdsHostLinkPolicy
Controls treatment of host reparse points and symbolic links during bounded directory ingestion.
NdsFileCollisionPolicy
Controls how a host-directory import handles a file path already present in the NitroFS recipe.