Class: FFI::StrPtrConverter

Inherits:
Object
  • Object
show all
Extended by:
DataConverter
Defined in:
lib/ffi/types.rb

Class Method Summary collapse

Methods included from DataConverter

from_native, native_type, to_native

Class Method Details

.from_native(val, ctx) ⇒ Array(String, Pointer)

Returns a [ String, Pointer ] tuple so the C memory for the string can be freed

Parameters:

Returns:



161
162
163
# File 'lib/ffi/types.rb', line 161

def self.from_native(val, ctx)
  [ val.null? ? nil : val.get_string(0), val ]
end