MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / Split

Function Split

oneflow/core/common/str_util.cpp:64–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void Split(const std::string& text, const std::string& delims,
65 std::function<void(std::string&&)> Func) {
66 size_t token_start = 0;
67 if (text.empty()) { return; }
68 for (size_t i = 0; i < text.size() + 1; ++i) {
69 if ((i == text.size()) || (delims.find(text[i]) != std::string::npos)) {
70 Func(text.substr(token_start, i - token_start));
71 token_start = i + 1;
72 }
73 }
74}
75
76std::string Dirname(const std::string& path) {
77 size_t found = path.rfind('/');

Callers 7

SetStateMethod · 0.85
sbp_context.cppFile · 0.85
ParseNdSbpFromLongStringFunction · 0.85
GetStateMethod · 0.85
SplitAndParseAsFunction · 0.85
operator()Method · 0.85

Calls 4

FuncFunction · 0.85
findMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected