Class: NTFS::ObjectId

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

Overview

There is no real data definition for this class - it consists entirely of GUIDs.

struct GUID - GUID structures store globally unique identifiers (GUID).

A GUID is a 128-bit value consisting of one group of eight hexadecimal digits, followed by three groups of four hexadecimal digits each, followed by one group of twelve hexadecimal digits. GUIDs are Microsoft’s implementation of the distributed computing environment (DCE) universally unique identifier (UUID).

Example of a GUID:

1F010768-5A73-BC91-0010-A52216A7227B

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf) ⇒ ObjectId

Returns a new instance of ObjectId.



21
22
23
24
25
26
27
28
29
# File 'lib/fs/ntfs/attrib_object_id.rb', line 21

def initialize(buf)
  raise "MIQ(NTFS::ObjectId.initialize) Nil buffer" if buf.nil?
  buf = buf.read(buf.length) if buf.kind_of?(DataRun)
  len = 16
  @objectId       = UUIDTools::UUID.parse_raw(buf[len * 0, len])
  @birthVolumeId  = UUIDTools::UUID.parse_raw(buf[len * 1, len]) if buf.length > 16
  @birthObjectId  = UUIDTools::UUID.parse_raw(buf[len * 2, len]) if buf.length > 16
  @domainId       = UUIDTools::UUID.parse_raw(buf[len * 3, len]) if buf.length > 16
end

Instance Attribute Details

#birthObjectIdObject (readonly)

Returns the value of attribute birthObjectId.



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

def birthObjectId
  @birthObjectId
end

#birthVolumeIdObject (readonly)

Returns the value of attribute birthVolumeId.



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

def birthVolumeId
  @birthVolumeId
end

#domainIdObject (readonly)

Returns the value of attribute domainId.



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

def domainId
  @domainId
end

#objectIdObject (readonly)

Returns the value of attribute objectId.



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

def objectId
  @objectId
end

Instance Method Details

#dumpObject



31
32
33
34
35
36
37
38
# File 'lib/fs/ntfs/attrib_object_id.rb', line 31

def dump
  out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
  out << "  Object id      : #{@objectId}\n"
  out << "  Birth volume id: #{@birthVolumeId}\n"
  out << "  Birth object id: #{@birthObjectId}\n"
  out << "  Domain id      : #{@domainId}\n"
  out << "---\n"
end