|
CPGen
C++ project generator
|
Runs all registered emitters and materialises the project on disk. More...
#include <GenerationPipeline.hpp>
Public Member Functions | |
| void | addEmitter (std::unique_ptr< Emitter > emitter) |
| Register an emitter to be run during execute. | |
| void | execute (const ResolvedProject &project, const std::filesystem::path &output_dir) |
| Run every registered emitter and write the resulting files. | |
Runs all registered emitters and materialises the project on disk.
Typical usage:
| void GenerationPipeline::addEmitter | ( | std::unique_ptr< Emitter > | emitter | ) |
Register an emitter to be run during execute.
| emitter | Owning pointer to the emitter. |
| void GenerationPipeline::execute | ( | const ResolvedProject & | project, |
| const std::filesystem::path & | output_dir | ||
| ) |
Run every registered emitter and write the resulting files.
Creates the output_dir (and any parent directories) if they do not exist, then iterates through all emitters, collects their output, and writes each file.
| project | The resolved project to generate. |
| output_dir | Absolute path to the root directory of the new project. |
| std::runtime_error | If a file cannot be written. |