class Origami::XRefStream
Constants
- Index
- Size
- W
- XREF_COMPRESSED
- XREF_FREE
- XREF_USED
Public Class Methods
new(data = "", dictionary = {})
click to toggle source
Calls superclass method
Origami::Stream.new
# File lib/origami/xreftable.rb, line 337 def initialize(data = "", dictionary = {}) super(data, dictionary) @xrefs = nil end
Public Instance Methods
<<(xref)
click to toggle source
clear()
click to toggle source
# File lib/origami/xreftable.rb, line 401 def clear self.data = '' @xrefs = [] self.Index = [] end
each(&b)
click to toggle source
Iterates over each XRef present in the stream.
# File lib/origami/xreftable.rb, line 375 def each(&b) load! if @xrefs.nil? @xrefs.each(&b) end
entries()
click to toggle source
# File lib/origami/xreftable.rb, line 343 def entries load! if @xrefs.nil? @xrefs end
find(no)
click to toggle source
Returns an XRef matching this object number.
# File lib/origami/xreftable.rb, line 384 def find(no) load! if @xrefs.nil? ranges = self.Index || [ 0, @xrefs.length ] index = 0 (ranges.size / 2).times do |i| brange = ranges[i*2].to_i size = ranges[i*2+1].to_i return @xrefs[index + no - brange] if Range.new(brange, brange + size - 1) === no index += size end nil end