CPGen
C++ project generator
Loading...
Searching...
No Matches
Emitter.hpp
Go to the documentation of this file.
1#pragma once
2
14
15#include <filesystem>
16#include <string>
17#include <vector>
18
23struct OutputFile {
24 std::filesystem::path relative_path;
25 std::string content;
26};
27
35class Emitter {
36public:
37 Emitter() = default;
38 virtual ~Emitter() = default;
39 Emitter(const Emitter &) = default;
40 Emitter &operator=(const Emitter &) = default;
41 Emitter(Emitter &&) = default;
42 Emitter &operator=(Emitter &&) = default;
43
49 [[nodiscard]] virtual std::vector<OutputFile>
50 emit(const ResolvedProject &project) = 0;
51};
Output types produced by the resolver pipeline.
Abstract base class for pipeline emitters.
Definition Emitter.hpp:35
Emitter(Emitter &&)=default
Emitter & operator=(const Emitter &)=default
Emitter(const Emitter &)=default
virtual ~Emitter()=default
Emitter()=default
Emitter & operator=(Emitter &&)=default
virtual std::vector< OutputFile > emit(const ResolvedProject &project)=0
Produce output files from a resolved project.
Represents a single file to be written during project generation.
Definition Emitter.hpp:23
std::string content
Full file content.
Definition Emitter.hpp:25
std::filesystem::path relative_path
Path relative to the project root.
Definition Emitter.hpp:24
Aggregated output of the full resolver pipeline.
Definition Resolved.hpp:105