aboutsummaryrefslogtreecommitdiff
path: root/buildtools/codegen/CodegenOutput.inl
blob: 6d593012dc9d5f175892f03b79780b00164497ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include "CodegenDecl.hpp"

#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>

// A generic "thing" (could be anything, comments, string-concated functionsm, etc.) to spit into the output file
struct CodegenOutputThing {
	std::string text;
};

class CodegenOutput {
private:
	std::vector<CodegenOutputThing> mOutThings;

public:
	void AddOutputThing(CodegenOutputThing thing) {
		mOutThings.push_back(std::move(thing));
	}

	void MergeContents(CodegenOutput other) {
		std::move(other.mOutThings.begin(), other.mOutThings.end(), this->mOutThings.begin());
	}

	void Write(FILE* file) {
		// TODO
	}
};