ΒΆbool replace_path_prefix(
SmallVectorImpl<char>& Path,
const llvm::StringRef& OldPrefix,
const llvm::StringRef& NewPrefix,
llvm::sys::path::Style style = Style::native,
bool strict = false)
bool replace_path_prefix(
SmallVectorImpl<char>& Path,
const llvm::StringRef& OldPrefix,
const llvm::StringRef& NewPrefix,
llvm::sys::path::Style style = Style::native,
bool strict = false)
Description
Replace matching path prefix with another path.
Declared at: llvm/include/llvm/Support/Path.h:179
Parameters
- SmallVectorImpl<char>& Path
- If \a Path starts with \a OldPrefix modify to instead start with \a NewPrefix.
- const llvm::StringRef& OldPrefix
- The path prefix to strip from \a Path. Any trailing path separator is ignored if strict is true.
- const llvm::StringRef& NewPrefix
- The path prefix to replace \a NewPrefix with.
- llvm::sys::path::Style style = Style::native
- The path separator style
- bool strict = false
- If strict is true, a directory separator following\a OldPrefix will also be stripped. Otherwise, directory separators will only be matched and stripped when present in \a OldPrefix.