Class: Ext4::ExtentIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/ext4/extent_index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf) ⇒ ExtentIndex

Returns a new instance of ExtentIndex.



18
19
20
21
22
23
24
# File 'lib/fs/ext4/extent_index.rb', line 18

def initialize(buf)
  raise "Ext4::ExtentIndex.initialize: Nil buffer" if buf.nil?
  @ei = EXTENT_INDEX.decode(buf)

  @block      = @ei['block']
  @leaf       = (@ei['leaf_hi'] << 32) | @ei['leaf_lo']
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



16
17
18
# File 'lib/fs/ext4/extent_index.rb', line 16

def block
  @block
end

#leafObject (readonly)

Returns the value of attribute leaf.



16
17
18
# File 'lib/fs/ext4/extent_index.rb', line 16

def leaf
  @leaf
end

Instance Method Details

#dumpObject



26
27
28
29
30
31
# File 'lib/fs/ext4/extent_index.rb', line 26

def dump
  out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
  out += "Block        : #{@block}\n"
  out += "Leaf         : #{@leaf}\n"
  out
end