summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/io/Path.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-13 19:24:43 +0000
committerPaul Phillips <paulp@improving.org>2010-03-13 19:24:43 +0000
commit1b14f49ff297a29c489dd184ee8f1f3c885a1b33 (patch)
tree7613b903e6cf14d080debdb3c52bef5033e5fba2 /src/compiler/scala/tools/nsc/io/Path.scala
parent4eade93cfeb1341a136177321746791af3ed95f0 (diff)
downloadscala-1b14f49ff297a29c489dd184ee8f1f3c885a1b33.tar.gz
scala-1b14f49ff297a29c489dd184ee8f1f3c885a1b33.tar.bz2
scala-1b14f49ff297a29c489dd184ee8f1f3c885a1b33.zip
More support code for the big partest patch I'm...
More support code for the big partest patch I'm working on to finally finish classpaths for good. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/io/Path.scala')
-rw-r--r--src/compiler/scala/tools/nsc/io/Path.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/io/Path.scala b/src/compiler/scala/tools/nsc/io/Path.scala
index 823e11b304..98d981f65e 100644
--- a/src/compiler/scala/tools/nsc/io/Path.scala
+++ b/src/compiler/scala/tools/nsc/io/Path.scala
@@ -97,6 +97,10 @@ class Path private[io] (val jfile: JFile) {
def toAbsolute: Path = if (isAbsolute) this else Path(jfile.getAbsolutePath())
def toURI: URI = jfile.toURI()
def toURL: URL = toURI.toURL()
+ /** If this path is absolute, returns it: otherwise, returns an absolute
+ * path made up of root / this.
+ */
+ def toAbsoluteWithRoot(root: Path) = if (isAbsolute) this else root.toAbsolute / this
/** Creates a new Path with the specified path appended. Assumes
* the type of the new component implies the type of the result.
@@ -225,7 +229,7 @@ class Path private[io] (val jfile: JFile) {
// def copyTo(target: Path, options ...): Boolean
// def moveTo(target: Path, options ...): Boolean
- override def toString() = "Path(%s)".format(path)
+ override def toString() = path
override def equals(other: Any) = other match {
case x: Path => path == x.path
case _ => false