MCPcopy Create free account
hub / github.com/anyrtcIO-Community/anyRTC-RTMP-OpenSource / tokenize

Function tokenize

webrtc/base/stringencode.cc:557–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555}
556
557size_t tokenize(const std::string& source, char delimiter,
558 std::vector<std::string>* fields) {
559 fields->clear();
560 size_t last = 0;
561 for (size_t i = 0; i < source.length(); ++i) {
562 if (source[i] == delimiter) {
563 if (i != last) {
564 fields->push_back(source.substr(last, i - last));
565 }
566 last = i + 1;
567 }
568 }
569 if (last != source.length()) {
570 fields->push_back(source.substr(last, source.length() - last));
571 }
572 return fields->size();
573}
574
575size_t tokenize_with_empty_tokens(const std::string& source,
576 char delimiter,

Callers 2

tokenize_appendFunction · 0.85
ConfigureLoggingMethod · 0.85

Calls 5

tokenize_appendFunction · 0.85
clearMethod · 0.45
lengthMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected