13 #include <boost/tokenizer.hpp>
14 #include <boost/shared_array.hpp>
24 static char* c_str(
const std::string&
s)
26 return const_cast<char*
>(
s.c_str());
32 using tokenizer = boost::tokenizer<boost::escaped_list_separator<char> >;
33 boost::escaped_list_separator<char> sep(
'\\',
' ',
'\"');
34 tokenizer tok(
s, sep);
35 args_.assign(tok.begin(), tok.end());
36 cmd_line_.reset(
new char* [args_.size() + 1]);
38 cmd_line_[args_.size()] = 0;
41 template <
class PosixExecutor>
44 e.cmd_line = cmd_line_.get();
48 std::vector<std::string> args_;
49 boost::shared_array<char*> cmd_line_;