Interface XmlInputProviderAlpha

The input provider for Virtual IO.

This interface defines four callbacks for reading the content of XML files. Each callback takes a 4-byte integer as the type of file descriptor.

interface XmlInputProvider {
    close(fd: number): boolean;
    match(filename: string): boolean;
    open(filename: string): undefined | number;
    read(fd: number, buf: Uint8Array): number;
}

Implemented by

Methods

  • Alpha

    Close the file.

    Parameters

    • fd: number

      File descriptor

    Returns boolean

    true if succeeded.

  • Alpha

    Determine if this input provider should handle this file.

    Parameters

    • filename: string

      The file name/path/url

    Returns boolean

    true if the provider should handle it.

  • Alpha

    Open the file and return a file descriptor (handle) representing the file.

    Parameters

    • filename: string

      The file name/path/url

    Returns undefined | number

    undefined on error, number on success.

  • Alpha

    Read from the file.

    Parameters

    • fd: number

      File descriptor

    • buf: Uint8Array

      Buffer to read into, with a maximum read size of its byteLength.

    Returns number

    number of bytes actually read, -1 on error.