Merge branch 'release-3.29'
[kiteware-cmake.git] / Source / cmMachO.h
blobec7d54c44d050ded4b02133bfb44811d2a2a322c
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <iosfwd>
8 #include <memory>
9 #include <string>
11 #if !defined(CMake_USE_MACH_PARSER)
12 # error "This file may be included only if CMake_USE_MACH_PARSER is enabled."
13 #endif
15 class cmMachOInternal;
17 /** \class cmMachO
18 * \brief Executable and Link Format (Mach-O) parser.
20 class cmMachO
22 public:
23 /** Construct with the name of the Mach-O input file to parse. */
24 cmMachO(const char* fname);
26 /** Destruct. */
27 ~cmMachO();
29 /** Get the error message if any. */
30 std::string const& GetErrorMessage() const;
32 /** Boolean conversion. True if the Mach-O file is valid. */
33 explicit operator bool() const { return this->Valid(); }
35 /** Get Install name from binary **/
36 bool GetInstallName(std::string& install_name);
38 /** Print human-readable information about the Mach-O file. */
39 void PrintInfo(std::ostream& os) const;
41 private:
42 friend class cmMachOInternal;
43 bool Valid() const;
44 std::unique_ptr<cmMachOInternal> Internal;