public abstract class DebugPathSanitizer extends Object implements AddsToRuleKey
Constructor and Description |
---|
DebugPathSanitizer() |
DebugPathSanitizer(boolean useUnixPathSeparator) |
Modifier and Type | Method and Description |
---|---|
protected abstract Iterable<Map.Entry<Path,String>> |
getAllPaths(Optional<Path> workingDir) |
abstract String |
getCompilationDirectory() |
abstract com.google.common.collect.ImmutableMap<String,String> |
getCompilationEnvironment(Path workingDir,
boolean shouldSanitize) |
com.google.common.collect.ImmutableList<String> |
getCompilationFlags(Compiler compiler,
Path workingDir,
com.google.common.collect.ImmutableMap<Path,Path> prefixMap) |
static String |
getPaddedDir(String path,
int size,
char pad) |
abstract void |
restoreCompilationDirectory(Path path,
Path workingDir) |
com.google.common.collect.ImmutableList<String> |
sanitizeFlags(Iterable<String> flags)
Sanitizes a list of flags.
|
java.util.function.Function<String,String> |
sanitizer(Optional<Path> workingDir)
Return a Function to perform sanitization of string.
|
public DebugPathSanitizer(boolean useUnixPathSeparator)
useUnixPathSeparator
- use unix path separator in paths.public DebugPathSanitizer()
public static String getPaddedDir(String path, int size, char pad)
separator
to fulfill the required
pathSize
.public abstract com.google.common.collect.ImmutableMap<String,String> getCompilationEnvironment(Path workingDir, boolean shouldSanitize)
public com.google.common.collect.ImmutableList<String> getCompilationFlags(Compiler compiler, Path workingDir, com.google.common.collect.ImmutableMap<Path,Path> prefixMap)
protected abstract Iterable<Map.Entry<Path,String>> getAllPaths(Optional<Path> workingDir)
public abstract String getCompilationDirectory()
public java.util.function.Function<String,String> sanitizer(Optional<Path> workingDir)
When sanitizing multiple values, it is much more efficient to get the sanitizer once and sanitize multiple values with it.
public com.google.common.collect.ImmutableList<String> sanitizeFlags(Iterable<String> flags)