Sha256: f89767fc7c074f80cb9769d3304c0e0bfbd1713c87bd4f0087339b5b40ea9cd7

Contents?: true

Size: 1.5 KB

Versions: 57

Compression:

Stored size: 1.5 KB

Contents

require 'util/miq-uuid'

module NTFS
  # 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
  #

  class ObjectId
    attr_reader :objectId, :birthVolumeId, :birthObjectId, :domainId

    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

    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
  end
end # module NTFS

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
manageiq-smartstate-0.5.10 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.3.10 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.3.9 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.9 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.8 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.3.8 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.7 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.3.7 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.6 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.3.6 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.5 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.4 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.3.5 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.3 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.2 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.1 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.5.0 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.3.4 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.4.0 lib/fs/ntfs/attrib_object_id.rb
manageiq-smartstate-0.2.18.2 lib/fs/ntfs/attrib_object_id.rb