Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DirInode<T>

Inode for a directory. Currently only contains the directory listing.

Type parameters

  • T

Hierarchy

  • DirInode

Implements

  • Inode

Index

Constructors

constructor

  • new DirInode(data?: T | null): DirInode

Methods

addItem

  • addItem(p: string, inode: Inode): boolean
  • Add the given item to the directory listing. Note that the given inode is not copied, and will be mutated by the DirInode if it is a DirInode.

    Parameters

    • p: string

      Item name to add to the directory listing.

    • inode: Inode

      The inode for the item to add to the directory inode.

    Returns boolean

    True if it was added, false if it already existed.

getData

  • getData(): T | null

getItem

  • getItem(p: string): Inode | null
  • Returns the inode for the indicated item, or null if it does not exist.

    Parameters

    • p: string

      Name of item in this directory.

    Returns Inode | null

getListing

  • getListing(): string[]
  • Returns the directory listing for this directory. Paths in the directory are relative to the directory's path.

    Returns string[]

    The directory listing for this directory.

getStats

  • Return a Stats object for this inode.

    todo

    Should probably remove this at some point. This isn't the responsibility of the FileIndex.

    Returns Stats

isDir

  • isDir(): boolean

isFile

  • isFile(): boolean

remItem

  • remItem(p: string): Inode | null
  • Removes the given item from the directory listing.

    Parameters

    • p: string

      Name of item to remove from the directory listing.

    Returns Inode | null

    Returns the item removed, or null if the item did not exist.

Generated using TypeDoc