Finder

class Finder
extension Path.Finder: Sequence, IteratorProtocol

The builder for Path.find()

  • The path find operations operate on.

    Declaration

    Swift

    public let path: Path
  • The range of directory depths for which the find operation will return entries.

    Declaration

    Swift

    private(set) public var depth: ClosedRange<Int> { get set }
  • The kinds of filesystem entries find operations will return.

    Declaration

    Swift

    public var types: Set<EntryType> { get }
  • The file extensions find operations will return. Files and directories unless you filter for kinds.

    Declaration

    Swift

    private(set) public var extensions: Set<String>?
  • Declaration

    Swift

    public func next() -> Path?
  • Declaration

    Swift

    public typealias Element = Path
  • A max depth of 0 returns only the path we are searching, 1 is that directory’s listing.

    Declaration

    Swift

    func depth(max maxDepth: Int) -> Path.Finder
  • A min depth of 0 also returns the path we are searching, 1 is that directory’s listing. Default is 1 thus not returning ourself.

    Declaration

    Swift

    func depth(min minDepth: Int) -> Path.Finder
  • A max depth of 0 returns only the path we are searching, 1 is that directory’s listing. A min depth of 0 also returns the path we are searching, 1 is that directory’s listing. Default is 1 thus not returning ourself.

    Declaration

    Swift

    func depth(_ rng: Range<Int>) -> Path.Finder
  • A max depth of 0 returns only the path we are searching, 1 is that directory’s listing. A min depth of 0 also returns the path we are searching, 1 is that directory’s listing. Default is 1 thus not returning ourself.

    Declaration

    Swift

    func depth(_ rng: ClosedRange<Int>) -> Path.Finder
  • Multiple calls will configure the Finder with multiple kinds.

    Declaration

    Swift

    func type(_ type: Path.EntryType) -> Path.Finder
  • Multiple calls will configure the Finder with for multiple extensions

    Declaration

    Swift

    func `extension`(_ ext: String) -> Path.Finder
  • The return type for Path.Finder

    See more

    Declaration

    Swift

    enum ControlFlow
  • Enumerate, one file at a time.

    Declaration

    Swift

    func execute(_ closure: (Path) throws -> ControlFlow) rethrows