resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmMachO.h
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
4
5 #include "cmConfigure.h" // IWYU pragma: keep
6
7 #include <iosfwd>
8 #include <memory>
9 #include <string>
10
11 #if !defined(CMake_USE_MACH_PARSER)
12 #  error "This file may be included only if CMake_USE_MACH_PARSER is enabled."
13 #endif
14
15 class cmMachOInternal;
16
17 /** \class cmMachO
18  * \brief Executable and Link Format (Mach-O) parser.
19  */
20 class cmMachO
21 {
22 public:
23   /** Construct with the name of the Mach-O input file to parse.  */
24   cmMachO(const char* fname);
25
26   /** Destruct.   */
27   ~cmMachO();
28
29   /** Get the error message if any.  */
30   std::string const& GetErrorMessage() const;
31
32   /** Boolean conversion.  True if the Mach-O file is valid.  */
33   explicit operator bool() const { return this->Valid(); }
34
35   /** Get Install name from binary **/
36   bool GetInstallName(std::string& install_name);
37
38   /** Print human-readable information about the Mach-O file.  */
39   void PrintInfo(std::ostream& os) const;
40
41 private:
42   friend class cmMachOInternal;
43   bool Valid() const;
44   std::unique_ptr<cmMachOInternal> Internal;
45 };