ProcessInfo Class Reference

#include <Pt/System/Process.h>

Process startup parameters

Public Types

enum  IOMode {
  Keep = 0,
  Close = 1,
  Redirect = 2,
  ToStdOut = 3
}
 Flags for process I/O. More...
 

Public Member Functions

 ProcessInfo (const Path &command)
 Construct with command to execute.
 
const Pathcommand () const
 Command to execute.
 
ProcessInfoaddArg (const std::string &argument)
 Adds an argument to the list of arguments.
 
std::size_t argCount () const
 Number of command line arguments.
 
const std::string & arg (std::size_t idx) const
 Returns a command line argument.
 
std::string toString () const
 Returns full command line.
 
bool isDetached () const
 Returns true if process should detach.
 
void setDetached (bool sw)
 Process should detach.
 
void setStdInput (IOMode mode)
 Sets I/O flags for stdin.
 
bool isStdInputClosed () const
 Returns true if stdin will be closed.
 
bool isStdInputRedirected () const
 Returns true if stdin will be redirected.
 
void setStdOutput (IOMode mode)
 Sets I/O flags for stdout.
 
bool isStdOutputClosed () const
 Returns true if stdout will be closed.
 
bool isStdOutputRedirected () const
 Returns true if stdout will be redirected.
 
void setStdError (IOMode mode)
 Sets I/O flags for stderr.
 
bool isStdErrorClosed () const
 Returns true if stderr will be closed.
 
bool isStdErrorRedirected () const
 Returns true if stderr will be redirected.
 
bool isStdErrorAsOutput () const
 Returns true if stderr and atdout wil be combined.
 

Member Enumeration Documentation

◆ IOMode

enum IOMode
Enumerator
Keep 

Keep open.

Close 

Close I/O.

Redirect 

Redirect I/O.

ToStdOut 

Combine stderr with stdout, only valid for stderr.