Class: Rbind::GeneratorC::TypesHelper

Inherits:
HelperBase
  • Object
show all
Defined in:
lib/rbind/generator_c.rb

Instance Attribute Summary

Attributes inherited from HelperBase

#includes, #name

Instance Method Summary collapse

Methods inherited from HelperBase

#binding, #wrap_includes

Constructor Details

#initialize(name, root) ⇒ TypesHelper

Returns a new instance of TypesHelper.



59
60
61
62
# File 'lib/rbind/generator_c.rb', line 59

def initialize(name, root)
    super
    @type_wrapper = ERB.new(File.open(File.join(File.dirname(__FILE__),"templates","c","type_delete.h")).read)
end

Instance Method Details

#cdelete_methodObject



64
65
66
# File 'lib/rbind/generator_c.rb', line 64

def cdelete_method
    @root.cdelete_method
end

#type_wrapper(t) ⇒ Object



68
69
70
# File 'lib/rbind/generator_c.rb', line 68

def type_wrapper(t)
    @type_wrapper.result(t.binding)
end

#wrap_typesObject



72
73
74
75
76
77
78
79
# File 'lib/rbind/generator_c.rb', line 72

def wrap_types
    str = ""
    @root.each_type do |type|
        next if type.basic_type?
        str += type_wrapper(type)
    end
    str
end