10#include "llvm/Support/Path.h"
14#ifdef CLANGD_PATH_CASE_INSENSITIVE
23 assert(llvm::sys::path::is_absolute(
Path));
27 if (llvm::sys::path::relative_path(
Path).empty()) {
31 PathRef Result = llvm::sys::path::parent_path(
Path);
32 assert(Result.empty() || llvm::sys::path::is_absolute(Result));
37 llvm::sys::path::Style Style) {
38 assert(llvm::sys::path::is_absolute(Ancestor) &&
39 llvm::sys::path::is_absolute(
Path));
42 if (llvm::sys::path::is_separator(Ancestor.back(), Style))
43 Ancestor = Ancestor.drop_back();
47 Path =
Path.drop_front(Ancestor.size());
50 return Path.empty() || llvm::sys::path::is_separator(
Path.front(), Style);
std::string maybeCaseFoldPath(PathRef Path)
bool pathEqual(PathRef A, PathRef B)
std::string Path
A typedef to represent a file path.
bool pathStartsWith(PathRef Ancestor, PathRef Path, llvm::sys::path::Style Style)
Checks if Ancestor is a proper ancestor of Path.
PathRef absoluteParent(PathRef Path)
Variant of parent_path that operates only on absolute paths.
llvm::StringRef PathRef
A typedef to represent a ref to file path.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//