MCPcopy Create free account
hub / github.com/covscript/covscript / split

Function split

sources/system/common.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50namespace cs_system_impl {
51 std::vector<std::string> split(const std::string &str, const cs::set_t<char> &set)
52 {
53 std::vector<std::string> results;
54 std::string buff;
55 for (auto ch : str) {
56 if (set.count(ch) > 0) {
57 if (!buff.empty()) {
58 results.emplace_back(buff);
59 buff.clear();
60 }
61 }
62 else
63 buff.push_back(ch);
64 }
65 if (!buff.empty()) {
66 results.emplace_back(buff);
67 buff.clear();
68 }
69 return std::move(results);
70 }
71
72 unsigned int parse_mode(const std::string &modeString)
73 {

Callers 1

chmod_rFunction · 0.70

Calls 3

moveFunction · 0.70
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected