| 22 | } |
| 23 | |
| 24 | std::string cmTrimWhitespace(cm::string_view str) |
| 25 | { |
| 26 | // XXX(clang-tidy): This declaration and the next cannot be `const auto*` |
| 27 | // because the qualification of `auto` is platform-dependent. |
| 28 | // NOLINTNEXTLINE(readability-qualified-auto) |
| 29 | auto start = str.begin(); |
| 30 | while (start != str.end() && cmsysString_isspace(*start)) { |
| 31 | ++start; |
| 32 | } |
| 33 | if (start == str.end()) { |
| 34 | return std::string(); |
| 35 | } |
| 36 | // NOLINTNEXTLINE(readability-qualified-auto) |
| 37 | auto stop = str.end() - 1; |
| 38 | while (cmsysString_isspace(*stop)) { |
| 39 | --stop; |
| 40 | } |
| 41 | return std::string(start, stop + 1); |
| 42 | } |
| 43 | |
| 44 | cm::string_view cmStripWhitespace(cm::string_view str) |
| 45 | { |
searching dependent graphs…