module GirFFI::FFIExt::Pointer

Extensions to FFI::Pointer

Public Instance Methods

to_object() click to toggle source

FIXME: Should probably not be here.

# File lib/gir_ffi/ffi_ext/pointer.rb, line 12
def to_object
  return nil if null?

  gtype = GObject.type_from_instance_pointer self
  Builder.build_by_gtype(gtype).direct_wrap self
end
to_ptr() click to toggle source
# File lib/gir_ffi/ffi_ext/pointer.rb, line 7
def to_ptr
  self
end
to_utf8() click to toggle source
# File lib/gir_ffi/ffi_ext/pointer.rb, line 19
def to_utf8
  null? ? nil : read_string.force_encoding("utf-8")
end