MCPcopy Create free account
hub / github.com/csmith-project/csmith / split_int_string

Method split_int_string

src/StringUtils.cpp:152–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void
153StringUtils::split_int_string(const string str, vector<int> &values, string sep_chars)
154{
155 size_t pos = 0;
156 size_t start_pos = 0;
157 while(true) {
158 ignore_spaces(str, pos);
159 start_pos = pos;
160 pos = find_any_char(str, pos, sep_chars);
161 std::string s = str.substr(start_pos, (pos - start_pos));
162 if (!s.empty()) {
163 values.push_back(str2int(s));
164 }
165 if (pos == string::npos)
166 break;
167 pos++;
168 }
169}
170
171/* convert string to number, take care of surrounding parentheses */
172int

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected