37 lines
986 B
C++
37 lines
986 B
C++
|
|
#pragma once
|
||
|
|
#include <fc/interprocess/iprocess.hpp>
|
||
|
|
|
||
|
|
namespace fc {
|
||
|
|
|
||
|
|
fc::path find_executable_in_path( const fc::string name );
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief start and manage an local process
|
||
|
|
* @note this class implements reference semantics.
|
||
|
|
*/
|
||
|
|
class process : public iprocess
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
process();
|
||
|
|
~process();
|
||
|
|
|
||
|
|
virtual iprocess& exec( const fc::path& exe,
|
||
|
|
vector<string> args,
|
||
|
|
const fc::path& work_dir = fc::path(),
|
||
|
|
exec_opts opts = open_all );
|
||
|
|
|
||
|
|
virtual int result();
|
||
|
|
virtual void kill();
|
||
|
|
virtual fc::buffered_ostream_ptr in_stream();
|
||
|
|
virtual fc::buffered_istream_ptr out_stream();
|
||
|
|
virtual fc::buffered_istream_ptr err_stream();
|
||
|
|
|
||
|
|
class impl;
|
||
|
|
private:
|
||
|
|
std::unique_ptr<impl> my;
|
||
|
|
};
|
||
|
|
|
||
|
|
typedef std::shared_ptr<process> process_ptr;
|
||
|
|
|
||
|
|
} // namespace fc
|