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

Method gen_fetch_function_end

tl/generate/tl_writer_cpp.cpp:560–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560std::string TD_TL_writer_cpp::gen_fetch_function_end(bool has_parent, int field_num,
561 const std::vector<tl::var_description> &vars,
562 int parser_type) const {
563 for (std::size_t i = 0; i < vars.size(); i++) {
564 assert(vars[i].is_stored);
565 }
566
567 if (parser_type == 0) {
568 return "#undef FAIL\n"
569 "{" +
570 (field_num == 0 ? "\n (void)p;\n" : std::string()) + "}\n";
571 }
572
573 if (parser_type == -1) {
574 return "#undef FAIL\n"
575 "}\n";
576 }
577
578 return " if (p.get_error()) { FAIL(\"\"); }\n"
579 " return " +
580 std::string(has_parent ? "std::move(res)" : "res") +
581 ";\n"
582 "#undef FAIL\n"
583 "}\n";
584}
585
586std::string TD_TL_writer_cpp::gen_fetch_function_result_begin(const std::string &parser_name,
587 const std::string &class_name,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected