E-MailRelay
Public Member Functions | Public Attributes | List of all members
G::NewProcessConfig Struct Reference

Provides syntactic sugar for the G::NewProcess constructor. More...

#include <gnewprocess.h>

Public Member Functions

 NewProcessConfig (const Path &exe)
 Constructor. More...
 
 NewProcessConfig (const ExecutableCommand &cmd)
 Constructor. More...
 
 NewProcessConfig (const Path &exe, const std::string &argv1)
 Constructor. More...
 
 NewProcessConfig (const Path &exe, const std::string &argv1, const std::string &argv2)
 Constructor. More...
 
 NewProcessConfig (const Path &exe, const StringArray &args)
 Constructor. More...
 
NewProcessConfigset_args (const StringArray &args)
 Sets the command-line arguments. More...
 
NewProcessConfigset_env (const Environment &env)
 Sets the environment. More...
 
NewProcessConfigset_fd_stdin (NewProcess::Fd)
 Sets the standard-input file descriptor. More...
 
NewProcessConfigset_fd_stdout (NewProcess::Fd)
 Sets the standard-output file descriptor. More...
 
NewProcessConfigset_fd_stderr (NewProcess::Fd)
 Sets the standard-error file descriptor. More...
 
NewProcessConfigset_cd (const G::Path &)
 Sets the working directory. More...
 
NewProcessConfigset_strict_path (bool=true)
 Sets the 'strict_path' value. More...
 
NewProcessConfigset_run_as_id (const G::Identity &)
 Sets the run-as id. More...
 
NewProcessConfigset_strict_id (bool=true)
 Sets the 'strict_id' value. More...
 
NewProcessConfigset_exec_error_exit (int)
 Sets the 'exec_error_exit' value. More...
 
NewProcessConfigset_exec_error_format (const std::string &)
 Sets the 'exec_error_format' value. More...
 
NewProcessConfigset_exec_error_format_fn (std::string(*)(std::string, int))
 Sets the 'exec_error_format_fn' value. More...
 

Public Attributes

Path m_path
 
StringArray m_args
 
Environment m_env {Environment::minimal()}
 
NewProcess::Fd m_stdin {NewProcess::Fd::devnull()}
 
NewProcess::Fd m_stdout {NewProcess::Fd::pipe()}
 
NewProcess::Fd m_stderr {NewProcess::Fd::devnull()}
 
Path m_cd
 
bool m_strict_path {true}
 
Identity m_run_as {Identity::invalid()}
 
bool m_strict_id {true}
 
int m_exec_error_exit {127}
 
std::string m_exec_error_format
 
std::string(* m_exec_error_format_fn )(std::string, int)
 

Detailed Description

Provides syntactic sugar for the G::NewProcess constructor.

Definition at line 256 of file gnewprocess.h.

Constructor & Destructor Documentation

◆ NewProcessConfig() [1/5]

G::NewProcessConfig::NewProcessConfig ( const Path exe)
inlineexplicit

Constructor.

Definition at line 325 of file gnewprocess.h.

◆ NewProcessConfig() [2/5]

G::NewProcessConfig::NewProcessConfig ( const ExecutableCommand cmd)
inlineexplicit

Constructor.

Definition at line 338 of file gnewprocess.h.

◆ NewProcessConfig() [3/5]

G::NewProcessConfig::NewProcessConfig ( const Path exe,
const std::string &  argv1 
)
inline

Constructor.

Definition at line 345 of file gnewprocess.h.

◆ NewProcessConfig() [4/5]

G::NewProcessConfig::NewProcessConfig ( const Path exe,
const std::string &  argv1,
const std::string &  argv2 
)
inline

Constructor.

Definition at line 352 of file gnewprocess.h.

◆ NewProcessConfig() [5/5]

G::NewProcessConfig::NewProcessConfig ( const Path exe,
const StringArray args 
)
inline

Constructor.

Definition at line 331 of file gnewprocess.h.

Member Function Documentation

◆ set_args()

G::NewProcessConfig & G::NewProcessConfig::set_args ( const StringArray args)
inline

Sets the command-line arguments.

Definition at line 359 of file gnewprocess.h.

◆ set_cd()

G::NewProcessConfig & G::NewProcessConfig::set_cd ( const G::Path cd)
inline

Sets the working directory.

Definition at line 364 of file gnewprocess.h.

