MCPcopy Create free account
hub / github.com/apache/fory / snake_case_length

Function snake_case_length

cpp/fory/util/string_util.h:227–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227constexpr 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
243template <size_t MaxLength>
244constexpr std::pair<std::array<char, MaxLength + 1>, size_t>

Callers 2

TESTFunction · 0.85

Calls 2

needs_snake_separatorFunction · 0.85
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68