1 //===- InstallAPI/FileList.h ------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 /// 9 /// The JSON file list parser is used to communicate input to InstallAPI. 10 /// 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_CLANG_INSTALLAPI_FILELIST_H 14 #define LLVM_CLANG_INSTALLAPI_FILELIST_H 15 16 #include "clang/Basic/Diagnostic.h" 17 #include "clang/Basic/FileManager.h" 18 #include "clang/InstallAPI/HeaderFile.h" 19 #include "llvm/Support/Error.h" 20 #include "llvm/Support/MemoryBuffer.h" 21 22 namespace clang { 23 namespace installapi { 24 25 class FileListReader { 26 public: 27 /// Decode JSON input and append header input into destination container. 28 /// Headers are loaded in the order they appear in the JSON input. 29 /// 30 /// \param InputBuffer JSON input data. 31 /// \param Destination Container to load headers into. 32 /// \param FM Optional File Manager to validate input files exist. 33 static llvm::Error 34 loadHeaders(std::unique_ptr<llvm::MemoryBuffer> InputBuffer, 35 HeaderSeq &Destination, clang::FileManager *FM = nullptr); 36 37 FileListReader() = delete; 38 }; 39 40 } // namespace installapi 41 } // namespace clang 42 43 #endif // LLVM_CLANG_INSTALLAPI_FILELIST_H 44