MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / MakeCamel

Function MakeCamel

native/thirdpart/flatbuffers/idl_parser.cpp:97–108  ·  view source on GitHub ↗

Convert an underscore_based_identifier in to camelCase. Also uppercases the first character if first is true.

Source from the content-addressed store, hash-verified

95// Convert an underscore_based_identifier in to camelCase.
96// Also uppercases the first character if first is true.
97std::string MakeCamel(const std::string &in, bool first) {
98 std::string s;
99 for (size_t i = 0; i < in.length(); i++) {
100 if (!i && first)
101 s += CharToUpper(in[0]);
102 else if (in[i] == '_' && i + 1 < in.length())
103 s += CharToUpper(in[++i]);
104 else
105 s += in[i];
106 }
107 return s;
108}
109
110// Convert an underscore_based_identifier in to screaming snake case.
111std::string MakeScreamingCamel(const std::string &in) {

Callers 1

ParseProtoFieldsMethod · 0.85

Calls 2

CharToUpperFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected