Added global constants for OS_SEPARATOR and VFS_SEPARATOR.

This commit is contained in:
Evgeny Gerashchenko
2012-04-08 17:20:04 +04:00
parent dfd3f50c52
commit 3fa0561f3d
+5 -4
View File
@@ -106,14 +106,15 @@ public class PhysicalVirtualFile(path : String) : VirtualFile(path) {
}
}
private val OS_SEPARATOR = java.io.File.separator.sure()
private val VFS_SEPARATOR = "/"
private fun String.toSystemDependentPath() : String {
// FIXME constants should be extracted (NPE in compiler, KT-1111)
return this.replaceAll("/", java.io.File.separator.sure())
return this.replaceAll(VFS_SEPARATOR, OS_SEPARATOR)
}
private fun String.toSystemIndependentPath() : String {
// FIXME constants should be extracted (NPE in compiler, KT-1111)
return this.replaceAll(java.io.File.separator.sure(), "/")
return this.replaceAll(OS_SEPARATOR, VFS_SEPARATOR)
}
/**