Files
clang-r547379/include/clang/InstallAPI/Library.h
Ryan Prichard 6024e5c395 Update prebuilt Clang to r547379 (20.0.0).
clang 20.0.0 (based on r547379) from build 12806354.

Bug: http://b/379133546
Test: N/A
Change-Id: I2eb8938af55d809de674be63cb30cf27e801862b

Upstream-Commit: ad834e67b1105d15ef907f6255d4c96e8e733f57
2025-11-26 14:59:46 -05:00

66 lines
2.0 KiB
C++

//===- InstallAPI/Library.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
//
//===----------------------------------------------------------------------===//
///
/// Defines the content of a library, such as public and private
/// header files, and whether it is a framework.
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_INSTALLAPI_LIBRARY_H
#define LLVM_CLANG_INSTALLAPI_LIBRARY_H
#include "clang/InstallAPI/HeaderFile.h"
#include "clang/InstallAPI/MachO.h"
namespace clang::installapi {
class Library {
public:
Library(StringRef Directory) : BaseDirectory(Directory) {}
/// Capture the name of the framework by the install name.
///
/// \param InstallName The install name of the library encoded in a dynamic
/// library.
static StringRef getFrameworkNameFromInstallName(StringRef InstallName);
/// Get name of library by the discovered file path.
StringRef getName() const;
/// Get discovered path of library.
StringRef getPath() const { return BaseDirectory; }
/// Add a header file that belongs to the library.
///
/// \param FullPath Path to header file.
/// \param Type Access level of header.
/// \param IncludePath The way the header should be included.
void addHeaderFile(StringRef FullPath, HeaderType Type,
StringRef IncludePath = StringRef()) {
Headers.emplace_back(FullPath, Type, IncludePath);
}
/// Determine if library is empty.
bool empty() {
return SubFrameworks.empty() && Headers.empty() &&
FrameworkVersions.empty();
}
private:
std::string BaseDirectory;
HeaderSeq Headers;
std::vector<Library> SubFrameworks;
std::vector<Library> FrameworkVersions;
bool IsUnwrappedDylib{false};
friend class DirectoryScanner;
};
} // namespace clang::installapi
#endif // LLVM_CLANG_INSTALLAPI_LIBRARY_H