Interface XmlInputProviderAlpha

The input provider for Virtual IO.

This interface defines 4 callbacks for reading content of xml, where 4-bytes integer is used 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;
}

Methods

  • Alpha

    Close the file

    Parameters

    • fd: number

      file descriptor

    Returns boolean

    true if success

  • Alpha

    Check if this input provider should handle this file

    Parameters

    • filename: string

      The file name/path/url

    Returns boolean

    true if the provider should handle

  • Alpha

    Open the file and return a file descriptor (handle)

    Parameters

    • filename: string

      file path

    Returns undefined | number

    undefined on error, FdType on success

  • Alpha

    Read from a file

    Parameters

    • fd: number

      File descriptor

    • buf: Uint8Array

      Buffer to read into, no more than its byteLength shall be read into.

    Returns number

    number of bytes actually read, -1 on error