MCPcopy Create free account
hub / github.com/acl-dev/acl / split

Function split

lib_acl_cpp/src/stdlib/string.cpp:2056–2075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2054}
2055
2056void split(const char* str, const char* sep, std::vector<std::string>& out) {
2057 const char* ptr = str, *start = str;
2058 while (*ptr) {
2059 if (strchr(sep, (int) (*ptr)) != NULL) {
2060 if (start < ptr) {
2061 size_t n = ptr - start;
2062 std::string buf;
2063 buf.assign(start, n);
2064 out.push_back(buf);
2065 }
2066 start = ptr + 1;
2067 }
2068 ptr++;
2069 }
2070
2071 if (*start) {
2072 std::string buf = start;
2073 out.push_back(start);
2074 }
2075}
2076
2077size_t split(const char* str, const char* sep, std::list<std::string>& out) {
2078 size_t cnt = 0;

Callers 3

test2Function · 0.85
test3Function · 0.85
mainFunction · 0.85

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…