#include <stdio.h>
+#include <cstring>
#include <string>
#include <streambuf>
#include <istream>
std::string capture_exec(const std::string& command, ExecResult &rescode);
std::string capture_exec(const char *const *command, ExecResult &rescode,
- const bool out=true, const bool err=false);
+ const bool out=true, const bool err=false,
+ const bool path=false);
std::string capture_exec(const std::vector<std::string>& command, ExecResult &rescode,
- const bool out=true, const bool err=false);
+ const bool out=true, const bool err=false,
+ const bool path=false);
inline std::string capture_exec (const std::string &command)
{
public:
inpipebuf(const std::string& command,
- const bool out, const bool err);
+ const bool out, const bool err, const bool path);
inpipebuf(const char *const *command,
- const bool out, const bool err);
+ const bool out, const bool err, const bool path);
inpipebuf(const std::vector<std::string> &command,
- const bool out, const bool err);
+ const bool out, const bool err, const bool path);
~inpipebuf();
private:
std::pair <pid_t, FILE *>
init_without_shell (const char *const *argv,
- const bool out, const bool err) const;
+ const bool out, const bool err,
+ const bool path) const;
};
/** @brief stream around inpipebuf -- see comment there */
public:
inpipestream(const std::string& command,
- const bool out=true, const bool err=false)
- : std::istream(&buf), buf(command, out, err)
+ const bool out=true, const bool err=false,
+ const bool path=false)
+ : std::istream(&buf), buf(command, out, err, path)
{}
inpipestream(const char *const command[],
- const bool out=true, const bool err=false)
- : std::istream(&buf), buf(command, out, err)
+ const bool out=true, const bool err=false,
+ const bool path=false)
+ : std::istream(&buf), buf(command, out, err, path)
{}
inpipestream(const std::vector<std::string> &command,
- const bool out=true, const bool err=false)
- : std::istream(&buf), buf(command, out, err)
+ const bool out=true, const bool err=false,
+ const bool path=false)
+ : std::istream(&buf), buf(command, out, err, path)
{}
void store_exit_status(bool *_status_set, int *_exit_status)