Sha256: 437a5595a57b09167626c430e97a39d6111b55aa5d4159d7bc3ebd436a215234

Contents?: true

Size: 1.12 KB

Versions: 13

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

module GObjectIntrospection
  # Wraps a GITypeInfo struct.
  # Represents type information, direction, transfer etc.
  class ITypeInfo < IBaseInfo
    def pointer?
      return @pointer_eh if defined? @pointer_eh

      @pointer_eh = Lib.g_type_info_is_pointer self
    end

    def tag
      @tag ||= Lib.g_type_info_get_tag self
    end

    def param_type(index)
      @param_type_cache ||= []
      @param_type_cache[index] ||=
        ITypeInfo.wrap Lib.g_type_info_get_param_type(self, index)
    end

    def interface
      @interface ||= begin
                       ptr = Lib.g_type_info_get_interface self
                       IRepository.wrap_ibaseinfo_pointer ptr
                     end
    end

    def array_length
      @array_length ||= Lib.g_type_info_get_array_length self
    end

    def array_fixed_size
      Lib.g_type_info_get_array_fixed_size self
    end

    def array_type
      Lib.g_type_info_get_array_type self
    end

    def zero_terminated?
      Lib.g_type_info_is_zero_terminated self
    end

    def name
      raise "Should not call this for ITypeInfo"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gir_ffi-0.17.0 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.16.1 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.16.0 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.9 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.8 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.7 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.6 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.5 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.4 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.3 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.2 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.1 lib/ffi-gobject_introspection/i_type_info.rb
gir_ffi-0.15.0 lib/ffi-gobject_introspection/i_type_info.rb