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