Skip to content
FutureBlitz

    Install

    Import std.compress.vfs

    std.compress.vfs

    std.compress's zips in std.io's virtual file system: a ZipSource reads a zip's files as a VfsSource, and a Vfs's MountZip mounts one, as a game mounts its pak files.

    std/compress/vfs.fb

    Types

    ZipSource class

    Public Class ZipSource Implements VfsSource

    A zip's files as a source, by their names: each file's name is its path, with '/' (or '') between folders, and the folders are the ones its entries name or go through. An entry whose name goes above the zip's root, or has no names once its "."s and ".."s are taken out, isn't in it, so a zip can't reach past where it's mounted, and neither is a link. Of the entries a name has, the last is the file, as ZipReader.Read takes it. A read decompresses the file from the zip each time.

    std/compress/vfs.fb, line 18

    • Public New(reader: ZipReader) Throws IOError constructor #

      A source of the zip a ZipReader reads, which it keeps. Throws an IOError of INVALID_DATA when the zip's entries make one place a file and a folder too.

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

      The bytes of the file at path, or Null when there's no file there.

      Doc from std.io.vfs.VfsSource.Read.

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

      What's at path, or Null when nothing is.

      Doc from std.io.vfs.VfsSource.KindAt.

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

      The names of what's in the folder at path, and their kinds, in any order, or Null when there's no folder there.

      Doc from std.io.vfs.VfsSource.List.

    Extends

    Vfs extend

    Extend Vfs

    No doc comment.

    std/compress/vfs.fb, line 86

    • @PanicsAtCaller Public Method MountZip(at: Path, data: UInt8[]) Throws IOError method #

      Mounts the zip in data, which it copies, at at, as a ZipSource. Throws an IOError of INVALID_DATA when the data isn't a zip, or ends too soon, or as a ZipSource does, and panics for a path that goes above the root, as Mount does.

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