Class: Iso9660::Extension

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/iso9660/rock_ridge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, suff) ⇒ Extension

Returns a new instance of Extension.



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/fs/iso9660/rock_ridge.rb', line 247

def initialize(data, suff)
  # Get extension header, length & data.
  @header = RR_EXT_HEADER.decode(data)
  @length = @header['length']
  data = data[RR_EXT_HEADER_SIZE, @length - RR_EXT_HEADER_SIZE]
  # puts "Extension data (from Extension):"
  # data.hex_dump(:obj => STDOUT, :meth => :puts, :newline => false)
  # puts "\n\n"

  # Delegate to extension.
  @ext = case @header['signature']
         when RR_PX_SIGNATURE then PosixAttributes.new(data, suff)
         when RR_PN_SIGNATURE then warnAbout(RR_PN_SIGNATURE, data)
         when RR_SL_SIGNATURE then SymbolicLink.new(data, suff)
         when RR_NM_SIGNATURE then AlternateName.new(data, suff)
         when RR_CL_SIGNATURE then warnAbout(RR_CL_SIGNATURE, data)
         when RR_PL_SIGNATURE then warnAbout(RR_PL_SIGNATURE, data)
         when RR_RE_SIGNATURE then warnAbout(RR_RE_SIGNATURE, data)
         when RR_TF_SIGNATURE then warnAbout(RR_TF_SIGNATURE, data)
         when RR_SF_SIGNATURE then SparseFile.new(data, suff)
         end
end

Instance Attribute Details

#extObject (readonly)

Returns the value of attribute ext.



245
246
247
# File 'lib/fs/iso9660/rock_ridge.rb', line 245

def ext
  @ext
end

#lengthObject (readonly)

Returns the value of attribute length.



245
246
247
# File 'lib/fs/iso9660/rock_ridge.rb', line 245

def length
  @length
end

Instance Method Details

#warnAbout(ext, data) ⇒ Object



270
271
272
273
274
275
276
# File 'lib/fs/iso9660/rock_ridge.rb', line 270

def warnAbout(ext, data)
  if $log
    $log.debug("RR extension #{ext} found, not processed. Data is:")
    data.hex_dump(:obj => $log, :meth => :debug, :newline => false)
  end
  nil
end