class Bindgen::Processor::CopyStructs

Overview

Copies all classes into lib structs which have their copy_structure set to true in the type database.

Has to be run before the CrystalBinding processor.

Included Modules

Defined in:

bindgen/processor/copy_structs.cr

Constant Summary

BIT_FIELD_STORAGE = {"Bool" => {"UInt8", "uint8_t"}, "Int8" => {"UInt8", "uint8_t"}, "UInt8" => {"UInt8", "uint8_t"}, "Int16" => {"UInt16", "uint16_t"}, "UInt16" => {"UInt16", "uint16_t"}, "Int32" => {"UInt32", "uint32_t"}, "UInt32" => {"UInt32", "uint32_t"}, "Int64" => {"UInt64", "uint64_t"}, "UInt64" => {"UInt64", "uint64_t"}, "LibC::Long" => {"LibC::ULong", "unsigned long int"}, "LibC::ULong" => {"LibC::ULong", "unsigned long int"}, "LibC::LongLong" => {"LibC::ULongLong", "unsigned long long int"}, "LibC::ULongLong" => {"LibC::ULongLong", "unsigned long long int"}, "LibC::SizeT" => {"LibC::SizeT", "size_t"}, "LibC::SSizeT" => {"LibC::SizeT", "size_t"}}

The storage of bit-fields in a lib struct, by the binding type of the bit-field: The unsigned Crystal type, and its C++ type.

Log = ::Log.for(self)

Copies all classes into lib structs which have their copy_structure set to true in the type database.

Has to be run before the CrystalBinding processor.

SIGNED_BIT_FIELDS = {"Int8", "Int16", "Int32", "Int64", "LibC::Long", "LibC::LongLong", "LibC::SSizeT"}

Binding types of signed bit-fields.

SIGNED_STORAGE = {"UInt8" => "Int8", "UInt16" => "Int16", "UInt32" => "Int32", "UInt64" => "Int64", "LibC::ULong" => "LibC::Long", "LibC::ULongLong" => "LibC::LongLong", "LibC::SizeT" => "LibC::SSizeT"}

The signed counterpart of each storage type, to extend the sign of signed bit-fields.

Instance Method Summary

Instance methods inherited from module Bindgen::TypeHelper

cpp_class_name(class_name : String) : String cpp_class_name, passthrough(type : Parser::Type) passthrough, proc_by_pointer?(type : Parser::Type) : Bool proc_by_pointer?, reconfigure_pass_type(pass_by, is_ref, ptr) reconfigure_pass_type, structure_hosted?(rules : TypeDatabase::TypeConfig) : Bool structure_hosted?, type_copied?(type) : Bool type_copied?, type_pointer_depth(type : Parser::Type) : Int32 type_pointer_depth, variadic_argument : Call::VariadicArgument variadic_argument

Instance methods inherited from class Bindgen::Processor::Base

inherited_rules(class_name : String, & : TypeDatabase::TypeConfig -> TypeDatabase::KeepAlive) : TypeDatabase::KeepAlive inherited_rules, process(graph : Graph::Container, doc : Parser::Document) process, unmatched_patterns(klass : Graph::Class, rules : TypeDatabase::KeepAlive) : Array(Regex) unmatched_patterns

Constructor methods inherited from class Bindgen::Processor::Base

new(config : Configuration, db : TypeDatabase) new

Instance methods inherited from module Bindgen::Graph::Visitor

visit_alias(alias_name) visit_alias, visit_children(container : Container) visit_children, visit_class(klass) visit_class, visit_constant(constant) visit_constant, visit_enum(enumeration) visit_enum, visit_library(library) visit_library, visit_method(method) visit_method, visit_namespace(ns) visit_namespace, visit_node(node : Node) visit_node, visit_node?(node : Node) visit_node?, visit_platform_specific(specific) visit_platform_specific, visit_struct(structure) visit_struct, visit_union(structure) visit_union

Instance Method Detail

def process(graph : Graph::Node, doc : Parser::Document) #

[View source]