class Bindgen::TypeDatabase::TypeConfig

Overview

Configuration of types, used in Configuration#types (The types: map in YAML). See TypeDatabase::Configuration.

Included Modules

Defined in:

bindgen/type_database.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(crystal_type : String | Nil = nil, cpp_type : String | Nil = nil, binding_type : String | Nil = nil, from_cpp : Bindgen::Template::Base = Template::None.new, to_cpp : Bindgen::Template::Base = Template::None.new, converter : Nil | String = nil, from_crystal : Bindgen::Template::Base = Template::None.new, to_crystal : Bindgen::Template::Base = Template::None.new, kind : Bindgen::Parser::Type::Kind = Parser::Type::Kind::Class, ignore : Bool = false, pass_by : Bindgen::TypeDatabase::PassBy = PassBy::Original, wrapper_pass_by : PassBy | Nil = nil, sub_class : Bool = true, copy_structure : Bool = false, generate_wrapper : Bool = true, generate_binding : Bool = true, generate_superclass : Bool = true, builtin : Bool = false, ignore_methods : Array(String) = [] of String, superclass_ignore_methods : Regex = Util::FAIL_RX, instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig) = InstanceVariableConfig::Collection.new, graph_node : Bindgen::Graph::Node | Nil = nil) #

[View source]

Instance Method Detail

def anonymous? : Bool #

Is this type anonymous?


[View source]
def binding_type : String | Nil #

The type used in Crystal, but only in the lib binding.


[View source]
def binding_type=(binding_type : String | Nil) #

The type used in Crystal, but only in the lib binding.


[View source]
def builtin=(builtin : Bool) #

Treat this type as built-in type in C++ and Crystal.


[View source]
def builtin? : Bool #

Treat this type as built-in type in C++ and Crystal.


[View source]
def converter : String | Nil #

Converter for this type in Crystal. Takes precedence over the #to_crystal and #from_crystal fields.


[View source]
def converter=(converter : String | Nil) #

Converter for this type in Crystal. Takes precedence over the #to_crystal and #from_crystal fields.


[View source]
def copy_structure=(copy_structure : Bool) #

If the structure (as in, its non-static fields) shall be tried to replicated in Crystal. Implies instance_variables: false. This doesn't support inheritance!


[View source]
def copy_structure? : Bool #

If the structure (as in, its non-static fields) shall be tried to replicated in Crystal. Implies instance_variables: false. This doesn't support inheritance!


[View source]
def cpp_type : String | Nil #

The C++ type to pass it around.


[View source]
def cpp_type=(cpp_type : String | Nil) #

The C++ type to pass it around.


[View source]
def crystal_pass_by : PassBy #

Pass-by configuration in wrapper code. Prefers the #wrapper_pass_by value, and falls back to #pass_by.


[View source]
def crystal_type : String | Nil #

The crystal name of this type.


[View source]
def crystal_type=(crystal_type : String | Nil) #

The crystal name of this type.


[View source]
def from_cpp : Template::Base #

[View source]
def from_cpp=(from_cpp : Template::Base) #

[View source]
def from_crystal : Template::Base #

[View source]
def from_crystal=(from_crystal : Template::Base) #

[View source]
def generate_binding=(generate_binding : Bool) #

If to generate bindings in C++ and Crystal.


[View source]
def generate_binding? : Bool #

If to generate bindings in C++ and Crystal.


[View source]
def generate_superclass=(generate_superclass : Bool) #

If to generate a superclass wrapper in Crystal.


[View source]
def generate_superclass? : Bool #

If to generate a superclass wrapper in Crystal.


[View source]
def generate_wrapper=(generate_wrapper : Bool) #

If to generate a wrapper in Crystal.


[View source]
def generate_wrapper? : Bool #

If to generate a wrapper in Crystal.


[View source]
def graph_node : Graph::Node | Nil #

[View source]
def graph_node=(graph_node : Graph::Node | Nil) #

[View source]
def ignore=(ignore : Bool) #

Ignore any and all methods using this type anywhere.


[View source]
def ignore? : Bool #

Ignore any and all methods using this type anywhere.


[View source]
def ignore_methods : Array(String) #

Which methods to filter out.


[View source]
def ignore_methods=(ignore_methods : Array(String)) #

Which methods to filter out.


[View source]
def instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig) #

[View source]
def instance_variables=(instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig)) #

[View source]

Semantics of the type (Kind overwrite)


[View source]
def kind=(kind : Bindgen::Parser::Type::Kind) #

Semantics of the type (Kind overwrite)


[View source]
def lib_type : String | Nil #

Type name to use in the Crystal lib block. Namespace operators (::) are automatically converted into underscores for types defined in lib Binding.


[View source]
def merge(other : self) : self #

Merges the other rules with these rules. If a rule is set in both rule-sets, the value from other wins.


[View source]

How to pass this type to C++?


[View source]
def pass_by=(pass_by : Bindgen::TypeDatabase::PassBy) #

How to pass this type to C++?


[View source]
def sub_class=(sub_class : Bool) #

If sub-classing of this type is allowed, if it's wrapped and has virtual methods.


[View source]
def sub_class? : Bool #

If sub-classing of this type is allowed, if it's wrapped and has virtual methods.


[View source]
def superclass_ignore_methods : Regex #

[View source]
def superclass_ignore_methods=(superclass_ignore_methods : Regex) #

[View source]
def to_cpp : Template::Base #

[View source]
def to_cpp=(to_cpp : Template::Base) #

[View source]
def to_crystal : Template::Base #

[View source]
def to_crystal=(to_crystal : Template::Base) #

[View source]
def wrapper_pass_by : Bindgen::TypeDatabase::PassBy | Nil #

How to pass this type from Crystal? Defaults to #pass_by.


[View source]
def wrapper_pass_by=(wrapper_pass_by : Bindgen::TypeDatabase::PassBy | Nil) #

How to pass this type from Crystal? Defaults to #pass_by.


[View source]
def wrapper_type : String | Nil #

Type name to use in the Crystal wrapper.


[View source]