filter and flatMap on Path

This commit is contained in:
Mark Harrah 2010-02-14 20:22:26 -05:00
parent 9605435d87
commit c8081e020a
1 changed files with 2 additions and 0 deletions

View File

@ -269,6 +269,8 @@ sealed abstract class PathFinder extends NotNull
addTo(pathSet)
wrap.Wrappers.readOnly(pathSet)
}
final def filter(f: Path => Boolean): PathFinder = Path.lazyPathFinder(get.filter(f))
final def flatMap(f: Path => PathFinder): PathFinder = Path.lazyPathFinder(get.flatMap(p => f(p).get))
final def getFiles: scala.collection.Set[File] = Set( get.map(_.asFile).toSeq : _*)
final def getPaths: scala.collection.Set[String] = Set( get.map(_.absolutePath).toSeq : _*)
private[sbt] def addTo(pathSet: Set[Path])