Class: MachO::LoadCommands::RpathCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::LoadCommands::RpathCommand
- Defined in:
- lib/macho/load_commands.rb
Overview
A load command representing an rpath, which specifies a path that should be added to the current run path used to find @rpath prefixed dylibs. Corresponds to LC_RPATH.
Instance Method Summary collapse
-
#path ⇒ LCStr
The path to add to the run path as an LCStr.
-
#serialize(context) ⇒ String
private
The serialized fields of the load command.
-
#to_h ⇒ Hash
A hash representation of this RpathCommand.
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
#path ⇒ LCStr
Returns the path to add to the run path as an LCStr.
1045 |
# File 'lib/macho/load_commands.rb', line 1045 field :path, :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.
1050 1051 1052 1053 1054 1055 1056 1057 |
# File 'lib/macho/load_commands.rb', line 1050 def serialize(context) format = Utils.specialize_format(self.class.format, context.endianness) string_payload, string_offsets = Utils.pack_strings(self.class.bytesize, context.alignment, :path => path.to_s) cmdsize = self.class.bytesize + string_payload.bytesize [cmd, cmdsize, string_offsets[:path]].pack(format) + string_payload end |
#to_h ⇒ Hash
Returns a hash representation of this MachO::LoadCommands::RpathCommand.
1060 1061 1062 1063 1064 |
# File 'lib/macho/load_commands.rb', line 1060 def to_h { "path" => path.to_h, }.merge super end |