| 48 | } |
| 49 | |
| 50 | std::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 | |
| 72 | std::pair<int, int> getNumOfNonExcludedProcessAndZones(StatusObjectReader statusObjCluster) { |
| 73 | StatusObjectReader processesMap; |