Class: GObjectIntrospection::IStructInfo

Inherits:
IRegisteredTypeInfo show all
Defined in:
lib/ffi-gobject_introspection/i_struct_info.rb

Overview

Wraps a GIStructInfo struct. Represents a struct.

Instance Attribute Summary

Attributes inherited from IBaseInfo

#pointer

Instance Method Summary collapse

Methods inherited from IRegisteredTypeInfo

#g_type, #type_init, #type_name

Methods included from GirFFI::InfoExt::FullTypeName

#full_type_name

Methods included from GirFFI::InfoExt::SafeConstantName

#safe_name

Methods included from GirFFI::InfoExt::IRegisteredTypeInfo

#find_instance_method, #find_method, #to_callback_ffi_type, #to_ffi_type, #to_type

Methods inherited from IBaseInfo

#==, #attribute, build_array_method, build_finder_method, #container, #deprecated?, #info_type, #initialize, make_finalizer, #name, #namespace, #safe_namespace, #to_ptr, wrap

Constructor Details

This class inherits a constructor from GObjectIntrospection::IBaseInfo

Instance Method Details

#alignmentObject



41
42
43
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 41

def alignment
  Lib.g_struct_info_get_alignment self
end

#empty?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 37

def empty?
  size == 0
end

#field(index) ⇒ Object



11
12
13
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 11

def field(index)
  IFieldInfo.wrap Lib.g_struct_info_get_field(self, index)
end

#get_method(index) ⇒ Object



23
24
25
26
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 23

def get_method(index)
  @method_cache ||= []
  @method_cache[index] ||= IFunctionInfo.wrap Lib.g_struct_info_get_method(self, index)
end

#get_n_methodsObject



19
20
21
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 19

def get_n_methods
  Lib.g_struct_info_get_n_methods self
end

#gtype_struct?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 45

def gtype_struct?
  Lib.g_struct_info_is_gtype_struct self
end

#n_fieldsObject



7
8
9
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 7

def n_fields
  Lib.g_struct_info_get_n_fields self
end

#sizeObject



33
34
35
# File 'lib/ffi-gobject_introspection/i_struct_info.rb', line 33

def size
  Lib.g_struct_info_get_size self
end