Class: Glark::BinaryFile

Inherits:
File
  • Object
show all
Defined in:
lib/glark/io/file/binary_file.rb

Instance Attribute Summary

Attributes inherited from File

#fname

Instance Method Summary collapse

Methods inherited from File

#each_line, #get_line, #get_lines, #get_range_end, #get_range_start, #get_region, #linecount, #search

Constructor Details

#initialize(fname) ⇒ BinaryFile

Returns a new instance of BinaryFile.



8
9
10
11
12
# File 'lib/glark/io/file/binary_file.rb', line 8

def initialize fname
  file = ::File.new fname
  file.binmode            # for MSDOS/WinWhatever
  super fname, file, nil
end

Instance Method Details

#search_as_binary(expr, output_opts) ⇒ Object



14
15
16
17
# File 'lib/glark/io/file/binary_file.rb', line 14

def search_as_binary expr, output_opts
  output_type = BinaryFileSummary.new self, output_opts
  search expr, output_type
end