From 3fa0561f3de4036075ae33589729bab2ccca2423 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Sun, 8 Apr 2012 17:20:04 +0400 Subject: [PATCH] Added global constants for OS_SEPARATOR and VFS_SEPARATOR. --- examples/example-vfs/src/VirtualFile.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/example-vfs/src/VirtualFile.kt b/examples/example-vfs/src/VirtualFile.kt index a9e6f8514ea..3088cd81dc4 100644 --- a/examples/example-vfs/src/VirtualFile.kt +++ b/examples/example-vfs/src/VirtualFile.kt @@ -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) } /**