Added global constants for OS_SEPARATOR and VFS_SEPARATOR.
This commit is contained in:
@@ -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 {
|
private fun String.toSystemDependentPath() : String {
|
||||||
// FIXME constants should be extracted (NPE in compiler, KT-1111)
|
return this.replaceAll(VFS_SEPARATOR, OS_SEPARATOR)
|
||||||
return this.replaceAll("/", java.io.File.separator.sure())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun String.toSystemIndependentPath() : String {
|
private fun String.toSystemIndependentPath() : String {
|
||||||
// FIXME constants should be extracted (NPE in compiler, KT-1111)
|
return this.replaceAll(OS_SEPARATOR, VFS_SEPARATOR)
|
||||||
return this.replaceAll(java.io.File.separator.sure(), "/")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user