#include <streambuf>
#include <istream>
#include <ostream>
+#include <vector>
struct ExecResult
{
std::string capture_exec(const std::string& command, ExecResult &rescode);
std::string capture_exec(const char *const *command, ExecResult &rescode);
+std::string capture_exec(const std::vector<std::string>& command, ExecResult &rescode);
inline std::string capture_exec (const std::string &command)
{
return capture_exec(command,r);
}
+inline std::string capture_exec(const std::vector<std::string>& command)
+{
+ ExecResult r;
+ return capture_exec(command,r);
+}
+
/** @brief runs command and provides buffered input for it through pipe
*
* opens pipe to command using popen; exit status available after destruction
public:
inpipebuf(const std::string& command);
inpipebuf(const char *const *command);
+ inpipebuf(const std::vector<std::string> &command);
~inpipebuf();
: std::istream(&buf), buf(command)
{}
+ inpipestream(const std::vector<std::string> &command)
+ : std::istream(&buf), buf(command)
+ {}
+
void store_exit_status(bool *_status_set, int *_exit_status)
{ buf.store_exit_status(_status_set, _exit_status); }
};