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

Method PrintWhitespaces

library/cpp/json/writer/json.cpp:96–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95
96 void TBuf::PrintWhitespaces(size_t count, bool prependWithNewLine) {
97 static constexpr TStringBuf whitespacesTemplate = "\n ";
98 static_assert(whitespacesTemplate[0] == '\n');
99 static_assert(whitespacesTemplate[1] == ' ');
100
101 count += (prependWithNewLine);
102 do {
103 const TStringBuf buffer = whitespacesTemplate.SubString(prependWithNewLine ? 0 : 1, count);
104 count -= buffer.size();
105 UnsafeWriteRawBytes(buffer);
106 prependWithNewLine = false; // skip '\n' in subsequent writes
107 } while (count > 0);
108 }
109
110 inline void TBuf::WriteComma() {
111 if (NeedComma) {

Callers

nothing calls this directly

Calls 2

SubStringMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected