class MachO::LoadCommands::SourceVersionCommand

A load command specifying the version of the sources used to build the binary. Corresponds to LC_SOURCE_VERSION.

Constants

FORMAT

@see MachOStructure::FORMAT @api private

SIZEOF

@see MachOStructure::SIZEOF @api private

Attributes

version[R]

@return [Fixnum] the version packed as a24.b10.c10.d10.e10

Public Class Methods

new(view, cmd, cmdsize, version) click to toggle source

@api private

Calls superclass method MachO::LoadCommands::LoadCommand.new
# File lib/macho/load_commands.rb, line 1242
def initialize(view, cmd, cmdsize, version)
  super(view, cmd, cmdsize)
  @version = version
end

Public Instance Methods

version_string() click to toggle source

A string representation of the sources used to build the binary. @return [String] a string representation of the version

# File lib/macho/load_commands.rb, line 1249
def version_string
  binary = "%064b" % version
  segs = [
    binary[0..23], binary[24..33], binary[34..43], binary[44..53],
    binary[54..63]
  ].map { |s| s.to_i(2) }

  segs.join(".")
end