class
Bindgen::TypeDatabase::TypeConfig
- Bindgen::TypeDatabase::TypeConfig
- Reference
- Object
Overview
Configuration of types, used in Configuration#types (The types: map
in YAML). See TypeDatabase::Configuration.
Included Modules
- YAML::Serializable
Defined in:
bindgen/type_database.crConstructors
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .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, bit_fields : Bindgen::TypeDatabase::BitFields = BitFields::Accessors, generate_wrapper : Bool = true, generate_binding : Bool = true, generate_superclass : Bool = true, builtin : Bool = false, ignore_methods : Array(Bindgen::TypeDatabase::MethodPattern) = [] of MethodPattern, declare_methods : Array(String) = [] of String, shadowed_by : Array(String) = [] of String, rename : Hash(Bindgen::TypeDatabase::MethodPattern, String) = {} of MethodPattern => String, nilable : Hash(Bindgen::TypeDatabase::MethodPattern, Array(Int32) | Bool) = {} of MethodPattern => Bool | Array(Int32), out_arguments : Hash(Bindgen::TypeDatabase::MethodPattern, Array(Int32) | Bool) = {} of MethodPattern => Bool | Array(Int32), superclass_ignore_methods : Regex = Util::FAIL_RX, keep_alive : Hash(Regex, Nil | Array(Int32)) = KeepAlive.new, release : Hash(Regex, Nil | Array(Int32)) = KeepAlive.new, depends_on : Hash(Regex, Nil | Array(Int32)) = KeepAlive.new, parent_arguments : Array(String) = [] of String, instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig) = InstanceVariableConfig::Collection.new, graph_node : Bindgen::Graph::Node | Nil = nil, container_type : Nil | String = nil, kind_present : Bool = false)
Instance Method Summary
-
#anonymous? : Bool
Is this type anonymous?
-
#binding_type : String | Nil
The type used in Crystal, but only in the
libbinding. -
#binding_type=(binding_type : String | Nil)
The type used in Crystal, but only in the
libbinding. -
#bit_fields : Bindgen::TypeDatabase::BitFields
How the
lib structof a copied structure accesses its bit-fields. -
#bit_fields=(bit_fields : Bindgen::TypeDatabase::BitFields)
How the
lib structof a copied structure accesses its bit-fields. -
#builtin=(builtin : Bool)
Treat this type as built-in type in C++ and Crystal.
-
#builtin? : Bool
Treat this type as built-in type in C++ and Crystal.
-
#container_type : String | Nil
The name of the Crystal container module this type includes, if any.
-
#container_type=(container_type : String | Nil)
The name of the Crystal container module this type includes, if any.
-
#converter : String | Nil
Converter for this type in Crystal.
-
#converter=(converter : String | Nil)
Converter for this type in Crystal.
-
#copy_structure=(copy_structure : Bool)
If the structure (as in, its non-static fields) shall be tried to replicated in Crystal.
-
#copy_structure? : Bool
If the structure (as in, its non-static fields) shall be tried to replicated in Crystal.
-
#cpp_type : String | Nil
The C++ type to pass it around.
-
#cpp_type=(cpp_type : String | Nil)
The C++ type to pass it around.
-
#crystal_pass_by : PassBy
Pass-by configuration in wrapper code.
-
#crystal_type : String | Nil
The crystal name of this type.
-
#crystal_type=(crystal_type : String | Nil)
The crystal name of this type.
-
#declare_methods : Array(String)
C++ declarations of methods the parser doesn't report, like the instantiations of template members:
QMenu *menu() const,void setMenu(QMenu *menu). -
#declare_methods=(declare_methods : Array(String))
C++ declarations of methods the parser doesn't report, like the instantiations of template members:
QMenu *menu() const,void setMenu(QMenu *menu). -
#depends_on : Hash(Regex, Array(Int32)?)
Constructors whose object refers to some of its arguments from memory the GC doesn't scan, and uses them when destroyed.
-
#depends_on=(depends_on : Hash(Regex, Nil | Array(Int32)))
Constructors whose object refers to some of its arguments from memory the GC doesn't scan, and uses them when destroyed.
-
#from_cpp : Template::Base
Template code ran to turn the real C++ type into the crystal type.
-
#from_cpp=(from_cpp : Template::Base)
Template code ran to turn the real C++ type into the crystal type.
-
#from_crystal : Template::Base
Template code ran to turn the Crystal type for the binding.
-
#from_crystal=(from_crystal : Template::Base)
Template code ran to turn the Crystal type for the binding.
-
#generate_binding=(generate_binding : Bool)
If to generate bindings in C++ and Crystal.
-
#generate_binding? : Bool
If to generate bindings in C++ and Crystal.
-
#generate_superclass=(generate_superclass : Bool)
If to generate a superclass wrapper in Crystal.
-
#generate_superclass? : Bool
If to generate a superclass wrapper in Crystal.
-
#generate_wrapper=(generate_wrapper : Bool)
If to generate a wrapper in Crystal.
-
#generate_wrapper? : Bool
If to generate a wrapper in Crystal.
-
#graph_node : Graph::Node | Nil
The node this type is represented by in the graph, if any
-
#graph_node=(graph_node : Graph::Node | Nil)
The node this type is represented by in the graph, if any
-
#ignore=(ignore : Bool)
Ignore any and all methods using this type anywhere.
-
#ignore? : Bool
Ignore any and all methods using this type anywhere.
-
#ignore_method?(method : Parser::Method) : Bool
Does an entry of
#ignore_methodsmatch the method? -
#ignore_methods : Array(Bindgen::TypeDatabase::MethodPattern)
Which methods to filter out, by name, signature or regular expression.
-
#ignore_methods=(ignore_methods : Array(Bindgen::TypeDatabase::MethodPattern))
Which methods to filter out, by name, signature or regular expression.
-
#instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig)
Instance variable configuration.
-
#instance_variables=(instance_variables : Hash(Regex, Bindgen::TypeDatabase::InstanceVariableConfig))
Instance variable configuration.
-
#keep_alive : Hash(Regex, Array(Int32)?)
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. -
#keep_alive=(keep_alive : Hash(Regex, Nil | Array(Int32)))
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. -
#kind : Bindgen::Parser::Type::Kind
Semantics of the type (Kind overwrite)
-
#kind=(kind : Bindgen::Parser::Type::Kind)
Semantics of the type (Kind overwrite)
-
#kind_present? : Bool
Whether
kind:was given in the YAML configuration. -
#lib_type : String | Nil
Type name to use in the Crystal
libblock. -
#merge(other : self) : self
Merges the other rules with these rules.
-
#nilable : Hash(Bindgen::TypeDatabase::MethodPattern, Array(Int32) | Bool)
Nilability of the pointer result and arguments of methods, by
MethodPatternentries:trueorfalsemakes the resultT?orT, regardless ofnilable_results, and a list of argument indices makes those arguments acceptnil, like one defaulting tonullptrdoes:menuBar: false,setModel: [0]. -
#nilable=(nilable : Hash(Bindgen::TypeDatabase::MethodPattern, Array(Int32) | Bool))
Nilability of the pointer result and arguments of methods, by
MethodPatternentries:trueorfalsemakes the resultT?orT, regardless ofnilable_results, and a list of argument indices makes those arguments acceptnil, like one defaulting tonullptrdoes:menuBar: false,setModel: [0]. -
#nilable_arguments(method : Parser::Method) : Array(Int32)
The indices of the arguments of the method
#nilablemakes acceptnil. -
#nilable_result?(method : Parser::Method) : Bool | Nil
Is the result of the method nilable by
#nilable?nilif no entry says. -
#out_arguments : Hash(Bindgen::TypeDatabase::MethodPattern, Array(Int32) | Bool)
Which arguments of methods are out arguments (SPEC.md §2.2.5), by the entries of
#ignore_methods:truemakes every non-const reference and single pointer to a converted value type, a built-in type or an enum one, a pointer to a byte or character type included,falsenone, and a list of argument indices those among them:copyTo: false,readByte: true,two: [1]. -
#out_arguments=(out_arguments : Hash(Bindgen::TypeDatabase::MethodPattern, Array(Int32) | Bool))
Which arguments of methods are out arguments (SPEC.md §2.2.5), by the entries of
#ignore_methods:truemakes every non-const reference and single pointer to a converted value type, a built-in type or an enum one, a pointer to a byte or character type included,falsenone, and a list of argument indices those among them:copyTo: false,readByte: true,two: [1]. -
#out_arguments_for(method : Parser::Method) : Bool | Array(Int32) | Nil
The
#out_argumentsentry for the method, if any: the first matching. -
#parent_arguments : Array(String)
Names of the constructor arguments giving the object a parent, which owns and deletes it, like
QTreeWidgetItem(QTreeWidget *treeview). -
#parent_arguments=(parent_arguments : Array(String))
Names of the constructor arguments giving the object a parent, which owns and deletes it, like
QTreeWidgetItem(QTreeWidget *treeview). -
#pass_by : Bindgen::TypeDatabase::PassBy
How to pass this type to C++?
-
#pass_by=(pass_by : Bindgen::TypeDatabase::PassBy)
How to pass this type to C++?
-
#release : Hash(Regex, Array(Int32)?)
Methods handing an object back, which C++ stops using: their selected object arguments, and their object result if all arguments are selected, are passed to
BindgenHelper.release. -
#release=(release : Hash(Regex, Nil | Array(Int32)))
Methods handing an object back, which C++ stops using: their selected object arguments, and their object result if all arguments are selected, are passed to
BindgenHelper.release. -
#rename : Hash(Bindgen::TypeDatabase::MethodPattern, String)
Crystal names of methods, by
MethodPatternentries like#ignore_methods:raise: raise_. -
#rename=(rename : Hash(Bindgen::TypeDatabase::MethodPattern, String))
Crystal names of methods, by
MethodPatternentries like#ignore_methods:raise: raise_. -
#rename_for(method : Parser::Method) : String | Nil
The Crystal name
#renamegives the method, if any. -
#shadowed_by : Array(String)
Types whose overloads shadow those taking this type: an overload of a method taking this type is dropped where another overload takes one of these types in its place, with the other arguments equal.
-
#shadowed_by=(shadowed_by : Array(String))
Types whose overloads shadow those taking this type: an overload of a method taking this type is dropped where another overload takes one of these types in its place, with the other arguments equal.
-
#sub_class=(sub_class : Bool)
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
-
#sub_class? : Bool
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
-
#superclass_ignore_methods : Regex
Which methods to filter out in the superclass wrapper.
-
#superclass_ignore_methods=(superclass_ignore_methods : Regex)
Which methods to filter out in the superclass wrapper.
-
#to_cpp : Template::Base
Template code ran to turn the crystal type into the real C++ type.
-
#to_cpp=(to_cpp : Template::Base)
Template code ran to turn the crystal type into the real C++ type.
-
#to_crystal : Template::Base
Template code ran to turn the binding type to Crystal.
-
#to_crystal=(to_crystal : Template::Base)
Template code ran to turn the binding type to Crystal.
-
#wrapper_pass_by : Bindgen::TypeDatabase::PassBy | Nil
How to pass this type from Crystal? Defaults to
#pass_by. -
#wrapper_pass_by=(wrapper_pass_by : Bindgen::TypeDatabase::PassBy | Nil)
How to pass this type from Crystal? Defaults to
#pass_by. -
#wrapper_type : String | Nil
Type name to use in the Crystal wrapper.
Constructor Detail
Instance Method Detail
The type used in Crystal, but only in the lib binding.
How the lib struct of a copied structure accesses its bit-fields.
How the lib struct of a copied structure accesses its bit-fields.
The name of the Crystal container module this type includes, if any.
Used by CrystalContainerOf.
The name of the Crystal container module this type includes, if any.
Used by CrystalContainerOf.
Converter for this type in Crystal. Takes precedence over the
#to_crystal and #from_crystal fields.
Converter for this type in Crystal. Takes precedence over the
#to_crystal and #from_crystal fields.
If the structure (as in, its non-static fields) shall be tried to
replicated in Crystal. Implies instance_variables: false, unless a
wrapper class hosts the structure (see TypeHelper#structure_hosted?).
This doesn't support inheritance!
If the structure (as in, its non-static fields) shall be tried to
replicated in Crystal. Implies instance_variables: false, unless a
wrapper class hosts the structure (see TypeHelper#structure_hosted?).
This doesn't support inheritance!
Pass-by configuration in wrapper code. Prefers the #wrapper_pass_by
value, and falls back to #pass_by.
C++ declarations of methods the parser doesn't report, like the
instantiations of template members: QMenu *menu() const,
void setMenu(QMenu *menu). Parsed by Parser::Method.from_signature
and added to the class, the C++ glue calls them like any method.
C++ declarations of methods the parser doesn't report, like the
instantiations of template members: QMenu *menu() const,
void setMenu(QMenu *menu). Parsed by Parser::Method.from_signature
and added to the class, the C++ glue calls them like any method.
Constructors whose object refers to some of its arguments from memory
the GC doesn't scan, and uses them when destroyed. The C++ glue stores
these in the object, so the GC destroys it first. Same format as
#keep_alive.
Constructors whose object refers to some of its arguments from memory
the GC doesn't scan, and uses them when destroyed. The C++ glue stores
these in the object, so the GC destroys it first. Same format as
#keep_alive.
Template code ran to turn the real C++ type into the crystal type.
Template code ran to turn the Crystal type for the binding.
If to generate a superclass wrapper in Crystal.
The node this type is represented by in the graph, if any
Does an entry of #ignore_methods match the method?
Which methods to filter out, by name, signature or regular expression.
See MethodPattern.
Which methods to filter out, by name, signature or regular expression.
See MethodPattern.
Instance variable configuration. Each hash key is a regex used to match instance variable names.
Instance variable configuration. Each hash key is a regex used to match instance variable names.
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. Each key is
a regex matched against the method name.
Methods whose object arguments are kept alive by
BindgenHelper.keep_alive, as C++ keeps a pointer to them. Each key is
a regex matched against the method name.
Type name to use in the Crystal lib block. Namespace operators (::)
are automatically converted into underscores for types defined in
lib Binding.
Merges the other rules with these rules. If a rule is set in both rule-sets, the value from other wins.
Nilability of the pointer result and arguments of methods, by
MethodPattern entries: true or false makes the result T? or
T, regardless of nilable_results, and a list of argument indices
makes those arguments accept nil, like one defaulting to nullptr
does: menuBar: false, setModel: [0].
Nilability of the pointer result and arguments of methods, by
MethodPattern entries: true or false makes the result T? or
T, regardless of nilable_results, and a list of argument indices
makes those arguments accept nil, like one defaulting to nullptr
does: menuBar: false, setModel: [0].
The indices of the arguments of the method #nilable makes accept
nil.
Is the result of the method nilable by #nilable? nil if no entry
says.
Which arguments of methods are out arguments (SPEC.md §2.2.5), by the
entries of #ignore_methods: true makes every non-const reference and
single pointer to a converted value type, a built-in type or an enum
one, a pointer to a byte or character type included, false none,
and a list of argument indices those among them: copyTo: false,
readByte: true, two: [1]. Without an entry, see
Parser::Method#out_arguments.
Which arguments of methods are out arguments (SPEC.md §2.2.5), by the
entries of #ignore_methods: true makes every non-const reference and
single pointer to a converted value type, a built-in type or an enum
one, a pointer to a byte or character type included, false none,
and a list of argument indices those among them: copyTo: false,
readByte: true, two: [1]. Without an entry, see
Parser::Method#out_arguments.
The #out_arguments entry for the method, if any: the first matching.
Names of the constructor arguments giving the object a parent, which
owns and deletes it, like QTreeWidgetItem(QTreeWidget *treeview).
The Qt processor keeps the object alive while it has one, like the
children of a QObject. Applies to the subclasses too.
Names of the constructor arguments giving the object a parent, which
owns and deletes it, like QTreeWidgetItem(QTreeWidget *treeview).
The Qt processor keeps the object alive while it has one, like the
children of a QObject. Applies to the subclasses too.
Methods handing an object back, which C++ stops using: their selected
object arguments, and their object result if all arguments are
selected, are passed to BindgenHelper.release. Same format as
#keep_alive.
Methods handing an object back, which C++ stops using: their selected
object arguments, and their object result if all arguments are
selected, are passed to BindgenHelper.release. Same format as
#keep_alive.
Crystal names of methods, by MethodPattern entries like
#ignore_methods: raise: raise_. The first matching entry names the
method, and all of its overloads if it's a plain name.
Crystal names of methods, by MethodPattern entries like
#ignore_methods: raise: raise_. The first matching entry names the
method, and all of its overloads if it's a plain name.
The Crystal name #rename gives the method, if any.
Types whose overloads shadow those taking this type: an overload of a
method taking this type is dropped where another overload takes one
of these types in its place, with the other arguments equal. For a
view type converted like the type it views: QStringView next to
QString, which both take a Crystal String.
Types whose overloads shadow those taking this type: an overload of a
method taking this type is dropped where another overload takes one
of these types in its place, with the other arguments equal. For a
view type converted like the type it views: QStringView next to
QString, which both take a Crystal String.
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
If sub-classing of this type is allowed, if it's wrapped and has virtual methods.
Which methods to filter out in the superclass wrapper. A method is ignored if it matches any of the regex patterns specified.
Which methods to filter out in the superclass wrapper. A method is ignored if it matches any of the regex patterns specified.
Template code ran to turn the crystal type into the real C++ type.
Template code ran to turn the binding type to Crystal.
How to pass this type from Crystal? Defaults to #pass_by.
How to pass this type from Crystal? Defaults to #pass_by.