MCPcopy Create free account
hub / github.com/apache/brpc / TokenizeT

Function TokenizeT

src/butil/strings/string_util.cc:566–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564
565template<typename STR>
566static size_t TokenizeT(const STR& str,
567 const STR& delimiters,
568 std::vector<STR>* tokens) {
569 tokens->clear();
570
571 size_t start = str.find_first_not_of(delimiters);
572 while (start != STR::npos) {
573 size_t end = str.find_first_of(delimiters, start + 1);
574 if (end == STR::npos) {
575 tokens->push_back(str.substr(start));
576 break;
577 } else {
578 tokens->push_back(str.substr(start, end - start));
579 start = str.find_first_not_of(delimiters, end + 1);
580 }
581 }
582
583 return tokens->size();
584}
585
586size_t Tokenize(const string16& str,
587 const string16& delimiters,

Callers 1

TokenizeFunction · 0.85

Calls 6

find_first_not_ofMethod · 0.80
find_first_ofMethod · 0.80
substrMethod · 0.80
clearMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected