Module: GirFFI::FFIExt::Pointer

Defined in:
lib/gir_ffi/ffi_ext/pointer.rb

Instance Method Summary collapse

Instance Method Details

#to_objectObject



16
17
18
19
20
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 16

def to_object
  return nil if self.null?
  gtype = GObject.type_from_instance_pointer self
  Builder.build_by_gtype(gtype).direct_wrap self
end

#to_ptrObject



4
5
6
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 4

def to_ptr
  self
end

#to_utf8Object



22
23
24
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 22

def to_utf8
  null? ? nil : read_string.force_encoding("utf-8")
end

#to_valueObject



8
9
10
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 8

def to_value
  self
end

#zero?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 12

def zero?
  null?
end