abstract class Bindgen::Generator::Base
- Bindgen::Generator::Base
- Reference
- Object
Overview
Base class for a Generator. It's used in conjunction of one or several processors to write generated data out to disk.
Direct Known Subclasses
Defined in:
bindgen/generator/base.crConstant Summary
-
INDENTION =
" "
-
Single indention-depth prefix
-
SINGLE_FILE_SECTION =
""
-
Name of the section in a single-file setup.
Constructors
Instance Method Summary
-
#config : Configuration::Generator
Configuration of this generator.
-
#indented(&)
Increments the indention depth by one, yields, and decrements the depth afterwards again.
-
#puts(text : String)
Prints text into the current output, adhering to the current indention depth.
-
#user_config : Configuration
Complete configuration document
-
#write(node : Graph::Container)
Writes the node to the output file(s).
-
#write_all(node : Graph::Container, io : IO | Nil = nil, depth : Int32 = 0)
Publicly accessed method.
Constructor Detail
Instance Method Detail
Increments the indention depth by one, yields, and decrements the depth afterwards again.
Prints text into the current output, adhering to the current indention depth. Multi-line text is supported, too.
Writes the node to the output file(s). Make sure to call
#begin_section
before writing any data.
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
.