Return a BundleObjFile which represents data read from the binary at the given location. @param location absolute path to a PE, ELF or Mach-O binary file. @return A BundleObjFile object @throws If location is not a valid PE, ELF or Mach-O binary file. @note The location must be a valid binary format for the host machine. i.e. PE file on Windows, Mach-O on macOS, ELF on Linux
| 39 | /// @note The location must be a valid binary format for the host machine. |
| 40 | /// i.e. PE file on Windows, Mach-O on macOS, ELF on Linux |
| 41 | std::unique_ptr<BundleObjFile> |
| 42 | BundleObjFactory::CreateBundleFileObj(std::string const& location) |
| 43 | { |
| 44 | #if defined(US_PLATFORM_WINDOWS) |
| 45 | return CreateBundlePEFile(location); |
| 46 | #elif defined(US_PLATFORM_APPLE) |
| 47 | return CreateBundleMachOFile(location); |
| 48 | #elif defined(US_PLATFORM_LINUX) |
| 49 | return CreateBundleElfFile(location); |
| 50 | #else |
| 51 | # error "Unknown OS platform"; |
| 52 | #endif |
| 53 | return {}; |
| 54 | } |
| 55 | }; // namespace cppmicroservices |