Class: Mapi::Pst::RangesIOIdxChain
- Inherits:
-
RangesIOEncryptable
- Object
- RangesIO
- RangesIOEncryptable
- Mapi::Pst::RangesIOIdxChain
- Defined in:
- lib/mapi/pst.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(pst, idx_head) ⇒ RangesIOIdxChain
constructor
A new instance of RangesIOIdxChain.
Methods inherited from RangesIOEncryptable
Constructor Details
#initialize(pst, idx_head) ⇒ RangesIOIdxChain
Returns a new instance of RangesIOIdxChain.
887 888 889 890 891 892 893 894 895 896 897 898 |
# File 'lib/mapi/pst.rb', line 887 def initialize pst, idx_head @idxs = pst.id2_block_idx_chain idx_head # whether or not a given idx needs encrypting decrypts = @idxs.map do |idx| decrypt = (idx.id & 2) != 0 ? false : pst.encrypted? end.uniq raise NotImplementedError, 'partial encryption in RangesIOID2' if decrypts.length > 1 decrypt = decrypts.first # convert idxs to ranges ranges = @idxs.map { |idx| [idx.offset, idx.size] } super pst.io, :ranges => ranges, :decrypt => decrypt end |