Sha256: 42a31240499fb2873c966e0962981723a277b62b81601906b7ad179a189e55bb
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
require 'spreadsheet/encodings' module Spreadsheet module Excel ## # Shared String Table Entry class SstEntry include Encodings attr_accessor :chars, :phonetic, :richtext, :flags, :available, :continued_chars, :wide def initialize opts = {} @offset = opts[:offset] @ole = opts[:ole] @reader = opts[:reader] @continuations = [] end ## # Access the contents of this Shared String def content @content or begin data = nil data = @ole[@offset, @available] content, _ = @reader.read_string_body data, @flags, @available, @wide @continuations.each do |offset, len| @reader.continue_string(@ole[offset,len], [content, @chars]) end content = client content, 'UTF-16LE' if @reader.memoize? @content = content end content end end ## # Register the offset of a String continuation def continue offset, size, chars @continued_chars -= chars @continuations.push [offset, size] end def continued? # :nodoc: @continued_chars > 0 end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
spreadsheet-0.6.0 | lib/spreadsheet/excel/sst_entry.rb |
spreadsheet-0.6.1 | lib/spreadsheet/excel/sst_entry.rb |