MCPcopy Create free account
hub / github.com/Tencent/phxqueue / StrSplitList

Function StrSplitList

phxqueue_phxrpc/comm/ini2pb.cpp:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30INI2Pb::~INI2Pb() {}
31
32static void StrSplitList(const string &str, const string &delimiters, vector<string> &results) {
33 results.clear();
34 auto last = 0;
35 auto found = str.find_first_of(delimiters);
36 while (string::npos != found) {
37 auto r = str.substr(last, found - last);
38 last = found + 1;
39 found = str.find_first_of(delimiters, last);
40 if (!r.empty()) results.push_back(r);
41 }
42 auto r = str.substr(last);
43 if (!r.empty()) results.push_back(r);
44}
45
46
47bool INI2Pb::ParseField(google::protobuf::Message *message, const string &section_name,

Callers 1

ParseFieldMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected