aboutsummaryrefslogtreecommitdiff
path: root/source/20-codegen-compiler/CodegenModelArchive.hpp
blob: 261d82b25b217bc115e0d887f7f8b6e9fd3bfbbd (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
#pragma once

#include "CodegenDecl.hpp"
#include "CodegenModel.hpp"

#include <sqlite3.h>
#include <string_view>

namespace Utils {
sqlite3_stmt* NewSqliteStatement(sqlite3* database, std::string_view sql);
} // namespace Utils

class CodegenModelArchive {
private:
	class Private;
	Private* m;

public:
	CodegenModelArchive(std::string_view dbPath);
	~CodegenModelArchive();

	// Implementation detail helper, don't use outside
	Private& GetPimpl() const { return *m; }

	void Store(const CodegenModel& cgInput);
	void StoreStruct(const DeclStruct& decl);
	void StoreFunction(const DeclFunction& decl);
	void StoreEnum(const DeclEnum& decl);
};