| 206 | } |
| 207 | |
| 208 | constexpr bool needs_snake_separator(std::string_view name, size_t index) { |
| 209 | if (index == 0) |
| 210 | return false; |
| 211 | char curr = name[index]; |
| 212 | if (!is_upper_ascii(curr)) |
| 213 | return false; |
| 214 | |
| 215 | char prev = name[index - 1]; |
| 216 | if (is_lower_ascii(prev) || is_digit_ascii(prev)) |
| 217 | return true; |
| 218 | |
| 219 | if (is_upper_ascii(prev) && index + 1 < name.size()) { |
| 220 | char next = name[index + 1]; |
| 221 | if (is_lower_ascii(next)) |
| 222 | return true; |
| 223 | } |
| 224 | return false; |
| 225 | } |
| 226 | |
| 227 | constexpr size_t snake_case_length(std::string_view name) { |
| 228 | size_t length = 0; |
no test coverage detected