MCPcopy Create free account
hub / github.com/CppMicroServices/CppMicroServices / CreateBundleFileObj

Method CreateBundleFileObj

util/src/BundleObjFactory.cpp:41–54  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 2

TESTFunction · 0.80
InitMinizMethod · 0.80

Calls 3

CreateBundlePEFileFunction · 0.85
CreateBundleMachOFileFunction · 0.85
CreateBundleElfFileFunction · 0.85

Tested by 1

TESTFunction · 0.64