Sha256: d927245f07ded8e3b07432c5d7daa90e6259d1c60560b10fd719d0d03de15a1f

Contents?: true

Size: 885 Bytes

Versions: 7

Compression:

Stored size: 885 Bytes

Contents

module GirFFI
  # Wraps a GIStructInfo struct.
  # Represents a struct.
  class IStructInfo < IRegisteredTypeInfo
    def n_fields
      Lib.g_struct_info_get_n_fields @gobj
    end
    def field(index)
      IFieldInfo.wrap(Lib.g_struct_info_get_field @gobj, index)
    end

    ##
    build_array_method :fields

    def get_n_methods
      Lib.g_struct_info_get_n_methods @gobj
    end
    def get_method(index)
      IFunctionInfo.wrap(Lib.g_struct_info_get_method @gobj, index)
    end

    ##
    build_array_method :get_methods

    def find_method(name)
      @methods_hash ||= get_methods.inject({}) {|h,m| h[m.name] = m; h}
      @methods_hash[name]
    end

    def size
      Lib.g_struct_info_get_size @gobj
    end
    def alignment
      Lib.g_struct_info_get_alignment @gobj
    end
    def gtype_struct?
      Lib.g_struct_info_is_gtype_struct @gobj
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gir_ffi-0.0.14 lib/gir_ffi/i_struct_info.rb
gir_ffi-0.0.13 lib/gir_ffi/i_struct_info.rb
gir_ffi-0.0.12 lib/gir_ffi/i_struct_info.rb
gir_ffi-0.0.11 lib/gir_ffi/i_struct_info.rb
gir_ffi-0.0.10 lib/gir_ffi/i_struct_info.rb
gir_ffi-0.0.9 lib/gir_ffi/i_struct_info.rb
gir_ffi-0.0.8 lib/gir_ffi/i_struct_info.rb