MCPcopy Create free account
hub / github.com/chromium/crashpad / SplitString

Function SplitString

util/string/split_string.cc:35–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35std::vector<std::string> SplitString(const std::string& string,
36 char delimiter) {
37 std::vector<std::string> result;
38 if (string.empty())
39 return result;
40
41 size_t start = 0;
42 while (start != std::string::npos) {
43 size_t end = string.find_first_of(delimiter, start);
44
45 std::string part;
46 if (end == std::string::npos) {
47 part = string.substr(start);
48 start = std::string::npos;
49 } else {
50 part = string.substr(start, end - start);
51 start = end + 1;
52 }
53
54 result.push_back(part);
55 }
56 return result;
57}
58
59} // namespace crashpad

Callers 5

InitializeFromStringMethod · 0.85
TestProcessSelfOrCloneFunction · 0.85
TESTFunction · 0.85
ReadCPUsOnlineFunction · 0.85
ReadKernelVersionMethod · 0.85

Calls 2

emptyMethod · 0.45
push_backMethod · 0.45

Tested by 2

TestProcessSelfOrCloneFunction · 0.68
TESTFunction · 0.68