Class: XFS::ShortFormHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/xfs/short_form_header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ShortFormHeader

Returns a new instance of ShortFormHeader.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fs/xfs/short_form_header.rb', line 28

def initialize(data)
  @short_form_header = DIRECTORY_SHORTERFORM_HEADER.decode(data)
  @entry_count       = @short_form_header['entry_count']
  i8byte_count       = @short_form_header['i8byte_count']
  @parent_inode      = @short_form_header['parent_ino_4byte']
  @size              = SIZEOF_DIRECTORY_SHORTERFORM_HEADER
  @small_inode       = true
  if @entry_count == 0
    @entry_count       = i8byte_count
    @short_form_header = DIRECTORY_SHORTFORM_HEADER.decode(data)
    @parent_inode      = @short_form_header['parent_ino_8byte']
    @size              = SIZEOF_DIRECTORY_SHORTFORM_HEADER
    @small_inode       = nil
  end
end

Instance Attribute Details

#entry_countObject (readonly)

Returns the value of attribute entry_count.



26
27
28
# File 'lib/fs/xfs/short_form_header.rb', line 26

def entry_count
  @entry_count
end

#parent_inodeObject (readonly)

Returns the value of attribute parent_inode.



26
27
28
# File 'lib/fs/xfs/short_form_header.rb', line 26

def parent_inode
  @parent_inode
end

#short_form_headerObject (readonly)

Returns the value of attribute short_form_header.



26
27
28
# File 'lib/fs/xfs/short_form_header.rb', line 26

def short_form_header
  @short_form_header
end

#sizeObject (readonly)

Returns the value of attribute size.



26
27
28
# File 'lib/fs/xfs/short_form_header.rb', line 26

def size
  @size
end

#small_inodeObject (readonly)

Returns the value of attribute small_inode.



26
27
28
# File 'lib/fs/xfs/short_form_header.rb', line 26

def small_inode
  @small_inode
end