MCPcopy Create free account
hub / github.com/catboost/catboost / UnderscoreCaseToCamelCase

Function UnderscoreCaseToCamelCase

library/cpp/yt/string/string.cpp:16–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14////////////////////////////////////////////////////////////////////////////////
15
16void UnderscoreCaseToCamelCase(TStringBuilderBase* builder, TStringBuf str)
17{
18 bool first = true;
19 bool upper = true;
20 for (char c : str) {
21 if (c == '_') {
22 upper = true;
23 } else {
24 if (upper) {
25 if (!std::isalpha(c) && !first) {
26 builder->AppendChar('_');
27 }
28 c = std::toupper(c);
29 }
30 builder->AppendChar(c);
31 upper = false;
32 }
33 first = false;
34 }
35}
36
37TString UnderscoreCaseToCamelCase(TStringBuf str)
38{

Callers 2

DecodeEnumValueImplFunction · 0.85
TESTFunction · 0.85

Calls 3

toupperFunction · 0.85
AppendCharMethod · 0.80
FlushMethod · 0.45

Tested by

no test coverage detected