Copy @a src to @a dst, transforming to lower case. * * @param src Input string. * @param dst Output buffer. */
| 35 | * @param dst Output buffer. |
| 36 | */ |
| 37 | inline void |
| 38 | transform_lower(std::string_view src, swoc::MemSpan<char> dst) |
| 39 | { |
| 40 | if (src.size() > dst.size() - 1) { // clip @a src, reserving space for the terminal nul. |
| 41 | src = std::string_view{src.data(), dst.size() - 1}; |
| 42 | } |
| 43 | auto final = std::transform(src.begin(), src.end(), dst.data(), [](char c) -> char { return std::tolower(c); }); |
| 44 | *final++ = '\0'; |
| 45 | } |
| 46 | } // namespace ts |
no test coverage detected