Skip to content
FutureBlitz

    Install

    Import std.io.vfs

    EmbeddedSource

    std.io.vfs

    class

    Public Class EmbeddedSource Implements VfsSource

    Files a program has in memory as a source, by their paths, like what EmbedFolder gives: each key is a file's path, with '/' (or '') between folders, and the folders are the ones the paths go through. It keeps the arrays it's given, and a read gives a copy of a file's bytes.

    std/io/vfs.fb, line 113

    • @PanicsAtCaller Public New(files: Map<String, UInt8[]>) constructor #

      A source of files, by their paths. Panics for a path that isn't a file's, one that goes above the root or has no names once its "."s and ".."s are taken out, like "", ".", or "a/..", and for paths that make one place a file and a folder too.

    • Public Method Read(path: String): UInt8[]? Throws IOError method #

      A copy of the bytes of the file at path, or Null when it has none there.

    • Public Method KindAt(path: String): FileKind? Throws IOError method #

      Whether path is a file or a folder, as the files' paths make it, or Null when it's neither.

    • Public Method List(path: String): (String, FileKind)[]? Throws IOError method #

      The names in the folder at path, each with whether it's a file or a folder, or Null when there's no folder there.

    Report an issue with this page or with FutureBlitz on GitHub.