MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / split

Function split

docopt_util.h:50–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 }
49
50 std::vector<std::string> split(std::string const& str, size_t pos = 0)
51 {
52 const char* const anySpace = " \t\r\n\v\f";
53
54 std::vector<std::string> ret;
55 while (pos != std::string::npos) {
56 auto start = str.find_first_not_of(anySpace, pos);
57 if (start == std::string::npos) break;
58
59 auto end = str.find_first_of(anySpace, start);
60 auto size = end==std::string::npos ? end : end-start;
61 ret.emplace_back(str.substr(start, size));
62
63 pos = end;
64 }
65
66 return ret;
67 }
68
69 std::tuple<std::string, std::string, std::string> partition(std::string str, std::string const& point)
70 {

Callers 2

formal_usageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected