Class: Mapi::Pst::RawPropertyStoreTable::Row

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

Instance Method Summary collapse

Constructor Details

#initialize(array_parser, x) ⇒ Row

Returns a new instance of Row.



1413
1414
1415
# File 'lib/mapi/pst.rb', line 1413

def initialize array_parser, x
  @array_parser, @x = array_parser, x
end

Instance Method Details

#eachObject

iterate through the property tuples



1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
# File 'lib/mapi/pst.rb', line 1418

def each
  (@array_parser.index_data.length / 8).times do |i|
    ref_type, type, ind2_off, size, slot = @array_parser.index_data[8 * i, 8].unpack 'v3CC'
    # check this rescue too
    value = @array_parser.data3[@x + ind2_off, size]
#         if INDIRECT_TYPES.include? ref_type
    if size <= 4
      value = value.unpack('V')[0]
    end
    #p ['0x%04x' % ref_type, '0x%04x' % type, (Msg::Properties::MAPITAGS['%04x' % type].first[/^.._(.*)/, 1].downcase rescue nil),
    #   value_orig, value, (get_data_indirect(value_orig.unpack('V')[0]) rescue nil), size, ind2_off, slot]
    key, type, value = @array_parser.handle_indirect_values type, ref_type, value
    yield key, type, value
  end
end