//===- InstallAPI/HeaderFile.h ----------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// Representations of a library's headers for InstallAPI. /// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_INSTALLAPI_HEADERFILE_H #define LLVM_CLANG_INSTALLAPI_HEADERFILE_H #include "clang/Basic/FileManager.h" #include "clang/Basic/LangStandard.h" #include "clang/InstallAPI/MachO.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Regex.h" #include <optional> #include <string> namespace clang::installapi { enum class HeaderType { … }; inline StringRef getName(const HeaderType T) { … } class HeaderFile { … }; /// Glob that represents a pattern of header files to retreive. class HeaderGlob { … }; /// Assemble expected way header will be included by clients. /// As in what maps inside the brackets of `#include <IncludeName.h>` /// For example, /// "/System/Library/Frameworks/Foo.framework/Headers/Foo.h" returns /// "Foo/Foo.h" /// /// \param FullPath Path to the header file which includes the library /// structure. std::optional<std::string> createIncludeHeaderName(const StringRef FullPath); HeaderSeq; /// Determine if Path is a header file. /// It does not touch the file system. /// /// \param Path File path to file. bool isHeaderFile(StringRef Path); /// Given input directory, collect all header files. /// /// \param FM FileManager for finding input files. /// \param Directory Path to directory file. llvm::Expected<PathSeq> enumerateFiles(clang::FileManager &FM, StringRef Directory); } // namespace clang::installapi #endif // LLVM_CLANG_INSTALLAPI_HEADERFILE_H