#pragma once // // This file is distributed under the MIT License. See LICENSE.md for details. // #include #include #include #include #include "llvm/ADT/SmallString.h" #include "llvm/Support/Path.h" llvm::StringRef getCurrentRoot(); std::string getCacheDirectory(); const std::map &getLibrariesFullPath(); template requires(std::is_convertible_v && ...) inline std::string joinPath(llvm::sys::path::Style Style, const llvm::StringRef First, const T... Parts) { llvm::SmallString<128> ResultPath(First); (llvm::sys::path::append(ResultPath, Style, Parts), ...); return ResultPath.str().str(); } template requires(std::is_convertible_v && ...) inline std::string joinPath(const llvm::StringRef First, const T... Parts) { return joinPath(llvm::sys::path::Style::native, First, Parts...); } class PathList { public: PathList(const std::vector &Paths) : SearchPaths(Paths) {} std::optional findFile(llvm::StringRef FileName) const; std::vector list(llvm::StringRef Path, llvm::StringRef Suffix) const; private: std::vector SearchPaths; };