class

Bindgen::Generator::Base

Inherits Reference < Object

Base class for a Generator. It's used in conjunction of one or several processors to write generated data out to disk.

Constants

INDENTION = " "

Single indention-depth prefix

SINGLE_FILE_SECTION = ""

Name of the section in a single-file setup.

Constructors

new(user_config : Configuration, config : Configuration::Generator, db : TypeDatabase)
Source

Instance methods

config

Configuration of this generator.

Source
indented

Increments the indention depth by one, yields, and decrements the depth afterwards again.

Source
puts(text : String)

Prints text into the current output, adhering to the current indention depth. Multi-line text is supported, too.

Source
user_config

Complete configuration document

Source
write(node : Graph::Container)

Writes the node to the output file(s). Make sure to call #begin_section before writing any data.

Source
write_all(node : Graph::Container, io : IO | Nil = nil, depth : Int32 = 0)

Publicly accessed method. Writes node, while taking into account that the output may be split among multiple files. If io is not nil, it'll be used as output. This is useful for recursive generator invocations.

depth is only respected if io is not nil, in which case it'll override @depth.

Source