AnkiIO 1.0.2
Build, validate, import, and export Anki-compatible decks from .NET
Loading...
Searching...
No Matches
AnkiMediaFile.cs
1namespace AnkiIO;
2
22public sealed class AnkiMediaFile
23{
24 private readonly Func<CancellationToken, ValueTask<Stream>> openRead;
25
26 internal AnkiMediaFile(string fileName, long length, string sha256, Func<CancellationToken, ValueTask<Stream>> openRead)
27 {
28 FileName = fileName;
29 Length = length;
30 Sha256 = sha256;
31 this.openRead = openRead;
32 }
33
36 public string FileName { get; }
37
40 public long Length { get; }
41
44 public string Sha256 { get; }
45
60 public ValueTask<Stream> OpenReadAsync(CancellationToken cancellationToken = default) => openRead(cancellationToken);
61}
string Sha256
Gets the registration-time SHA-256 digest.
long Length
Gets the payload size observed during registration.
ValueTask< Stream > OpenReadAsync(CancellationToken cancellationToken=default)
Opens a new readable stream positioned at the beginning of the registered payload.
string FileName
Gets the safe collection-relative filename referenced by note HTML or sound markup.