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

Method gen_vector_store

tl/generate/tl_writer_cpp.cpp:323–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323std::string TD_TL_writer_cpp::gen_vector_store(const std::string &field_name, const tl::tl_tree_type *t,
324 const std::vector<tl::var_description> &vars, int storer_type) const {
325 std::string num = field_name.back() == ']' ? "2" : "";
326 return "{ const std::vector<" + gen_type_name(t) + "> &v" + num + " = " + field_name +
327 "; const std::uint32_t multiplicity" + num + " = static_cast<std::uint32_t>(v" + num +
328 ".size()); const auto vector_name" + num + " = \"" + get_pretty_class_name("vector") +
329 "[\" + td::to_string(multiplicity" + num + ")+ \"]\"; s.store_class_begin(\"" +
330 get_pretty_field_name(field_name) + "\", vector_name" + num +
331 ".c_str()); "
332 "for (std::uint32_t i" +
333 num + " = 0; i" + num + " < multiplicity" + num + "; i" + num + "++) { " +
334 gen_type_store("v" + num + "[i" + num + "]", t, vars, storer_type) + " } s.store_class_end(); }";
335}
336
337std::string TD_TL_writer_cpp::gen_store_class_name(const tl::tl_tree_type *tree_type) const {
338 const tl::tl_type *t = tree_type->type;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected