1 #include <msp/io/console.h>
4 #include "process_private.h"
10 Process *Process::_self = nullptr;
12 Process::Process(const Private &p):
20 Process &Process::self()
25 platform_get_self_info(_priv);
26 _self = new Process(_priv);
31 void Process::set_working_directory(const FS::Path &d)
36 void Process::redirect_cin(IO::Base &io)
41 void Process::redirect_cout(IO::Base &io)
43 do_redirect(cout, io);
46 void Process::redirect_cerr(IO::Base &io)
48 do_redirect(cerr, io);
51 void Process::do_redirect(IO::Base *&ptr, IO::Base &io)
58 IO::cout.redirect(io);
60 IO::cerr.redirect(io);
69 void Process::execute(const string &command, const Arguments &args)
71 execute(command, true, args);
74 void Process::execute(const FS::Path &command, const Arguments &args)
76 execute(command.str(), false, args);
79 unsigned Process::get_exit_code() const
82 throw invalid_state("not finished");