Class: MachO::LoadCommands::DylibCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::LoadCommands::DylibCommand
- Defined in:
- lib/macho/load_commands.rb
Overview
A load command representing some aspect of shared libraries, depending on filetype. Corresponds to LC_ID_DYLIB, LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, and LC_REEXPORT_DYLIB.
Instance Method Summary collapse
-
#compatibility_version ⇒ Integer
The library's compatibility version number.
-
#current_version ⇒ Integer
The library's current version number.
-
#name ⇒ LCStr
The library's path name as an LCStr.
-
#serialize(context) ⇒ String
private
The serialized fields of the load command.
-
#timestamp ⇒ Integer
The library's build time stamp.
-
#to_h ⇒ Hash
A hash representation of this DylibCommand.
Methods inherited from LoadCommand
#cmd, #cmdsize, create, new_from_bin, #offset, #serializable?, #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
#compatibility_version ⇒ Integer
Returns the library's compatibility version number.
527 |
# File 'lib/macho/load_commands.rb', line 527 field :compatibility_version, :uint32 |
#current_version ⇒ Integer
Returns the library's current version number.
524 |
# File 'lib/macho/load_commands.rb', line 524 field :current_version, :uint32 |
#name ⇒ LCStr
Returns the library's path name as an LCStr.
518 |
# File 'lib/macho/load_commands.rb', line 518 field :name, :lcstr, :to_s => true |
#serialize(context) ⇒ String
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 the serialized fields of the load command.
533 534 535 536 537 538 539 540 541 |
# File 'lib/macho/load_commands.rb', line 533 def serialize(context) format = Utils.specialize_format(self.class.format, context.endianness) string_payload, string_offsets = Utils.pack_strings(self.class.bytesize, context.alignment, :name => name.to_s) cmdsize = self.class.bytesize + string_payload.bytesize [cmd, cmdsize, string_offsets[:name], , current_version, compatibility_version].pack(format) + string_payload end |
#timestamp ⇒ Integer
Returns the library's build time stamp.
521 |
# File 'lib/macho/load_commands.rb', line 521 field :timestamp, :uint32 |
#to_h ⇒ Hash
Returns a hash representation of this MachO::LoadCommands::DylibCommand.
544 545 546 547 548 549 550 551 |
# File 'lib/macho/load_commands.rb', line 544 def to_h { "name" => name.to_h, "timestamp" => , "current_version" => current_version, "compatibility_version" => compatibility_version, }.merge super end |