| 558 | } |
| 559 | |
| 560 | std::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 | |
| 586 | std::string TD_TL_writer_cpp::gen_fetch_function_result_begin(const std::string &parser_name, |
| 587 | const std::string &class_name, |
nothing calls this directly
no outgoing calls
no test coverage detected