Class: MachO::TwolevelHintsCommand

Inherits:
LoadCommand show all
Defined in:
lib/macho/load_commands.rb

Overview

A load command containing the offset and number of hints in the two-level namespace lookup hints table. Corresponds to LC_TWOLEVEL_HINTS.

Defined Under Namespace

Classes: TwolevelHintsTable

Constant Summary collapse

FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"L=4".freeze
SIZEOF =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

16

Instance Attribute Summary collapse

Attributes inherited from LoadCommand

#cmd, #cmdsize, #view

Instance Method Summary collapse

Methods inherited from LoadCommand

create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(view, cmd, cmdsize, htoffset, nhints) ⇒ TwolevelHintsCommand

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of TwolevelHintsCommand.



856
857
858
859
860
861
# File 'lib/macho/load_commands.rb', line 856

def initialize(view, cmd, cmdsize, htoffset, nhints)
  super(view, cmd, cmdsize)
  @htoffset = htoffset
  @nhints = nhints
  @table = TwolevelHintsTable.new(view, htoffset, nhints)
end

Instance Attribute Details

#htoffsetFixnum (readonly)

Returns the offset to the hint table.

Returns:

  • (Fixnum)

    the offset to the hint table



839
840
841
# File 'lib/macho/load_commands.rb', line 839

def htoffset
  @htoffset
end

#nhintsFixnum (readonly)

Returns the number of hints in the hint table.

Returns:

  • (Fixnum)

    the number of hints in the hint table



842
843
844
# File 'lib/macho/load_commands.rb', line 842

def nhints
  @nhints
end

#tableMachO::TwolevelHintsCommand::TwolevelHintTable (readonly)

Returns the hint table.

Returns:

  • (MachO::TwolevelHintsCommand::TwolevelHintTable)

    the hint table



845
846
847
# File 'lib/macho/load_commands.rb', line 845

def table
  @table
end