Sha256: d70430669f366658e6fb44b02b3e0fe54fdeff0132eccb0d00c5d86d856ecf70
Contents?: true
Size: 768 Bytes
Versions: 2
Compression:
Stored size: 768 Bytes
Contents
# frozen_string_literal: true module GirFFI module FFIExt # Extensions to FFI::Pointer module Pointer def to_ptr self end def zero? null? end # FIXME: Should probably not be here. def to_object return nil if null? gtype = GObject.type_from_instance_pointer self Builder.build_by_gtype(gtype).direct_wrap self end def to_utf8 null? ? nil : read_string.force_encoding('utf-8') end end end end FFI::Pointer.prepend GirFFI::FFIExt::Pointer FFI::Pointer.class_eval do case FFI.type_size(:size_t) when 4 alias_method :get_size_t, :get_uint32 when 8 alias_method :get_size_t, :get_uint64 end alias_method :get_gtype, :get_size_t end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gir_ffi-0.11.1 | lib/gir_ffi/ffi_ext/pointer.rb |
gir_ffi-0.11.0 | lib/gir_ffi/ffi_ext/pointer.rb |