Class: NTFS::VolumeName

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/ntfs/attrib_volume_name.rb

Overview

VOLUME_NAME - Attribute: Volume name (0x60).

NOTE: Always resident. NOTE: Present only in FILE_Volume.

Data of this class is not structured.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf) ⇒ VolumeName

Returns a new instance of VolumeName.



18
19
20
21
# File 'lib/fs/ntfs/attrib_volume_name.rb', line 18

def initialize(buf)
  buf   = buf.read(buf.length) if buf.kind_of?(DataRun)
  @name = buf.UnicodeToUtf8
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



16
17
18
# File 'lib/fs/ntfs/attrib_volume_name.rb', line 16

def name
  @name
end

Instance Method Details

#dumpObject



27
28
29
30
31
# File 'lib/fs/ntfs/attrib_volume_name.rb', line 27

def dump
  out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n  "
  out << @name
  out << "---\n"
end

#to_sObject



23
24
25
# File 'lib/fs/ntfs/attrib_volume_name.rb', line 23

def to_s
  @name
end