Class: MachO::LoadCommands::TwolevelHintsCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::LoadCommands::TwolevelHintsCommand
- 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"
- 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
-
#htoffset ⇒ Integer
readonly
The offset to the hint table.
-
#nhints ⇒ Integer
readonly
The number of hints in the hint table.
-
#table ⇒ TwolevelHintsTable
readonly
The hint table.
Attributes inherited from LoadCommand
Instance Method Summary collapse
-
#initialize(view, cmd, cmdsize, htoffset, nhints) ⇒ TwolevelHintsCommand
constructor
private
A new instance of TwolevelHintsCommand.
-
#to_h ⇒ Hash
A hash representation of this TwolevelHintsCommand.
Methods inherited from LoadCommand
create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type
Methods inherited from MachOStructure
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.
1069 1070 1071 1072 1073 1074 |
# File 'lib/macho/load_commands.rb', line 1069 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
#htoffset ⇒ Integer (readonly)
Returns the offset to the hint table.
1051 1052 1053 |
# File 'lib/macho/load_commands.rb', line 1051 def htoffset @htoffset end |
#nhints ⇒ Integer (readonly)
Returns the number of hints in the hint table.
1054 1055 1056 |
# File 'lib/macho/load_commands.rb', line 1054 def nhints @nhints end |
#table ⇒ TwolevelHintsTable (readonly)
Returns the hint table.
1058 1059 1060 |
# File 'lib/macho/load_commands.rb', line 1058 def table @table end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this MachO::LoadCommands::TwolevelHintsCommand.
1077 1078 1079 1080 1081 1082 1083 |
# File 'lib/macho/load_commands.rb', line 1077 def to_h { "htoffset" => htoffset, "nhints" => nhints, "table" => table.hints.map(&:to_h), }.merge super end |