| 23 | namespace td { |
| 24 | |
| 25 | std::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 | |
| 51 | std::string TD_TL_writer_cpp::gen_output_end() const { |
| 52 | return "} // namespace " + tl_name + |
nothing calls this directly
no outgoing calls
no test coverage detected