13 const optional<ExitStatusType>& wExitStatus,
const optional<SignalID>& wTermSig)
14 : inherited{mkMsg_ (failureMessage, stderrFragment, wExitStatus, wTermSig)}
15 , fFailureMessage{failureMessage}
16 , fStderrFragment{stderrFragment}
17 , fExitStatus{wExitStatus}
18 , fTermSignal{wTermSig}
27#if qCompilerAndStdLib_default_member_initializer_needed_within_enclosing_class_Buggy
28 inline ProcessRunner::ProcessRunner (
const filesystem::path& executable,
const CommandLine& args)
29 : ProcessRunner{executable, args, Options{}}
32 inline ProcessRunner::ProcessRunner (
const CommandLine& args)
33 : ProcessRunner{args, Options{}}
36 inline ProcessRunner::ProcessRunner (
const String& commandLine)
37 : ProcessRunner{commandLine, Options{}}
41 inline ProcessRunner::ProcessRunner (
const filesystem::path& executable,
const CommandLine& args,
const Options& o)
42 : fExecutable_{executable}
47 inline ProcessRunner::ProcessRunner (
const CommandLine& args,
const Options& o)
54 : fExecutable_{executable}
70 inline CommandLine ProcessRunner::GetCommandLine ()
const
75 inline void ProcessRunner::SetCommandLine (
const CommandLine& args)
80 inline optional<filesystem::path> ProcessRunner::GetWorkingDirectory ()
const
83 return fOptions_.fWorkingDirectory;
85 inline void ProcessRunner::SetWorkingDirectory (
const optional<filesystem::path>& d)
88 fOptions_.fWorkingDirectory = d;
90 inline auto ProcessRunner::GetOptions () const -> Options
95 inline void ProcessRunner::SetOptions (
const Options& o)
141 return fRep_->fDetailedRunnableRep_->fProcessResult;
148 return fRep_->fDetailedRunnableRep_->fRunningPID;
153 [[deprecated (
"Since Stroika v3.0d13 - use ProcessRunner{Options{.fDetached=true}")]]
inline pid_t
161 [[deprecated (
"Since Stroika v3.0d13 - use ProcessRunner{Options{.fDetached=true}")]]
inline pid_t
DetachedProcessRunner (
const String& commandLine)
164 ProcessRunner pr{CommandLine{commandLine}, ProcessRunner::Options{.fDetached =
true}};
165 ProcessRunner::BackgroundProcess bp = pr.RunInBackground ();
166 bp.WaitForStarted ();
167 return Memory::ValueOf (bp.GetChildProcessID ());
A generalization of a vector: a container whose elements are keyed by the natural numbers.
unique_lock< AssertExternallySynchronizedChecker > WriteContext
Instantiate AssertExternallySynchronizedChecker::WriteContext to designate an area of code where prot...
shared_lock< const AssertExternallySynchronizedChecker > ReadContext
Instantiate AssertExternallySynchronizedChecker::ReadContext to designate an area of code where prote...
Exception()=delete
construct with just a message - BASE_EXCEPTION gets whatever it minimally needs.
nonvirtual void WaitForStarted(Time::DurationSeconds timeout=Time::kInfinity) const
wait until GetChildProcessID () returns a valid answer, or until the process failed to start (in whic...
nonvirtual optional< ProcessResultType > GetProcessResult() const
optional< pid_t > GetChildProcessID() const
maybe missing if process not yet (or ever successfully) launched. Child process may have already exit...
Run an external command, with stdin/stdout/stderr as strings or as streams - like perl backticks.
Streams::InputStream::Ptr< byte > GetStdIn() const
Streams::OutputStream::Ptr< byte > GetStdOut() const
Streams::OutputStream::Ptr< byte > GetStdErr() const
OutputStream<>::Ptr is Smart pointer to a stream-based sink of data.
pid_t DetachedProcessRunner(const filesystem::path &executable, const Containers::Sequence< String > &args)
DEPRECATED.