diff options
author | Martin Odersky <odersky@gmail.com> | 2003-07-22 09:27:52 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-07-22 09:27:52 +0000 |
commit | e570d189e04924a7f2b59f4f859f642c43939a21 (patch) | |
tree | a4d384ddb861de15a04e67b1624711c97478c204 /sources/scalac/util/SourceRepresentation.java | |
parent | 74d350a2baff26d149e02110a9c3f079c2e03cac (diff) | |
download | scala-e570d189e04924a7f2b59f4f859f642c43939a21.tar.gz scala-e570d189e04924a7f2b59f4f859f642c43939a21.tar.bz2 scala-e570d189e04924a7f2b59f4f859f642c43939a21.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/util/SourceRepresentation.java')
-rw-r--r-- | sources/scalac/util/SourceRepresentation.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sources/scalac/util/SourceRepresentation.java b/sources/scalac/util/SourceRepresentation.java index 7c6ee44107..e5cb210090 100644 --- a/sources/scalac/util/SourceRepresentation.java +++ b/sources/scalac/util/SourceRepresentation.java @@ -8,6 +8,8 @@ package scalac.util; +import java.io.File; + public final class SourceRepresentation { public static int digit2int(byte ch, int base) { @@ -202,4 +204,15 @@ public final class SourceRepresentation { char[] s = {c}; return escape(new String(s)); } + + /** return external representation of file name s, + * converting '.' to File.separatorChar + */ + public static String externalizeFileName(Name n) { + if ((n == null) || (n.length() == 0)) + return "."; + byte[] ascii = n.toAscii(); + String s = ascii2string(ascii, 0, ascii.length); + return s.replace('.', File.separatorChar); + } } |