BinaryFile

public class BinaryFile

A BinaryFile is a (mostly) architecture-independent representation of an in-memory image file.

  • The backing buffer for this binary file.

    Declaration

    Swift

    public let buffer: MemoryBuffer
  • The kind of this binary file.

    Declaration

    Swift

    public let kind: Kind
  • The kinds of binary files known to LLVM.

    See more

    Declaration

    Swift

    public enum Kind
  • Creates a Binary File with the contents of a provided memory buffer.

    Throws

    BinaryFileError if there was an error on creation.

    Declaration

    Swift

    public init(memoryBuffer: MemoryBuffer, in context: Context = .global) throws

    Parameters

    memoryBuffer

    A memory buffer containing a valid binary file.

    context

    The context to allocate the given binary in.

  • Creates an ObjectFile with the contents of the object file at the provided path.

    Throws

    MemoryBufferError or BinaryFileError if there was an error on creation

    Declaration

    Swift

    public convenience init(path: String) throws

    Parameters

    path

    The absolute file path on your filesystem.