◆ set_env()

G::NewProcessConfig & G::NewProcessConfig::set_env ( const Environment env)
inline

Sets the environment.

Definition at line 360 of file gnewprocess.h.

◆ set_exec_error_exit()

G::NewProcessConfig & G::NewProcessConfig::set_exec_error_exit ( int  exec_error_exit)
inline

Sets the 'exec_error_exit' value.

Definition at line 368 of file gnewprocess.h.

◆ set_exec_error_format()

G::NewProcessConfig & G::NewProcessConfig::set_exec_error_format ( const std::string &  exec_error_format)
inline

Sets the 'exec_error_format' value.

Definition at line 369 of file gnewprocess.h.

◆ set_exec_error_format_fn()

G::NewProcessConfig & G::NewProcessConfig::set_exec_error_format_fn ( std::string(*)(std::string, int)  exec_error_format_fn)
inline

Sets the 'exec_error_format_fn' value.

Definition at line 370 of file gnewprocess.h.

◆ set_fd_stderr()

G::NewProcessConfig & G::NewProcessConfig::set_fd_stderr ( NewProcess::Fd  fd)
inline

Sets the standard-error file descriptor.

Definition at line 363 of file gnewprocess.h.

◆ set_fd_stdin()

G::NewProcessConfig & G::NewProcessConfig::set_fd_stdin ( NewProcess::Fd  fd)
inline

Sets the standard-input file descriptor.

Definition at line 361 of file gnewprocess.h.

◆ set_fd_stdout()

G::NewProcessConfig & G::NewProcessConfig::set_fd_stdout ( NewProcess::Fd  fd)
inline

Sets the standard-output file descriptor.

Definition at line 362 of file gnewprocess.h.

◆ set_run_as_id()

G::NewProcessConfig & G::NewProcessConfig::set_run_as_id ( const G::Identity run_as)
inline

Sets the run-as id.

Definition at line 366 of file gnewprocess.h.

◆ set_strict_id()

G::NewProcessConfig & G::NewProcessConfig::set_strict_id ( bool  strict_id = true)
inline

Sets the 'strict_id' value.

Definition at line 367 of file gnewprocess.h.

◆ set_strict_path()

G::NewProcessConfig & G::NewProcessConfig::set_strict_path ( bool  strict_path = true)
inline

Sets the 'strict_path' value.

Definition at line 365 of file gnewprocess.h.

Member Data Documentation

◆ m_args

StringArray G::NewProcessConfig::m_args

Definition at line 310 of file gnewprocess.h.

◆ m_cd

Path G::NewProcessConfig::m_cd

Definition at line 315 of file gnewprocess.h.

◆ m_env

Environment G::NewProcessConfig::m_env {Environment::minimal()}

Definition at line 311 of file gnewprocess.h.

◆ m_exec_error_exit

int G::NewProcessConfig::m_exec_error_exit {127}

Definition at line 319 of file gnewprocess.h.

◆ m_exec_error_format

std::string G::NewProcessConfig::m_exec_error_format

Definition at line 320 of file gnewprocess.h.

◆ m_exec_error_format_fn

std::string(* G::NewProcessConfig::m_exec_error_format_fn) (std::string, int)
inline

Definition at line 321 of file gnewprocess.h.

◆ m_path

Path G::NewProcessConfig::m_path

Definition at line 309 of file gnewprocess.h.

◆ m_run_as

Identity G::NewProcessConfig::m_run_as {Identity::invalid()}

Definition at line 317 of file gnewprocess.h.

◆ m_stderr

NewProcess::Fd G::NewProcessConfig::m_stderr {NewProcess::Fd::devnull()}

Definition at line 314 of file gnewprocess.h.

◆ m_stdin

NewProcess::Fd G::NewProcessConfig::m_stdin {NewProcess::Fd::devnull()}

Definition at line 312 of file gnewprocess.h.

◆ m_stdout

NewProcess::Fd G::NewProcessConfig::m_stdout {NewProcess::Fd::pipe()}

Definition at line 313 of file gnewprocess.h.

◆ m_strict_id

bool G::NewProcessConfig::m_strict_id {true}

Definition at line 318 of file gnewprocess.h.

◆ m_strict_path

bool G::NewProcessConfig::m_strict_path {true}

Definition at line 316 of file gnewprocess.h.


The documentation for this struct was generated from the following file: