135#if qStroika_Foundation_Common_Platform_Windows
136 CommandLine::WrapInShell::eWindowsCMD
138 CommandLine::WrapInShell::eBash
151 optional<filesystem::path> fWorkingDirectory;
178 bool fDetached{
false};
180#if qStroika_Foundation_Common_Platform_POSIX
186 optional<mode_t> fChildUMask{027};
189#if qStroika_Foundation_Common_Platform_Windows
194 bool fCreateNoWindow : 1 {
true};
213#if qCompilerAndStdLib_DefaultMemberInitializerNeededEnclosingForDefaultFunArg_Buggy
223 ProcessRunner (
const String& commandLine,
const Options& o = {});
230#if qStroika_Foundation_Common_Platform_POSIX
231 using ExitStatusType = uint8_t;
232#elif qStroika_Foundation_Common_Platform_Windows
233 using ExitStatusType = DWORD;
235 using ExitStatusType = int;
244 nonvirtual CommandLine GetCommandLine ()
const;
245 nonvirtual
void SetCommandLine (
const CommandLine& args);
250 nonvirtual Options GetOptions ()
const;
251 nonvirtual
void SetOptions (
const Options& o);
260 optional<ExitStatusType> fExitStatus;
261 optional<SignalID> fTerminatedByUncaughtSignalNumber;
268 nonvirtual
String ToString ()
const;
328 nonvirtual tuple<Characters::String, Characters::String>
Run (
const Characters::String& cmdStdInValue =
""sv,
333 class BackgroundProcess;
358 nonvirtual function<void ()> CreateSimpleRunnable_ ();
365 struct DetailedRunnableRep_ {
383 nonvirtual tuple<function<void ()>, shared_ptr<DetailedRunnableRep_>> CreateDetailedRunnable_ ();
386#if qStroika_Foundation_Common_Platform_POSIX
387 static void Process_Runner_POSIX_ (
const shared_ptr<DetailedRunnableRep_>& runneeDetails,
388 [[maybe_unused]]
const optional<filesystem::path>& executable,
const CommandLine& cmdLine,
391#elif qStroika_Foundation_Common_Platform_Windows
392 static void Process_Runner_Windows_ (
const shared_ptr<DetailedRunnableRep_>& runneeDetails,
393 const optional<filesystem::path>& executable,
const CommandLine& cmdLine,
399 optional<filesystem::path> fExecutable_;
408 [[deprecated (
"Since Stroika v3.0d12 - pass stdin/stdout/stderr to ProcessRunner Run() method (if needed)")]]
ProcessRunner (
411 [[deprecated (
"Since Stroika v3.0d12 - pass stdin/stdout/stderr to ProcessRunner Run() method (if needed)")]]
ProcessRunner (
414 [[deprecated (
"Since Stroika v3.0d12 - pass stdin/stdout/stderr to ProcessRunner Run() method (if needed)")]]
ProcessRunner (
420 this->fStdOut_ = out;
421 this->fStdErr_ = error;
424 [[deprecated (
"Since Stroika v3.0d12 - use other overloads for ProcessRunner")]]
ProcessRunner (
430 this->fStdOut_ = out;
431 this->fStdErr_ = error;
434 [[deprecated (
"Since Stroika v3.0d12 - pass in/out/error streams(can be nullptr) to Run method instead of CTOR")]]
void
435 Run (optional<ProcessResultType>* processResult, ProgressMonitor::Updater progress =
nullptr,
Time::DurationSeconds timeout = Time::kInfinity);
437 [[deprecated (
"Since Stroika v3.0d12 pass in/out/error(can be nullptr) in RunInbackground() method")]] BackgroundProcess
443 [[maybe_unused]] ProgressMonitor::Updater progress);
450 [[deprecated (
"Since Stroika v3.0d23d")]] tuple<Characters::String, Characters::String>
451 Run (
const Characters::String& cmdStdInValue,
const StringOptions& stringOpts, ProgressMonitor::Updater progress,
457 [[deprecated (
"Since Stroika v3.0d12 - use GetOptions().fWorkingDirectory")]] optional<filesystem::path> GetWorkingDirectory ()
const;
458 [[deprecated (
"Since Stroika v3.0d12 - use SetOptions({.fWorkingDirectory})")]]
void SetWorkingDirectory (
const optional<filesystem::path>& d);
469 [[deprecated (
"Since Stroika v3.0d12 - pass in/out/error streams(can be nullptr) to Run method instead of CTOR")]]
void
478 [[deprecated (
"Since Stroika v3.0d12 - pass in/out/error streams(can be nullptr) to Run method instead of CTOR")]]
void
487 [[deprecated (
"Since Stroika v3.0d12 - pass in/out/error streams(can be nullptr) to Run method instead of CTOR")]]
void
nonvirtual void Run(const Streams::InputStream::Ptr< byte > &in, const Streams::OutputStream::Ptr< byte > &out=nullptr, const Streams::OutputStream::Ptr< byte > &error=nullptr, Time::DurationSeconds timeout=Time::kInfinity)
Run the command synchronously, returning its output, and THROW on any failure.
nonvirtual BackgroundProcess RunInBackground(const Streams::InputStream::Ptr< byte > &in=nullptr, const Streams::OutputStream::Ptr< byte > &out=nullptr, const Streams::OutputStream::Ptr< byte > &error=nullptr)
Run the given external command/process (set by constructor) - with the given arguments in the backgro...