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

Function CamelCaseToUnderscoreCase

library/cpp/yt/string/string.cpp:44–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void CamelCaseToUnderscoreCase(TStringBuilderBase* builder, TStringBuf str)
45{
46 bool first = true;
47 for (char c : str) {
48 if (std::isupper(c) && std::isalpha(c)) {
49 if (!first) {
50 builder->AppendChar('_');
51 }
52 c = std::tolower(c);
53 }
54 builder->AppendChar(c);
55 first = false;
56 }
57}
58
59TString CamelCaseToUnderscoreCase(TStringBuf str)
60{

Callers 4

FormatEnumFunction · 0.85
DecodeEnumValueImplFunction · 0.85
EncodeEnumValueFunction · 0.85
TESTFunction · 0.85

Calls 2

AppendCharMethod · 0.80
FlushMethod · 0.45

Tested by

no test coverage detected