1 #ifndef UTILMM_PROCESS_H 2 #define UTILMM_PROCESS_H 3 #include "utilmm/config/config.h" 5 #include <boost/noncopyable.hpp> 6 #include <boost/filesystem/path.hpp> 28 typedef std::list<process*>::iterator ProcessHandle;
29 ProcessHandle m_handle;
31 boost::filesystem::path m_wdir;
32 typedef std::list<std::string> CommandLine;
33 CommandLine m_cmdline;
35 typedef std::map<std::string, std::string> Env;
41 void redirect(FILE* stream);
43 output_file m_stdout, m_stderr;
44 output_file& get_stream(
Stream stream);
55 void send_child_error(
int fd,
int error_type);
56 void process_child_error(
int fd);
65 void set_workdir(boost::filesystem::path
const& dir);
69 boost::filesystem::path
workdir()
const;
73 std::list<std::string>
cmdline()
const;
75 void push(
const std::string& arg);
95 void signal(
int signo = SIGINT);
157 void set_environment(
const std::string& key,
const std::string& value);
162 std::string
environment(
const std::string& key)
const;
void set_environment(const std::string &key, const std::string &value)
void redirect_to(Stream stream, int handle, bool auto_close=true)
void push(const std::string &arg)
std::list< std::string > cmdline() const
void set_workdir(boost::filesystem::path const &dir)
std::string environment(const std::string &key) const
void erase_redirection(Stream stream)
Stream
Definition: process.hh:25
Definition: process.hh:20
static void install_sigint_handler()
process & operator<<(std::string const &newarg)
boost::filesystem::path workdir() const
static const int InvalidHandle
Definition: process.hh:23
Definition: auto_flag.hh:6
Definition: process.hh:25
Definition: process.hh:25
void signal(int signo=SIGINT)
Definition: process.hh:59