1 #include <msp/io/console.h>
3 #include "process_private.h"
9 Process *Process::_self = nullptr;
11 Process::Process(const Private &p):
19 Process &Process::self()
24 platform_get_self_info(_priv);
25 _self = new Process(_priv);
30 void Process::set_working_directory(const FS::Path &d)
35 void Process::redirect_cin(IO::Base &io)
40 void Process::redirect_cout(IO::Base &io)
42 do_redirect(cout, io);
45 void Process::redirect_cerr(IO::Base &io)
47 do_redirect(cerr, io);
50 void Process::do_redirect(IO::Base *&ptr, IO::Base &io)
57 IO::cout.redirect(io);
59 IO::cerr.redirect(io);
68 void Process::execute(const string &command, const Arguments &args)
70 execute(command, true, args);
73 void Process::execute(const FS::Path &command, const Arguments &args)
75 execute(command.str(), false, args);
78 unsigned Process::get_exit_code() const
81 throw logic_error("not finished");