Sha256: 0ec52026f3e8d083225c8393c0ea2fa740c0c7ef51cb3abfa8fbac00c1f32880
Contents?: true
Size: 1011 Bytes
Versions: 66
Compression:
Stored size: 1011 Bytes
Contents
require 'binary_struct' module Ext4 # //////////////////////////////////////////////////////////////////////////// # // Data definitions. HASH_TREE_HEADER = BinaryStruct.new([ 'L', 'unused1', # Unused. 'C', 'hash_ver', # Hash version. 'C', 'length', # Length of this structure. 'C', 'leaf_level', # Levels of leaves. 'C', 'unused2', # Unused. ]) SIZEOF_HASH_TREE_HEADER = HASH_TREE_HEADER.size class HashTreeHeader attr_reader :hash_version, :length, :leaf_level 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 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 end end
Version data entries
66 entries across 66 versions & 1 rubygems