cmMachO.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #if !defined(CMAKE_USE_MACH_PARSER)
  6. #error "This file may be included only if CMAKE_USE_MACH_PARSER is enabled."
  7. #endif
  8. class cmMachOInternal;
  9. /** \class cmMachO
  10. * \brief Executable and Link Format (Mach-O) parser.
  11. */
  12. class cmMachO
  13. {
  14. public:
  15. /** Construct with the name of the Mach-O input file to parse. */
  16. cmMachO(const char* fname);
  17. /** Destruct. */
  18. ~cmMachO();
  19. /** Get the error message if any. */
  20. std::string const& GetErrorMessage() const;
  21. /** Boolean conversion. True if the Mach-O file is valid. */
  22. operator bool() const { return this->Valid(); }
  23. /** Get Install name from binary **/
  24. bool GetInstallName(std::string& install_name);
  25. /** Print human-readable information about the Mach-O file. */
  26. void PrintInfo(std::ostream& os) const;
  27. private:
  28. friend class cmMachOInternal;
  29. bool Valid() const;
  30. cmMachOInternal* Internal;
  31. };
  32. #endif