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

Method gen_class_name

tl/generate/tl_writer_java.cpp:95–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95std::string TD_TL_writer_java::gen_class_name(std::string name) const {
96 if (name == "Object") {
97 assert(false);
98 }
99 if (name == "#") {
100 return "int";
101 }
102 bool next_to_upper = true;
103 std::string result;
104 for (std::size_t i = 0; i < name.size(); i++) {
105 if (!is_alnum(name[i])) {
106 next_to_upper = true;
107 continue;
108 }
109 if (next_to_upper) {
110 result += to_upper(name[i]);
111 next_to_upper = false;
112 } else {
113 result += name[i];
114 }
115 }
116 return result;
117}
118
119std::string TD_TL_writer_java::gen_field_name(std::string name) const {
120 assert(name.size() > 0);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected