Class: Mapi::Pst::AttachmentTable
- Inherits:
-
BlockParser
- Object
- BlockParser
- Mapi::Pst::AttachmentTable
- Defined in:
- lib/mapi/pst.rb
Constant Summary collapse
- PR_ATTACHMENT_ID2 =
a “fake” MAPI property name for this constant. if you get a mapi property with this value, it is the id2 value to use to get attachment data.
0x67f2
Constants inherited from BlockParser
BlockParser::ID2_ATTACHMENTS, BlockParser::ID2_RECIPIENTS, BlockParser::IMMEDIATE_TYPES, BlockParser::INDIRECT_TYPES, BlockParser::PR_BODY_HTML, BlockParser::PR_SUBJECT, BlockParser::TYPES, BlockParser::USE_MAIN_DATA
Instance Attribute Summary collapse
- #node ⇒ NodePtr readonly
- #table ⇒ RawPropertyStoreTable readonly
Attributes inherited from BlockParser
Instance Method Summary collapse
-
#initialize(node) ⇒ AttachmentTable
constructor
A new instance of AttachmentTable.
- #to_a ⇒ Array<Array<Array(Integer, Integer, Object)>>
Methods inherited from BlockParser
#get_data_array, #get_data_indirect, #get_data_indirect_io, #handle_indirect_values, #load_page_header, #load_root_header
Constructor Details
#initialize(node) ⇒ AttachmentTable
Returns a new instance of AttachmentTable.
1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 |
# File 'lib/mapi/pst.rb', line 1553 def initialize node @node = node # no super, we only actually want BlockParser2#idx2 #@table = nil #return unless node.sub_block #return unless block = sub_block[ID2_ATTACHMENTS] ## FIXME make a fake desc. #@fake_node = OpenStruct.new :block => block, :pst => node.pst, :sub_block => node.sub_block if @node.has_sub ID2_ATTACHMENTS @table = RawPropertyStoreTable.new @node, ID2_ATTACHMENTS else @table = [] end end |
Instance Attribute Details
#table ⇒ RawPropertyStoreTable (readonly)
1550 1551 1552 |
# File 'lib/mapi/pst.rb', line 1550 def table @table end |
Instance Method Details
#to_a ⇒ Array<Array<Array(Integer, Integer, Object)>>
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 |
# File 'lib/mapi/pst.rb', line 1569 def to_a return [] if !table table.map do || = .to_a # potentially merge with yet more properties # this still seems pretty broken - especially the property overlap if = .assoc(PR_ATTACHMENT_ID2) # verify existence of this record if @node.has_sub .last RawPropertyStore.new(@node, .last).each do |a, b, c| record = .assoc a << record = [] unless record record.replace [a, b, c] end else warn "attachment record is missing" end end end end |