MCPcopy Create free account
hub / github.com/apple/foundationdb / lineWrap

Function lineWrap

fdbcli/StatusCommand.actor.cpp:50–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50std::string lineWrap(const char* text, int col) {
51 const char* iter = text;
52 const char* start = text;
53 const char* space = nullptr;
54 std::string out = "";
55 do {
56 iter++;
57 if (*iter == '\n' || *iter == ' ' || *iter == '\0')
58 space = iter;
59 if (*iter == '\n' || *iter == '\0' || (iter - start == col)) {
60 if (!space)
61 space = iter;
62 out += format("%.*s\n", (int)(space - start), start);
63 start = space;
64 if (*start == ' ' /* || *start == '\n'*/)
65 start++;
66 space = nullptr;
67 }
68 } while (*iter);
69 return out;
70}
71
72std::pair<int, int> getNumOfNonExcludedProcessAndZones(StatusObjectReader statusObjCluster) {
73 StatusObjectReader processesMap;

Callers 1

printStatusFunction · 0.85

Calls 1

formatFunction · 0.50

Tested by

no test coverage detected