Class: MachO::LoadCommands::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

Instance Method Summary collapse

Methods inherited from LoadCommand

#cmd, #cmdsize, create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type, #view

Methods inherited from MachOStructure

bytesize, format, #initialize, new_from_bin

Constructor Details

This class inherits a constructor from MachO::MachOStructure

Instance Method Details

#htoffsetInteger

Returns the offset to the hint table.

Returns:

  • (Integer)

    the offset to the hint table



854
# File 'lib/macho/load_commands.rb', line 854

field :htoffset, :uint32

#nhintsInteger

Returns the number of hints in the hint table.

Returns:

  • (Integer)

    the number of hints in the hint table



857
# File 'lib/macho/load_commands.rb', line 857

field :nhints, :uint32

#tableTwolevelHintsTable

Returns the hint table.

Returns:



861
# File 'lib/macho/load_commands.rb', line 861

field :table, :two_level_hints_table

#to_hHash

Returns a hash representation of this MachO::LoadCommands::TwolevelHintsCommand.

Returns:



864
865
866
867
868
869
870
# File 'lib/macho/load_commands.rb', line 864

def to_h
  {
    "htoffset" => htoffset,
    "nhints" => nhints,
    "table" => table.hints.map(&:to_h),
  }.merge super
end