Class: Ext4::HashTreeHeader

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf) ⇒ HashTreeHeader

Returns a new instance of HashTreeHeader.



19
20
21
22
23
24
25
26
# File 'lib/fs/ext4/hash_tree_header.rb', line 19

def initialize(buf)
  raise "Ext4::HashTreeHeader.initialize: Nil buffer" if buf.nil?
  @hth = HASH_TREE_HEADER.decode(buf)

  @hash_version = @hth['hash_ver']
  @length       = @hth['length']
  @leaf_level   = @hth['leaf_level']
end

Instance Attribute Details

#hash_versionObject (readonly)

Returns the value of attribute hash_version.



17
18
19
# File 'lib/fs/ext4/hash_tree_header.rb', line 17

def hash_version
  @hash_version
end

#leaf_levelObject (readonly)

Returns the value of attribute leaf_level.



17
18
19
# File 'lib/fs/ext4/hash_tree_header.rb', line 17

def leaf_level
  @leaf_level
end

#lengthObject (readonly)

Returns the value of attribute length.



17
18
19
# File 'lib/fs/ext4/hash_tree_header.rb', line 17

def length
  @length
end

Instance Method Details

#dumpObject



28
29
30
31
32
33
# File 'lib/fs/ext4/hash_tree_header.rb', line 28

def dump
  out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
  out += "Hash Version : #{@hash_version}\n"
  out += "Length       : #{@length}\n"
  out += "Leaf Level   : #{@leaf_level}\n"
end