Class: NTFS::IndexNodeHeader
- Inherits:
-
Object
- Object
- NTFS::IndexNodeHeader
- Defined in:
- lib/fs/ntfs/index_node_header.rb
Overview
Here follows a list of IndexNodeEntries.
Constant Summary collapse
- NH_HAS_CHILDREN =
0x0001
Instance Attribute Summary collapse
-
#endEntries ⇒ Object
readonly
Returns the value of attribute endEntries.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#startEntries ⇒ Object
readonly
Returns the value of attribute startEntries.
Instance Method Summary collapse
- #dump ⇒ Object
- #hasChildren? ⇒ Boolean
-
#initialize(buf) ⇒ IndexNodeHeader
constructor
A new instance of IndexNodeHeader.
- #to_s ⇒ Object
Constructor Details
#initialize(buf) ⇒ IndexNodeHeader
Returns a new instance of IndexNodeHeader.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fs/ntfs/index_node_header.rb', line 41 def initialize(buf) raise "MIQ(NTFS::IndexNodeHeader.initialize) Nil buffer" if buf.nil? buf = buf.read(buf.length) if buf.kind_of?(DataRun) @inh = INDEX_NODE_HEADER.decode(buf) # Get accessor data. @flags = @inh['flags'] @endEntries = @inh['index_length'] @startEntries = @inh['entries_offset'] end |
Instance Attribute Details
#endEntries ⇒ Object (readonly)
Returns the value of attribute endEntries.
39 40 41 |
# File 'lib/fs/ntfs/index_node_header.rb', line 39 def endEntries @endEntries end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
39 40 41 |
# File 'lib/fs/ntfs/index_node_header.rb', line 39 def flags @flags end |
#startEntries ⇒ Object (readonly)
Returns the value of attribute startEntries.
39 40 41 |
# File 'lib/fs/ntfs/index_node_header.rb', line 39 def startEntries @startEntries end |
Instance Method Details
#dump ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/fs/ntfs/index_node_header.rb', line 60 def dump out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n" out << " Entries Offset : #{@startEntries}\n" out << " Index Length : #{@endEntries}\n" out << " Allocated Size : #{@inh['allocated_size']}\n" out << " Flags : 0x#{'%08x' % @flags}\n" out << "---\n" end |
#hasChildren? ⇒ Boolean
56 57 58 |
# File 'lib/fs/ntfs/index_node_header.rb', line 56 def hasChildren? (@flags & NH_HAS_CHILDREN) == NH_HAS_CHILDREN end |
#to_s ⇒ Object
52 53 54 |
# File 'lib/fs/ntfs/index_node_header.rb', line 52 def to_s "0x#{'%08x' % @flags}" end |