Contains the supported deck graphs, media, and diagnostics read from one Anki package. More...
Properties | |
| IReadOnlyList< AnkiDeck > | Decks [get] |
| Gets a fixed collection of the package's top-level deck hierarchies. | |
| AnkiMediaCollection | Media [get] |
| Gets the media payloads eagerly extracted from the archive. | |
| IReadOnlyList< AnkiDiagnostic > | Diagnostics [get] |
| Gets the ordered compatibility and preservation findings produced while reading. | |
| IEnumerable< AnkiNote > | Notes [get] |
| Enumerates all notes reachable from every top-level hierarchy. | |
| IEnumerable< AnkiCard > | Cards [get] |
| Enumerates all cards reachable through Notes. | |
Contains the supported deck graphs, media, and diagnostics read from one Anki package.
An AnkiPackage is an in-memory result, not an open archive. The reader closes or releases all temporary database resources before returning it, so the package does not implement IDisposable and remains usable after the source file or stream is closed.
Use the package writer overloads when modifying a package that was read from disk. They write every top-level deck and retain Media. Writing only package.Decks[0] intentionally writes one hierarchy and omits media held only by the package. The deck graphs and media collection remain mutable and are not safe for concurrent mutation.
Media extraction is eager: payloads are copied into memory while reading. Peak and retained memory can therefore grow with the allowed archive size. Apply appropriately small AnkiPackageLimits when inputs are untrusted.
Read, modify, and write a package without dropping its package-level media:
Definition at line 28 of file AnkiPackage.cs.
|
get |
Enumerates all cards reachable through Notes.
A lazy enumeration that reflects later note and card mutations.
Do not mutate notes or card collections while this enumeration is in progress.
Definition at line 70 of file AnkiPackage.cs.
|
get |
Gets a fixed collection of the package's top-level deck hierarchies.
A read-only snapshot of root references in package order. The collection cannot be resized or replaced, but each referenced AnkiDeck remains mutable.
A package may contain more than one root. Traverse each root to reach nested decks. The writer overloads accepting this package preserve all roots; deck overloads write only the supplied root.
Definition at line 46 of file AnkiPackage.cs.
|
get |
Gets the ordered compatibility and preservation findings produced while reading.
A read-only snapshot. Diagnostics describe non-fatal adapter choices and data that could not be preserved.
Branch on AnkiDiagnostic.Code or severity; human-readable messages may evolve.
Definition at line 60 of file AnkiPackage.cs.
|
get |
Gets the media payloads eagerly extracted from the archive.
A mutable collection backed by caller-independent in-memory copies of the extracted payloads.
This collection is separate from every AnkiDeck.Media collection. Package writer overloads combine both locations, coalesce identical filenames and hashes, and reject conflicting same-name content. Removing an item here before writing intentionally omits it unless a deck registers the same filename.
Definition at line 55 of file AnkiPackage.cs.
|
get |
Enumerates all notes reachable from every top-level hierarchy.
A lazy depth-first enumeration that reflects later mutations to the deck graphs.
Do not mutate a deck or its note collection while this enumeration is in progress.
Definition at line 65 of file AnkiPackage.cs.