com.intellij.execution.Platform Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of symbol-processing-aa Show documentation
Show all versions of symbol-processing-aa Show documentation
KSP implementation on Kotlin Analysis API
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution;
import com.intellij.openapi.util.NlsSafe;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.annotations.NotNull;
public enum Platform {
WINDOWS('\\', ';', "\r\n"),
UNIX('/', ':', "\n");
public final char fileSeparator;
public final char pathSeparator;
public final @NotNull String lineSeparator;
Platform(char fileSeparator,
char pathSeparator,
@NotNull String lineSeparator) {
this.fileSeparator = fileSeparator;
this.pathSeparator = pathSeparator;
this.lineSeparator = lineSeparator;
}
public static @NlsSafe @NotNull Platform current() {
return SystemInfo.isWindows ? WINDOWS : UNIX;
}
public @NotNull String toSystemDependentName(@NotNull String filePath) {
return FileUtil.toSystemDependentName(filePath, fileSeparator);
}
}