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

Method get_pretty_field_name

tl/generate/tl_writer_cpp.cpp:302–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302std::string TD_TL_writer_cpp::get_pretty_field_name(std::string field_name) const {
303 if (!field_name.empty() && field_name.back() == ']') {
304 return "";
305 }
306 auto equals_pos = field_name.find('=');
307 if (equals_pos != std::string::npos && equals_pos + 3 < field_name.size()) {
308 field_name = field_name.substr(equals_pos + 2);
309 if (field_name.back() == ')') {
310 field_name.pop_back();
311 }
312 }
313 while (!field_name.empty() && field_name.back() == '_') {
314 field_name.pop_back();
315 }
316 return field_name;
317}
318
319std::string TD_TL_writer_cpp::get_pretty_class_name(std::string class_name) const {
320 return class_name;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected