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

Method gen_constructor_field_init

tl/generate/tl_writer_cpp.cpp:672–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672std::string TD_TL_writer_cpp::gen_constructor_field_init(int field_num, const std::string &class_name, const tl::arg &a,
673 bool is_default) const {
674 std::string field_type = gen_field_type(a);
675 if (field_type.empty()) {
676 return "";
677 }
678 std::string move_begin;
679 std::string move_end;
680 if ((field_type == bytes_type || field_type == secure_bytes_type || field_type == secure_string_type ||
681 field_type.compare(0, 11, "std::vector") == 0 || field_type.compare(0, 10, "object_ptr") == 0) &&
682 !is_default) {
683 move_begin = "std::move(";
684 move_end = ")";
685 }
686
687 return (field_num == 0 ? ")\n : " : " , ") + gen_field_name(a.name) + "(" + move_begin +
688 (is_default ? "" : gen_field_name(a.name)) + move_end + ")\n";
689}
690
691std::string TD_TL_writer_cpp::gen_constructor_end(const tl::tl_combinator *t, int fields_num, bool is_default) const {
692 if (fields_num == 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected