Sha256: ce50284bb35235f0ee85444424855c0dd55aa4da193cce7bbe51c2d6ce156c04

Contents?: true

Size: 667 Bytes

Versions: 2

Compression:

Stored size: 667 Bytes

Contents

class Sparkey::LogReader
  include Sparkey::Errors

  def open(filename)
    log_filename = "#{filename}.spl"
    ptr = FFI::MemoryPointer.new(:pointer)

    handle_status Sparkey::Native.logreader_open(ptr, log_filename)

    @log_reader_ptr = ptr.read_pointer
  end

  def close
    ptr = FFI::MemoryPointer.new(:pointer).write_pointer(@log_reader_ptr)

    Sparkey::Native.logreader_close(ptr)
  end

  def max_key_length
    Sparkey::Native.logreader_maxkeylen(@log_reader_ptr)
  end

  def max_value_length
    Sparkey::Native.logreader_maxvaluelen(@log_reader_ptr)
  end

  def ptr=(ptr)
    @log_reader_ptr = ptr
  end

  def ptr
    @log_reader_ptr
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sparkey-1.2.0 lib/sparkey/log_reader.rb
sparkey-1.1.0 lib/sparkey/log_reader.rb