-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.h
73 lines (65 loc) · 4.49 KB
/
header.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#include <protobuf.h>
void GenerateHeader(const FileDescriptor* file, Printer& p)
{
p.Print(R"cc(
/***************************************************************************************************
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::...::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::..::::....::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::^!?YYJ?7!^..::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::^7Y5PPPPPP5Y!:::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::........^YPGGGGGPPGGP!::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::...:^!JYY^^JGBBGBBG?JPGP!::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::.:!YPGBBBBP!~PBBBBGB57??!:::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::..^YBBBBBBBBBB?^5BBBBBBP7:.:::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::.:!P#BBBBBBBBBBB?^P#BBBGGY^.:::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::..~5B#B###BBBBBBBBB~!GY7~!7J7:.::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::.:?B###&#Y5BBBBBBB##Y!!~?PB#BBG7::::::::::::::::::::::::::::::::::::
^::::::::::::::::::::::::::::::.^5####&#J:?#BBBB####575B#######Y:.::::::::::::::::::::::::::::::::::
^^^::..:::::::::::::::::::::::.:Y&###&&J.!G#BB#####B7~B########5:.:.::::::::::::::::::::::::::::::::
^^^~^^::.::::::::::::::::::::::.!P#&###?7B#BB######G~J########&#?::.::::::::::::::::::::::::::::::::
^^~~~~^^::.:::::::::::::::::::::.:!P###BB#BBB######Y^P#########&G^.:::::::::::::::::::::::::::::::::
^~~~~~~~~^:::::::::::::::::::::::..:?G###BBB#######7~B#########&G^.:::::::::::::::::::::::::::::::::
~~~~~~~~~~~^^:::.::::::::::::::::::..:?PB#########B7J###########5:::::::::::::::::::::::::::::::::::
~~~~~~~~~~~~~~^:::.::::::::::::::::::..^7555PGBBB#GYG##########B~.::::::::::::::::::::::::::::::::::
~~~~~~~~~~~~~~~~^^::::::::::::::::::::7J?JJJJJJYYYYJYY5PGBB#&&&Y::::::::::::::::::::::::::::::::::::
~~~~~~~~~~~~~~~~~~^^:::.::::::::::::.~YJ?JJJJJJJYYYYYYJYYY55??!:::::::::::::::::::::::::::::::::::::
^~~~~~~~~~~~~~~~~~~~~^:::::::::::::.:7J??JJJJJJJYYYYYJYYYYYJ^..:::::::::::::::::::::::::::::::::::::
:^^~~~~~~~~~~~~~~~~~~~~^^::::::::::~7??JJJJJYYYYYYYYYYYYYYYY7^..::::::::::::::::::::::::::::::::::::
::::^~~~~~~~~~~~~~~~~~~~~^^:::::::!????JJJJYYYYYY55YYYYYYYYJJ?!:::::::::::::::::::::::::::::::::::::
::::::^~~~~~~~~~~~~~~~~~~~~~^^::~7??JJJJYYYY5555555555555YYJJJJ7::::::::::::::::::::::::::::::::::::
:::::::::^~~~~~~~~~~~~~~~~~~~~~!?JJJJJJYYY555J?!^^!?Y55555YYYJJ?^:::::::::::::::::::::::::::::::::::
:::::::::::^~~~~~~~~~~~~~~~~~~7?JJJJYYY555J7^:......^!Y555YYYYJJ?^::::::::::::::::::::::::::::::::::
:::::::::::::^^~~~~~~~~~~~~~~7?JJJJJY55Y7~:..::::::::.^?55YYYYYJJ7^:::::::::::::::::::::::::::::::::
:::::::::::::::^^~~~~~~~~~~~7JJYYYY55Y?^:.::::::::::::.:!Y5555YYYY7:::::::::::::::::::::::::::::::::
::::::::::::::::::^~~~~~~~~~7??J5PP5J!~~^^::::::::::::::.:!YP555YYJ!::::::::::::::::::::::::::::::::
::::::::::::::::::::^^~~~~~77?JJY5J!~~~~~~~^::::::::::::::.^7Y555YJ?7:::::::::::::::::::::::::::::::
:::::::::::::::::::::::^~~~7???JYJ!~~~~~~~~~~^::::::::::::::.:7YYJ???!::::::::::::::::::::::::::::::
~~~~~~~~~~~~~~~~~~~~~~~~~~!7???JY?!!!!!!~~~~~~~^^^^^^^^^^^^^^^^7JJ????!^^^^~~^^^^~~^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~~~~~~~~~~!???JJY7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~?JJ???7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~!???JYJ!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!JJJ???!~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~!??JJJ7~~~~~~~^^^^^^^^^^^^^^^^~~~~^^^^^7JJ???7~^^^^~~~~~~~~~~~~~~~~~~~~~~~
~~~~~^^^^~~~~~~~~~~~~~~~~~7???JJ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^~7JJ???~^^^^~^^^^^~~~~~~~~~~~~~~~~~
***************************************************************************************************/
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include <optional>
#include <array>
#include "kun.h"
)cc");
for (size_t i = 0; i < file->dependency_count(); i++) {
auto dep = file->dependency(i);
std::string basename = google::protobuf::compiler::StripProto(dep->name());
p.Emit(
{
{ "basename", basename },
},
R"cc(
#include "$basename$.kun.h"
)cc");
// std::cout << "dep: " << dep->name() << std::endl;
}
}