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

Classes

struct  RedirectDescriptor
 

Public Member Functions

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

Protected Types

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