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

Function partition

docopt_util.h:69–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 }
68
69 std::tuple<std::string, std::string, std::string> partition(std::string str, std::string const& point)
70 {
71 std::tuple<std::string, std::string, std::string> ret;
72
73 auto i = str.find(point);
74
75 if (i == std::string::npos) {
76 // no match: string goes in 0th spot only
77 } else {
78 std::get<2>(ret) = str.substr(i + point.size());
79 std::get<1>(ret) = point;
80 str.resize(i);
81 }
82 std::get<0>(ret) = std::move(str);
83
84 return ret;
85 }
86
87 template <typename I>
88 std::string join(I iter, I end, std::string const& delim) {

Callers 1

parse_longFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected