| 225 | } |
| 226 | |
| 227 | constexpr size_t snake_case_length(std::string_view name) { |
| 228 | size_t length = 0; |
| 229 | for (size_t i = 0; i < name.size(); ++i) { |
| 230 | char c = name[i]; |
| 231 | if (c == '_' || c == '-') { |
| 232 | ++length; |
| 233 | continue; |
| 234 | } |
| 235 | if (needs_snake_separator(name, i)) { |
| 236 | ++length; |
| 237 | } |
| 238 | ++length; |
| 239 | } |
| 240 | return length; |
| 241 | } |
| 242 | |
| 243 | template <size_t MaxLength> |
| 244 | constexpr std::pair<std::array<char, MaxLength + 1>, size_t> |