添加 'SubProcessIO.h'
This commit is contained in:
parent
61aef41551
commit
e576d13a4f
24
SubProcessIO.h
Normal file
24
SubProcessIO.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#pragma once
|
||||||
|
#include <string>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
class SubProcessIO
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SubProcessIO(const std::string& Command,bool TerminateOnDestruct=false) throw(std::runtime_error);
|
||||||
|
SubProcessIO(const SubProcessIO& )=delete;
|
||||||
|
~SubProcessIO();
|
||||||
|
int writeToSubProcess(const char* buffer,int szToWrite);
|
||||||
|
int peekSubProcess();
|
||||||
|
int readFromSubProcess(char* buffer,int szToRead);
|
||||||
|
int wait();
|
||||||
|
int wait(int ms);
|
||||||
|
int getExitCode();
|
||||||
|
int terminate();
|
||||||
|
void detach();
|
||||||
|
protected:
|
||||||
|
int createSubProcessWith(const std::string& Command);
|
||||||
|
private:
|
||||||
|
struct _impl;
|
||||||
|
_impl* _pimpl;
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user