DebugServer2
Loading...
Searching...
No Matches
ds2::Host::ProcessSpawner Class Reference
Collaboration diagram for ds2::Host::ProcessSpawner:

Classes

struct  RedirectDescriptor
 

Public Member Functions

bool setExecutable (std::string const &path)
 
bool setShellCommand (std::string const &command)
 
bool setWorkingDirectory (std::string const &path)
 
bool setArguments (StringCollection const &args)
 
template<typename... Args>
bool setArguments (Args const &... args)
 
bool setEnvironment (EnvironmentBlock const &env)
 
bool addEnvironment (std::string const &key, std::string const &val)
 
bool redirectInputToConsole ()
 
bool redirectOutputToConsole ()
 
bool redirectErrorToConsole ()
 
bool redirectInputToNull ()
 
bool redirectOutputToNull ()
 
bool redirectErrorToNull ()
 
bool redirectInputToFile (std::string const &path)
 
bool redirectOutputToFile (std::string const &path)
 
bool redirectErrorToFile (std::string const &path)
 
bool redirectOutputToBuffer ()
 
bool redirectErrorToBuffer ()
 
bool redirectInputToTerminal ()
 
bool redirectOutputToDelegate (RedirectDelegate delegate)
 
bool redirectErrorToDelegate (RedirectDelegate delegate)
 
ErrorCode run (std::function< bool()> preExecAction=[]() { return true;})
 
ErrorCode wait ()
 
bool isRunning () const
 
void flushAndExit ()
 
ProcessId pid () const
 
int exitStatus () const
 
int signalCode () const
 
std::string const & executable () const
 
StringCollection const & arguments () const
 
EnvironmentBlock const & environment () const
 
ErrorCode input (ByteVector const &buf)
 
std::string const & output () const
 
bool setExecutable (std::string const &path)
 
bool setShellCommand (std::string const &command)
 
bool setWorkingDirectory (std::string const &path)
 
bool setArguments (StringCollection const &args)
 
template<typename... Args>
bool setArguments (Args const &... args)
 
bool setEnvironment (EnvironmentBlock const &args)
 
bool addEnvironment (std::string const &key, std::string const &val)
 
bool redirectInputToConsole ()
 
bool redirectOutputToConsole ()
 
bool redirectErrorToConsole ()
 
bool redirectInputToNull ()
 
bool redirectOutputToNull ()
 
bool redirectErrorToNull ()
 
bool redirectInputToFile (std::string const &path)
 
bool redirectOutputToFile (std::string const &path)
 
bool redirectErrorToFile (std::string const &path)
 
bool redirectOutputToBuffer ()
 
bool redirectErrorToBuffer ()
 
bool redirectInputToTerminal ()
 
bool redirectOutputToDelegate (RedirectDelegate delegate)
 
bool redirectErrorToDelegate (RedirectDelegate delegate)
 
ErrorCode run (std::function< bool()> preExecAction=[]() { return true;})
 
ErrorCode wait ()
 
bool isRunning () const
 
void flushAndExit ()
 
ProcessId pid () const
 
HANDLE handle () const
 
ThreadId tid () const
 
HANDLE threadHandle () const
 
int exitStatus () const
 
int signalCode () const
 
std::string const & executable () const
 
StringCollection const & arguments () const
 
EnvironmentBlock const & environment () const
 
ErrorCode input (ByteVector const &buf)
 
std::string const & output () const
 

Protected Types

enum  RedirectMode {
  kRedirectUnset , kRedirectConsole , kRedirectNull , kRedirectFile ,
  kRedirectBuffer , kRedirectDelegate , kRedirectTerminal
}
 
typedef std::function< void(void *buf, size_t size)> RedirectDelegate
 

Protected Attributes

std::string _executablePath
 
StringCollection _arguments
 
EnvironmentBlock _environment
 
std::string _workingDirectory
 
std::thread _delegateThread
 
RedirectDescriptor _descriptors [3]
 
std::string _outputBuffer
 
int _exitStatus
 
int _signalCode
 
ProcessId _pid
 
bool _shell
 
HANDLE _handle
 
ThreadId _tid
 
HANDLE _threadHandle
 

The documentation for this class was generated from the following files: