IFileSource interface
public interface IFileSource A read-only tree of files addressed by VirtualPath. Every folder, archive, disc image and whole mount the engine reads is one, and it’s what game adapters probe and containers return.
Paths are relative to the source’s root, with forward slashes and no leading slash. VirtualPath.Root is the root itself, and VirtualPath refuses .. and drive letters, so a path can’t leave its tree. Sources stack: a mount is a LayeredSource over its layers, a SubtreeSource shows one folder of another source as its root, and a PlacedSource puts a source at a folder. The engine has FolderSource for host folders and MemorySource for files held in memory, and IndexedSource is a base for archive readers.
An implementation needs Location, CaseRule, Exists, TryOpen and Enumerate. The rest have default bodies built on those, so override them when your format can answer faster. Extension methods add EnumerateAll, and Open, OpenAccess, ReadAllBytes and ReadAllText, which throw FileNotFoundException where the Try forms return false.
- Assembly
- EvilEngine.Mounts
- Commit
- 4ff877b1