Module: GirFFI::FFIExt::Pointer
- Defined in:
- lib/gir_ffi/ffi_ext/pointer.rb
Overview
Extensions to FFI::Pointer
Instance Method Summary collapse
-
#to_object ⇒ Object
FIXME: Should probably not be here.
- #to_ptr ⇒ Object
- #to_utf8 ⇒ Object
- #zero? ⇒ Boolean
Instance Method Details
#to_object ⇒ Object
FIXME: Should probably not be here.
15 16 17 18 19 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 15 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 ⇒ Object
6 7 8 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 6 def to_ptr self end |
#to_utf8 ⇒ Object
21 22 23 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 21 def to_utf8 null? ? nil : read_string.force_encoding('utf-8') end |