MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / SplitString

Function SplitString

src/base/strings.h:35–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33static const char* TIME_LABEL[] = {"ms", "s", "m", "h", "d"};
34
35static inline void SplitString(const std::string& full,
36 const std::string& delim,
37 std::vector<std::string>& result) { // NOLINT
38 result.clear();
39 if (full.empty()) {
40 return;
41 }
42 std::string tmp;
43 std::string::size_type pos_begin = full.find_first_not_of(delim);
44 std::string::size_type comma_pos = 0;
45 while (pos_begin != std::string::npos) {
46 comma_pos = full.find(delim, pos_begin);
47 if (comma_pos != std::string::npos) {
48 tmp = full.substr(pos_begin, comma_pos - pos_begin);
49 pos_begin = comma_pos + delim.length();
50 } else {
51 tmp = full.substr(pos_begin);
52 pos_begin = comma_pos;
53 }
54
55 if (!tmp.empty()) {
56 result.push_back(tmp);
57 tmp.clear();
58 }
59 }
60}
61
62static inline bool IsVisible(char c) { return (c >= 0x20 && c <= 0x7E); }
63

Callers 14

InitMethod · 0.85
DelRecycleMethod · 0.85
ConvertFunction · 0.85
AppendValueMethod · 0.85
TEST_FFunction · 0.85
GetParameterMapFunction · 0.85
HandleNSClientAddIndexFunction · 0.85
HandleNSDeleteFunction · 0.85
GetColumnMapFunction · 0.85
HandleNSCreateTableFunction · 0.85
HandleClientCreateTableFunction · 0.85
StartClientFunction · 0.85

Calls 2

clearMethod · 0.80
emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.68