Class: Mapi::Pst
Overview
Read Outlook's pst file
Defined Under Namespace
Classes: Attachment, FormatError, Item, Recipient
Instance Method Summary collapse
-
#each {|message| ... } ⇒ void
Iterate all kind of items recursively stored in this MessageStore.
-
#initialize(io, helper = nil) ⇒ Pst
constructor
A new instance of Pst.
- #inspect ⇒ Object
-
#name ⇒ String
Get this MessageStore's display name.
-
#root ⇒ Item
Obtain a root item.
Constructor Details
#initialize(io, helper = nil) ⇒ Pst
Returns a new instance of Pst.
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/mapi/pst.rb', line 311 def initialize io, helper=nil # corresponds to # * pst_open # * pst_load_index @io = io io.pos = 0 @helper = helper || Helper.new @header = Header.new io.read(Header::SIZE) # would prefer this to be in Header#validate, but it doesn't have the io size. # should perhaps downgrade this to just be a warning... raise FormatError, "header size field invalid (#{header.size} != #{io.size}}" unless header.size == io.size load_block_btree load_node_btree load_xattrib @special_folder_ids = {} end |
Instance Method Details
#each {|message| ... } ⇒ void
This method returns an undefined value.
Iterate all kind of items recursively stored in this MessageStore.
1977 1978 1979 1980 1981 |
# File 'lib/mapi/pst.rb', line 1977 def each(&block) root = self.root block[root] root.each_recursive(&block) end |
#inspect ⇒ Object
1990 1991 1992 |
# File 'lib/mapi/pst.rb', line 1990 def inspect "#<Pst name=#{name.inspect} io=#{io.inspect}>" end |
#name ⇒ String
Get this MessageStore's display name.
1986 1987 1988 |
# File 'lib/mapi/pst.rb', line 1986 def name @name ||= root_item.props.display_name end |