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

Function CollapseText

util/string/strip.cpp:6–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <util/string/reverse.h>
5
6void CollapseText(const TString& from, TString& to, size_t maxLen) {
7 Collapse(from, to, maxLen);
8 StripInPlace(to);
9 if (to.size() >= maxLen) {
10 to.remove(maxLen - 5); // " ..."
11 ReverseInPlace(to);
12 size_t pos = to.find_first_of(" .,;");
13 if (pos != TString::npos && pos < 32) {
14 to.remove(0, pos + 1);
15 }
16 ReverseInPlace(to);
17 to.append(" ...");
18 }
19}

Callers

nothing calls this directly

Calls 7

StripInPlaceFunction · 0.85
CollapseFunction · 0.70
ReverseInPlaceFunction · 0.70
sizeMethod · 0.45
removeMethod · 0.45
find_first_ofMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected