Module: GirFFI::FFIExt::Pointer
- Defined in:
- lib/gir_ffi/ffi_ext/pointer.rb
Overview
Extensions to FFI::Pointer
Instance Method Summary collapse
Instance Method Details
#to_object ⇒ Object
17 18 19 20 21 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 17 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_ptr ⇒ Object
5 6 7 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 5 def to_ptr self end |
#to_utf8 ⇒ Object
23 24 25 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 23 def to_utf8 null? ? nil : read_string.force_encoding("utf-8") end |
#to_value ⇒ Object
9 10 11 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 9 def to_value self end |
#zero? ⇒ Boolean
13 14 15 |
# File 'lib/gir_ffi/ffi_ext/pointer.rb', line 13 def zero? null? end |