Class: Mapi::Pst::ID2Assoc64

Inherits:
Struct
  • Object
show all
Defined in:
lib/mapi/pst.rb

Constant Summary collapse

UNPACK_STR =
'VVT2'
SIZE =
24

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ID2Assoc64

Returns a new instance of ID2Assoc64.



800
801
802
803
804
805
# File 'lib/mapi/pst.rb', line 800

def initialize data
	if String === data
		data = Pst.unpack data, UNPACK_STR
	end
	super(*data)
end

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



796
797
798
# File 'lib/mapi/pst.rb', line 796

def id
  @id
end

#id2Object

Returns the value of attribute id2

Returns:

  • (Object)

    the current value of id2



796
797
798
# File 'lib/mapi/pst.rb', line 796

def id2
  @id2
end

#table2Object

Returns the value of attribute table2

Returns:

  • (Object)

    the current value of table2



796
797
798
# File 'lib/mapi/pst.rb', line 796

def table2
  @table2
end

#u1Object

Returns the value of attribute u1

Returns:

  • (Object)

    the current value of u1



796
797
798
# File 'lib/mapi/pst.rb', line 796

def u1
  @u1
end

Class Method Details

.load_chain(idx) ⇒ Object



807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'lib/mapi/pst.rb', line 807

def self.load_chain idx
	buf = idx.read
	type, count = buf.unpack 'v2'
	unless type == 0x0002
		raise 'unknown id2 type 0x%04x' % type
		#return
	end
	id2 = []
	count.times do |i|
		assoc = new buf[8 + SIZE * i, SIZE]
		id2 << assoc
		if assoc.table2 != 0
			id2 += load_chain idx.pst.idx_from_id(assoc.table2)
		end
	end
	id2
end