abstract class Bindgen::Cpp::Cookbook

Overview

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.

Direct Known Subclasses

Defined in:

bindgen/cpp/cookbook.cr

Constructors

Instance Method Summary

Constructor Detail

def self.create_by_name(name) : Cookbook #

Finds and creates a Cookbook by name.


[View source]

Instance Method Detail

abstract def constructor_name(method_name : String, class_name : String) : String #

How to call the constructor method of class_name.


[View source]
def 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.


[View source]
def 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.


[View source]
abstract def pointer_to_reference(type : String) : String | Nil #

Provides a template to convert a pointer to a reference.


[View source]
abstract def pointer_to_value(type : String) : String | Nil #

Provides a template to convert a pointer to a value.


[View source]
abstract def reference_to_pointer(type : String) : String | Nil #

Provides a template to convert a reference to a pointer.


[View source]
abstract def reference_to_value(type : String) : String | Nil #

Provides a template to convert a reference to a value.


[View source]
abstract def value_to_pointer(type : String) : String | Nil #

Provides a template to convert a value to a pointer.


[View source]
abstract def value_to_reference(type : String) : String | Nil #

Provides a template to convert a value to a reference.


[View source]