MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / Split

Method Split

src/plugin/kernel/include/AFCDataList.hpp:203–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201 }
202
203 bool Split(const std::string& src, const std::string& split) override
204 {
205 Clear();
206
207 std::string tmp(src);
208 if (tmp.empty())
209 {
210 return true;
211 }
212
213 std::string tmp_split(split);
214 std::string::size_type pos;
215 tmp += tmp_split;
216 std::string::size_type size = tmp.length();
217
218 for (std::string::size_type i = 0; i < size; ++i)
219 {
220 pos = int(tmp.find(tmp_split, i));
221 if (pos < size)
222 {
223 std::string sub = tmp.substr(i, pos - i);
224 AddString(sub.c_str());
225
226 i = pos + tmp_split.size() - 1;
227 }
228 }
229
230 return true;
231 }
232
233 bool Append(const AFIData& data) override
234 {

Callers

nothing calls this directly

Calls 6

lengthMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
substrMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected