Class: FFI::PCap::ErrorBuffer

Inherits:
Buffer
  • Object
show all
Defined in:
lib/ffi/pcap/error_buffer.rb

Constant Summary collapse

SIZE =

Size of the error buffers

256

Instance Method Summary collapse

Constructor Details

#initialize(ptr = nil) ⇒ ErrorBuffer

Creates a new FFI::PCap::ErrorBuffer object.

Parameters:



14
15
16
17
18
# File 'lib/ffi/pcap/error_buffer.rb', line 14

def initialize(ptr=nil)
  if ptr then super(ptr)
  else        super(SIZE)
  end
end

Instance Method Details

#to_sObject

Returns the error message within the error buffer.



23
24
25
# File 'lib/ffi/pcap/error_buffer.rb', line 23

def to_s
  get_string(0)
end