MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / gen_output_begin

Method gen_output_begin

tl/generate/tl_writer_cpp.cpp:25–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace td {
24
25std::string TD_TL_writer_cpp::gen_output_begin() const {
26 std::string ext_include_str;
27 for (auto &it : ext_include) {
28 ext_include_str += "#include " + it + "\n";
29 }
30 if (!ext_include_str.empty()) {
31 ext_include_str += "\n";
32 }
33
34 return "#include \"" + tl_name + ".h\"\n\n" + ext_include_str +
35 "#include \"td/utils/common.h\"\n"
36 "#include \"td/utils/format.h\"\n"
37 "#include \"td/utils/logging.h\"\n"
38 "#include \"td/utils/tl_parsers.h\"\n"
39 "#include \"td/utils/tl_storers.h\"\n\n"
40 "namespace cocoon {\n"
41 "namespace " +
42 tl_name +
43 " {\n\n"
44 "std::string to_string(const BaseObject &value) {\n"
45 " td::TlStorerToString storer;\n"
46 " value.store(storer, \"\");\n"
47 " return storer.move_as_str();\n"
48 "}\n";
49}
50
51std::string TD_TL_writer_cpp::gen_output_end() const {
52 return "} // namespace " + tl_name +

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected