VirtualFileSystemContributor

public protocol VirtualFileSystemContributor

Implement this if you want to open files as your own VirtualFileSystem.

  • Returns true if the target file system supports this file name, false otherwise.

    This method is called in the UI thread. Avoid time-consuming checks.

    Declaration

    Swift

    func isApplicable(fileName: String) -> Bool
  • Returns the root directory from your VirtualFileSystem for the target file.

    This method is called in the background thread. Note that the newly created file system may be used in different threads, so it needs to be thread-safe.

    Declaration

    Swift

    func open(target: VirtualFile, localCopy: LocalFile) throws -> VirtualFile
  • Returns the name for this contributor.

    Declaration

    Swift

    func getName(fileName: String) -> String
  • The name for Open with.

    Declaration

    Swift

    var openWithName: String
  • icon Default implementation

    The icon to be displayed in Open with.

    Default Implementation

    No icon by default.

    Declaration

    Swift

    var icon: NSImage?