struct Bindgen::Crystal::Typename

Overview

Functionality to get typenames of a Parser::Type in Crystal wrapper and binding code.

Defined in:

bindgen/crystal/typename.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Instance Method Summary

Constructor Detail

def self.new(db : TypeDatabase) #

[View source]

Instance Method Detail

def binding(type : Parser::Type) #

The type-name of type for use in a binding.


[View source]
def full(result : Call::Expression, *, expects_type = true) #

Returns the full Crystal type-name of result. If expects_type is false, the type-name may appear in regular code, which affects how pointers and arrays are formatted.


[View source]
def qualified(type_name : String, in_lib : Bool) : String #

Returns the qualified type-name of type_name from the output module. If in_lib is true, the type_name is stored in lib Binding. Else it can is defined outside Binding, and thus doesn't need this prefix.


[View source]
def wrapper(type : Parser::Type) #

The type-name of type for use in a wrapper. The returned tuple contains the name first, and secondly, if the type shall be looked-up in the lib Binding (= true), or not.


[View source]