1 #include <msp/io/console.h>
3 #include "process_private.h"
9 Process *Process::_self = 0;
11 Process::Process(const Private &p):
34 Process &Process::self()
39 platform_get_self_info(_priv);
40 _self = new Process(_priv);
45 void Process::set_working_directory(const FS::Path &d)
50 void Process::redirect_cin(IO::Base &io)
55 void Process::redirect_cout(IO::Base &io)
57 do_redirect(cout, io);
60 void Process::redirect_cerr(IO::Base &io)
62 do_redirect(cerr, io);
65 void Process::do_redirect(IO::Base *&ptr, IO::Base &io)
72 IO::cout.redirect(io);
74 IO::cerr.redirect(io);
83 void Process::execute(const string &command, const Arguments &args)
85 execute(command, true, args);
88 void Process::execute(const FS::Path &command, const Arguments &args)
90 execute(command.str(), false, args);
93 unsigned Process::get_exit_code() const
96 throw logic_error("not finished");