std::string capture_exec (const char *const *command, ExecResult &res)
{ return capture_exec<const char *const *>(command, res); }
+std::string capture_exec (const std::vector<std::string> &command, ExecResult &res)
+{
+ return capture_exec<const std::vector<std::string> &>(command, res);
+}
+
#define PIPE_CTOR_FAIL(where) \
do { \
throw EXCEPTION (pipestream_error, \
setg (&buffer, &buffer, &buffer);
}
+inpipebuf::inpipebuf(const std::vector<std::string> &command)
+ : pipe (NULL) /* brr: shadowing global ident */
+ , status_set (NULL)
+ , exit_status (NULL)
+{
+ if (command.empty ()) {
+ PIPE_CTOR_FAIL("command");
+ }
+
+ const boost::shared_array <char *> argv = mk_argv (command);
+ if (!argv) {
+ PIPE_CTOR_FAIL("malloc");
+ }
+
+ this->pipe = this->init_without_shell (argv.get ());
+
+ setg (&buffer, &buffer, &buffer);
+}
+
inpipebuf::inpipebuf(const std::string& command)
{
status_set = NULL;