cmMachO.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmMachO_h
  4. #define cmMachO_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <iosfwd>
  7. #include <string>
  8. #if !defined(CMAKE_USE_MACH_PARSER)
  9. #error "This file may be included only if CMAKE_USE_MACH_PARSER is enabled."
  10. #endif
  11. class cmMachOInternal;
  12. /** \class cmMachO
  13. * \brief Executable and Link Format (Mach-O) parser.
  14. */
  15. class cmMachO
  16. {
  17. public:
  18. /** Construct with the name of the Mach-O input file to parse. */
  19. cmMachO(const char* fname);
  20. /** Destruct. */
  21. ~cmMachO();
  22. /** Get the error message if any. */
  23. std::string const& GetErrorMessage() const;
  24. /** Boolean conversion. True if the Mach-O file is valid. */
  25. operator bool() const { return this->Valid(); }
  26. /** Get Install name from binary **/
  27. bool GetInstallName(std::string& install_name);
  28. /** Print human-readable information about the Mach-O file. */
  29. void PrintInfo(std::ostream& os) const;
  30. private:
  31. friend class cmMachOInternal;
  32. bool Valid() const;
  33. cmMachOInternal* Internal;
  34. };
  35. #endif