MCPcopy Create free account
hub / github.com/creatale/node-dv / split_string

Function split_string

deps/opencv/modules/core/src/cmdparser.cpp:56–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54#endif
55
56vector<string> split_string(const string& str, const string& delimiters)
57{
58 vector<string> res;
59
60 string split_str = str;
61 size_t pos_delim = split_str.find(delimiters);
62
63 while ( pos_delim != string::npos)
64 {
65 if (pos_delim == 0)
66 {
67 res.push_back("");
68 split_str.erase(0, 1);
69 }
70 else
71 {
72 res.push_back(split_str.substr(0, pos_delim));
73 split_str.erase(0, pos_delim + 1);
74 }
75
76 pos_delim = split_str.find(delimiters);
77 }
78
79 res.push_back(split_str);
80
81 return res;
82}
83
84string del_space(string name)
85{

Callers 4

CommandLineParserMethod · 0.85
hasMethod · 0.85
getStringMethod · 0.85
printParamsMethod · 0.85

Calls 3

eraseMethod · 0.80
findMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected