Lines Matching refs:Path

124 std::error_code FileSystem::makeAbsolute(SmallVectorImpl<char> &Path) const {  in makeAbsolute()
125 if (llvm::sys::path::is_absolute(Path)) in makeAbsolute()
132 llvm::sys::fs::make_absolute(WorkingDir.get(), Path); in makeAbsolute()
136 std::error_code FileSystem::getRealPath(const Twine &Path, in getRealPath() argument
141 std::error_code FileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
145 bool FileSystem::exists(const Twine &Path) { in exists() argument
146 auto Status = status(Path); in exists()
155 static bool pathHasTraversal(StringRef Path) { in pathHasTraversal() argument
158 for (StringRef Comp : llvm::make_range(path::begin(Path), path::end(Path))) in pathHasTraversal()
255 ErrorOr<Status> status(const Twine &Path) override;
256 ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) override;
260 std::error_code setCurrentWorkingDirectory(const Twine &Path) override;
261 std::error_code isLocal(const Twine &Path, bool &Result) override;
262 std::error_code getRealPath(const Twine &Path,
268 Twine adjustPath(const Twine &Path, SmallVectorImpl<char> &Storage) const { in adjustPath() argument
270 return Path; in adjustPath()
271 Path.toVector(Storage); in adjustPath()
287 ErrorOr<Status> RealFileSystem::status(const Twine &Path) { in status() argument
291 sys::fs::status(adjustPath(Path, Storage), RealStatus)) in status()
293 return Status::copyWithNewName(RealStatus, Path); in status()
317 std::error_code RealFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
319 return llvm::sys::fs::set_current_path(Path); in setCurrentWorkingDirectory()
322 adjustPath(Path, Storage).toVector(Absolute); in setCurrentWorkingDirectory()
334 std::error_code RealFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
336 return llvm::sys::fs::is_local(adjustPath(Path, Storage), Result); in isLocal()
340 RealFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
343 return llvm::sys::fs::real_path(adjustPath(Path, Storage), Output); in getRealPath()
361 RealFSDirIter(const Twine &Path, std::error_code &EC) : Iter(Path, EC) { in RealFSDirIter() argument
400 ErrorOr<Status> OverlayFileSystem::status(const Twine &Path) { in status() argument
403 ErrorOr<Status> Status = (*I)->status(Path); in status()
411 OverlayFileSystem::openFileForRead(const llvm::Twine &Path) { in openFileForRead() argument
414 auto Result = (*I)->openFileForRead(Path); in openFileForRead()
428 OverlayFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
430 if (std::error_code EC = FS->setCurrentWorkingDirectory(Path)) in setCurrentWorkingDirectory()
435 std::error_code OverlayFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
437 if (FS->exists(Path)) in isLocal()
438 return FS->isLocal(Path, Result); in isLocal()
443 OverlayFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
446 if (FS->exists(Path)) in getRealPath()
447 return FS->getRealPath(Path, Output); in getRealPath()
601 InMemoryHardLink(StringRef Path, const InMemoryFile &ResolvedFile) in InMemoryHardLink() argument
602 : InMemoryNode(Path, IME_HardLink), ResolvedFile(ResolvedFile) {} in InMemoryHardLink()
721 SmallString<128> Path; in addFile() local
722 P.toVector(Path); in addFile()
725 std::error_code EC = makeAbsolute(Path); in addFile()
730 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in addFile()
732 if (Path.empty()) in addFile()
736 auto I = llvm::sys::path::begin(Path), E = sys::path::end(Path); in addFile()
774 StringRef(Path.str().begin(), Name.end() - Path.str().begin()), in addFile()
829 SmallString<128> Path; in lookupInMemoryNode() local
830 P.toVector(Path); in lookupInMemoryNode()
833 std::error_code EC = FS.makeAbsolute(Path); in lookupInMemoryNode()
838 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in lookupInMemoryNode()
840 if (Path.empty()) in lookupInMemoryNode()
843 auto I = llvm::sys::path::begin(Path), E = llvm::sys::path::end(Path); in lookupInMemoryNode()
882 llvm::ErrorOr<Status> InMemoryFileSystem::status(const Twine &Path) { in status() argument
883 auto Node = lookupInMemoryNode(*this, Root.get(), Path); in status()
885 return detail::getNodeStatus(*Node, Path); in status()
890 InMemoryFileSystem::openFileForRead(const Twine &Path) { in openFileForRead() argument
891 auto Node = lookupInMemoryNode(*this, Root.get(), Path); in openFileForRead()
899 new detail::InMemoryFileAdaptor(*F, Path.str())); in openFileForRead()
915 SmallString<256> Path(RequestedDirName); in setCurrentEntry() local
916 llvm::sys::path::append(Path, I->second->getFileName()); in setCurrentEntry()
927 CurrentEntry = directory_entry(std::string(Path.str()), Type); in setCurrentEntry()
971 SmallString<128> Path; in setCurrentWorkingDirectory() local
972 P.toVector(Path); in setCurrentWorkingDirectory()
975 std::error_code EC = makeAbsolute(Path); in setCurrentWorkingDirectory()
980 llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true); in setCurrentWorkingDirectory()
982 if (!Path.empty()) in setCurrentWorkingDirectory()
983 WorkingDirectory = std::string(Path.str()); in setCurrentWorkingDirectory()
988 InMemoryFileSystem::getRealPath(const Twine &Path, in getRealPath() argument
993 Path.toVector(Output); in getRealPath()
1000 std::error_code InMemoryFileSystem::isLocal(const Twine &Path, bool &Result) { in isLocal() argument
1014 static llvm::sys::path::Style getExistingStyle(llvm::StringRef Path) { in getExistingStyle() argument
1017 const size_t n = Path.find_first_of("/\\"); in getExistingStyle()
1019 style = (Path[n] == '/') ? llvm::sys::path::Style::posix in getExistingStyle()
1025 static llvm::SmallString<256> canonicalize(llvm::StringRef Path) { in canonicalize() argument
1027 llvm::sys::path::Style style = getExistingStyle(Path); in canonicalize()
1032 llvm::sys::path::remove_leading_dotslash(Path, style); in canonicalize()
1083 const Twine &Path, RedirectingFileSystem::DirectoryEntry::iterator Begin, in RedirectingFSDirIterImpl() argument
1085 : Dir(Path.str()), Current(Begin), End(End) { in RedirectingFSDirIterImpl()
1139 RedirectingFileSystem::setCurrentWorkingDirectory(const Twine &Path) { in setCurrentWorkingDirectory() argument
1141 if (!exists(Path)) in setCurrentWorkingDirectory()
1145 Path.toVector(AbsolutePath); in setCurrentWorkingDirectory()
1154 SmallString<256> Path; in isLocal() local
1155 Path_.toVector(Path); in isLocal()
1157 if (std::error_code EC = makeCanonical(Path)) in isLocal()
1160 return ExternalFS->isLocal(Path, Result); in isLocal()
1163 std::error_code RedirectingFileSystem::makeAbsolute(SmallVectorImpl<char> &Path) const { in makeAbsolute()
1164 if (llvm::sys::path::is_absolute(Path, llvm::sys::path::Style::posix) || in makeAbsolute()
1165 llvm::sys::path::is_absolute(Path, llvm::sys::path::Style::windows)) in makeAbsolute()
1186 Result.append(Path.data(), Path.size()); in makeAbsolute()
1187 Path.assign(Result.begin(), Result.end()); in makeAbsolute()
1194 SmallString<256> Path; in dir_begin() local
1195 Dir.toVector(Path); in dir_begin()
1197 EC = makeCanonical(Path); in dir_begin()
1201 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in dir_begin()
1205 return ExternalFS->dir_begin(Path, EC); in dir_begin()
1210 ErrorOr<Status> S = status(Path, *Result); in dir_begin()
1234 std::string(Path), DirIter)); in dir_begin()
1239 Path, DE->contents_begin(), DE->contents_end(), EC)); in dir_begin()
1245 DirIter, ExternalFS, std::string(Path), EC)); in dir_begin()
1869 RedirectingFileSystem::makeCanonical(SmallVectorImpl<char> &Path) const { in makeCanonical()
1870 if (std::error_code EC = makeAbsolute(Path)) in makeCanonical()
1874 canonicalize(StringRef(Path.data(), Path.size())); in makeCanonical()
1878 Path.assign(CanonicalPath.begin(), CanonicalPath.end()); in makeCanonical()
1883 RedirectingFileSystem::lookupPath(StringRef Path) const { in lookupPath()
1884 sys::path::const_iterator Start = sys::path::begin(Path); in lookupPath()
1885 sys::path::const_iterator End = sys::path::end(Path); in lookupPath()
1936 static Status getRedirectedFileStatus(const Twine &Path, bool UseExternalNames, in getRedirectedFileStatus() argument
1940 S = Status::copyWithNewName(S, Path); in getRedirectedFileStatus()
1946 const Twine &Path, const RedirectingFileSystem::LookupResult &Result) { in status() argument
1952 return getRedirectedFileStatus(Path, RE->useExternalName(UseExternalNames), in status()
1957 return Status::copyWithNewName(DE->getStatus(), Path); in status()
1961 SmallString<256> Path; in status() local
1962 Path_.toVector(Path); in status()
1964 if (std::error_code EC = makeCanonical(Path)) in status()
1967 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in status()
1970 return ExternalFS->status(Path); in status()
1974 ErrorOr<Status> S = status(Path, *Result); in status()
1976 S = ExternalFS->status(Path); in status()
2007 SmallString<256> Path; in openFileForRead() local
2008 Path_.toVector(Path); in openFileForRead()
2010 if (std::error_code EC = makeCanonical(Path)) in openFileForRead()
2013 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in openFileForRead()
2016 return ExternalFS->openFileForRead(Path); in openFileForRead()
2029 return ExternalFS->openFileForRead(Path); in openFileForRead()
2039 Path, RE->useExternalName(UseExternalNames), *ExternalStatus); in openFileForRead()
2047 SmallString<256> Path; in getRealPath() local
2048 Path_.toVector(Path); in getRealPath()
2050 if (std::error_code EC = makeCanonical(Path)) in getRealPath()
2053 ErrorOr<RedirectingFileSystem::LookupResult> Result = lookupPath(Path); in getRealPath()
2056 return ExternalFS->getRealPath(Path, Output); in getRealPath()
2065 return ExternalFS->getRealPath(Path, Output); in getRealPath()
2072 return shouldUseExternalFS() ? ExternalFS->getRealPath(Path, Output) in getRealPath()
2087 SmallVectorImpl<StringRef> &Path, in getVFSEntries() argument
2095 Path.push_back(SubEntry->getName()); in getVFSEntries()
2096 getVFSEntries(SubEntry.get(), Path, Entries); in getVFSEntries()
2097 Path.pop_back(); in getVFSEntries()
2106 for (auto &Comp : Path) in getVFSEntries()
2117 for (auto &Comp : Path) in getVFSEntries()
2175 bool containedIn(StringRef Parent, StringRef Path);
2176 StringRef containedPart(StringRef Parent, StringRef Path);
2177 void startDirectory(StringRef Path);
2191 bool JSONWriter::containedIn(StringRef Parent, StringRef Path) { in containedIn() argument
2196 for (auto IChild = path::begin(Path), EChild = path::end(Path); in containedIn()
2205 StringRef JSONWriter::containedPart(StringRef Parent, StringRef Path) { in containedPart() argument
2207 assert(containedIn(Parent, Path)); in containedPart()
2208 return Path.slice(Parent.size() + 1, StringRef::npos); in containedPart()
2211 void JSONWriter::startDirectory(StringRef Path) { in startDirectory() argument
2213 DirStack.empty() ? Path : containedPart(DirStack.back(), Path); in startDirectory()
2214 DirStack.push_back(Path); in startDirectory()
2338 FileSystem &FS_, const Twine &Path, std::error_code &EC) in recursive_directory_iterator() argument
2340 directory_iterator I = FS->dir_begin(Path, EC); in recursive_directory_iterator()