CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Command Class Reference

Parameters for process creation. More...

#include <cc/Command>

Inheritance diagram for Command:

Public Member Functions

 Command ()
 Create a new command.
 
 Command (const String &command)
 Create a new command with executable name and arguments extracted from command.
 
Commandargs (const List< String > &args)
 Set command line arguments to args (args[0] provides the executable name)
 
Commandenv (const Map< String > &map)
 Set environment map to map
 
Commandgroup (int groupId=0)
 Set the process group to groupId (pass zero to start a new process group)
 
CommandsignalMask (const SignalSet &mask)
 Set the signal mask to mask
 
CommandsignalDefault (const SignalSet &set)
 Reset signal handling strategy to the default for the signals in set.
 
CommandworkDir (const String &path)
 Set initial working directory to path
 
Commandio (int fd, const IoChannel &channel)
 Setup I/O channel channel to appear in the child's files descriptor table under fd.
 
Commandio (int fd, const IoStream &stream)
 Setup I/O stream stream to appear in the child's files descriptor table under fd.
 
- Public Member Functions inherited from Object
 Object ()=default
 Create a null object.
 
 operator bool () const
 Check if this is a non-null object.
 
bool isNull () const
 Check if this is a null object.
 
template<class T >
bool is () const
 Check if this object is of type T.
 
template<class T >
as () const
 Cast this object to type T.
 
bool isWeak () const
 Check if the underlying object reference is weak.
 
bool operator== (const Object &other) const
 Equality operator.
 
std::strong_ordering operator<=> (const Object &other) const
 Ordering operator.
 
long useCount () const
 Reference count.
 

Additional Inherited Members

- Protected Member Functions inherited from Object
template<class T >
weak () const
 
template<class T >
void initOnce ()
 Create the object state when called the first time.
 
template<class T >
void initOncePerThread ()
 Create a distinct object state for each thread when called the first time in that thread.
 
 Object (State *newState)
 Initialize object with newState.
 
 Object (State *state, Alias)
 
 Object (State *state, Weak)
 
Objectoperator= (std::nullptr_t)
 
- Static Protected Member Functions inherited from Object
template<class T >
static T alias (const State *state)
 Create an alias object for the given state.
 
template<class T >
static T weak (const State *state)
 
- Protected Attributes inherited from Object
Handle< Stateme
 Internal object state
 

Detailed Description

Parameters for process creation.

Exceptions
SystemError

Constructor & Destructor Documentation

◆ Command() [1/2]

Command ( )

Create a new command.

◆ Command() [2/2]

Command ( const String & command)
explicit

Create a new command with executable name and arguments extracted from command.

Member Function Documentation

◆ args()

Command & args ( const List< String > & args)

Set command line arguments to args (args[0] provides the executable name)

◆ env()

Command & env ( const Map< String > & map)

Set environment map to map

◆ group()

Command & group ( int groupId = 0)

Set the process group to groupId (pass zero to start a new process group)

◆ signalMask()

Command & signalMask ( const SignalSet & mask)

Set the signal mask to mask

◆ signalDefault()

Command & signalDefault ( const SignalSet & set)

Reset signal handling strategy to the default for the signals in set.

◆ workDir()

Command & workDir ( const String & path)

Set initial working directory to path

Warning
This method is not thread-safe on all platforms! This is especially true on glibc before v2.29.

◆ io() [1/2]

Command & io ( int fd,
const IoChannel & channel )

Setup I/O channel channel to appear in the child's files descriptor table under fd.

◆ io() [2/2]

Command & io ( int fd,
const IoStream & stream )

Setup I/O stream stream to appear in the child's files descriptor table under fd.