class

Bindgen::Cpp::Cookbook

Inherits Reference < Object

The cookbook contains snippets for the C++ and C platforms.

The TypeDatabase stores which cookbook to use. Don't .new your own.

Which cookbook is used is configured by the user through the platform: setting. See Configuration#platform for the code, and TEMPLATE.yml for user-facing documentation.

The functions all return a Template::Basic when conversion is necessary, and Template::None otherwise.

Constructors

create_by_name(name) : Cookbook

Finds and creates a Cookbook by name.

Source

Instance methods

constructor_name(method_name : String, class_name : String) : String

How to call the constructor method of class_name.

Source
find(base_name : String, is_reference, is_pointer, pass_by : TypeDatabase::PassBy) : Template::Base

Same, but provides an override of types reference and pointer qualification.

Source
find(type : Parser::Type, pass_by : TypeDatabase::PassBy) : Template::Base

Finds the template to pass type as-is as pass_by. The returned template takes an expression returning something of type and turns it into something that can be pass_by'd on.

Source
plain_constructor_name(method_name : String, class_name : String) : String

Same as #constructor_name, but guarantees that the constructed type is class_name itself, and not a helper type wrapping it. This is required to brace-initialize an aggregate, and for C++ unions.

Source
pointer_to_reference(type : String) : String | Nil

Provides a template to convert a pointer to a reference.

Source
pointer_to_value(type : String) : String | Nil

Provides a template to convert a pointer to a value.

Source
reference_to_pointer(type : String) : String | Nil

Provides a template to convert a reference to a pointer.

Source
reference_to_value(type : String) : String | Nil

Provides a template to convert a reference to a value.

Source
value_to_pointer(type : String) : String | Nil

Provides a template to convert a value to a pointer.

Source
value_to_reference(type : String) : String | Nil

Provides a template to convert a value to a reference.

Source