Class: Ext3::GroupDescriptorEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/ext3/group_descriptor_entry.rb

Overview

//////////////////////////////////////////////////////////////////////////// // Class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf) ⇒ GroupDescriptorEntry

Returns a new instance of GroupDescriptorEntry.



24
25
26
27
28
29
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 24

def initialize(buf)
  raise "Ext3::GroupDescriptorEntry.initialize: Nil buffer" if buf.nil?

  # Decode the group descriptor table entry.
  @gde = GDE.decode(buf)
end

Instance Attribute Details

#blockAllocBmpObject

Returns the value of attribute blockAllocBmp.



22
23
24
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 22

def blockAllocBmp
  @blockAllocBmp
end

#inodeAllocBmpObject

Returns the value of attribute inodeAllocBmp.



22
23
24
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 22

def inodeAllocBmp
  @inodeAllocBmp
end

Instance Method Details

#blockBmpObject

//////////////////////////////////////////////////////////////////////////// // Class helpers & accessors.



34
35
36
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 34

def blockBmp
  @gde['blk_bmp']
end

#dumpObject

Dump object.



54
55
56
57
58
59
60
61
62
63
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 54

def dump
  out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
  out += "Block bitmap      : 0x#{'%08x' % @gde['blk_bmp']}\n"
  out += "Inode bitmap      : 0x#{'%08x' % @gde['inode_bmp']}\n"
  out += "Inode table       : 0x#{'%08x' % @gde['inode_table']}\n"
  out += "Unallocated blocks: 0x#{'%04x' % @gde['unalloc_blks']}\n"
  out += "Unallocated inodes: 0x#{'%04x' % @gde['unalloc_inodes']}\n"
  out += "Num directories   : 0x#{'%04x' % @gde['num_dirs']}\n"
  out
end

#inodeBmpObject



38
39
40
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 38

def inodeBmp
  @gde['inode_bmp']
end

#inodeTableObject



42
43
44
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 42

def inodeTable
  @gde['inode_table']
end

#numDirsObject



46
47
48
# File 'lib/fs/ext3/group_descriptor_entry.rb', line 46

def numDirs
  @gde['num_dirs']
end