Module: Spreadsheet::Excel::Reader::Biff5

Defined in:
lib/spreadsheet/excel/reader/biff5.rb

Overview

of Excel grows.

Instance Method Summary collapse

Instance Method Details

#read_string(work, count_length = 1) ⇒ Object

Read a String of 8-bit Characters



11
12
13
14
15
16
17
18
# File 'lib/spreadsheet/excel/reader/biff5.rb', line 11

def read_string work, count_length=1
  # Offset    Size  Contents
  #      0  1 or 2  Length of the string (character count, ln)
  # 1 or 2      ln  Character array (8-bit characters)
  fmt = count_length == 1 ? 'C' : 'v'
  length, = work.unpack fmt
  work[count_length, length]
end