MCPcopy Create free account
hub / github.com/ceph/ceph / find_first_in

Function find_first_in

src/common/cmdparse.cc:503–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501namespace {
502template <typename Func>
503bool find_first_in(std::string_view s, const char *delims, Func&& f)
504{
505 auto pos = s.find_first_not_of(delims);
506 while (pos != s.npos) {
507 s.remove_prefix(pos);
508 auto end = s.find_first_of(delims);
509 if (f(s.substr(0, end))) {
510 return true;
511 }
512 pos = s.find_first_not_of(delims, end);
513 }
514 return false;
515}
516
517template<typename T>
518T str_to_num(const std::string& s)

Callers 2

validate_str_argFunction · 0.85
validate_cmdFunction · 0.85

Calls 2

fFunction · 0.85
substrMethod · 0.80

Tested by

no test coverage detected