16 #include <boost/shared_array.hpp>
17 #include <boost/tokenizer.hpp>
26 c_str(
const std::string&
s)
28 return const_cast<char*
>(
s.c_str());
34 using tokenizer = boost::tokenizer<boost::escaped_list_separator<char>>;
35 boost::escaped_list_separator<char> sep(
'\\',
' ',
'\"');
36 tokenizer tok(
s, sep);
37 args_.assign(tok.begin(), tok.end());
38 cmd_line_.reset(
new char*[args_.size() + 1]);
40 cmd_line_[args_.size()] = 0;
43 template <
class PosixExecutor>
47 e.cmd_line = cmd_line_.get();
51 std::vector<std::string> args_;
52 boost::shared_array<char*> cmd_line_;