OpendTect 8.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
OS::CommandLauncher Class Reference

Launches machine commands. More...

#include <oscommand.h>

Public Member Functions

 CommandLauncher (const MachineCommand &)
 
 ~CommandLauncher ()
 
uiString errorMsg () const
 
bool execute (BufferString &output_stdout, BufferString *output_stderr=nullptr, const char *workdir=nullptr)
 run &, wait until finished, catch output
 
bool execute (const CommandExecPars &)
 
bool execute (LaunchType lt=Wait4Finish, const char *workdir=nullptr)
 
int exitCode () const
 
od_istreamgetStdError ()
 
od_ostreamgetStdInput ()
 
od_istreamgetStdOutput ()
 
const char * monitorFileName () const
 
PID_Type processID () const
 
void set (const MachineCommand &)
 
bool startServer (bool inpythonenv=false, const char *stdoutfnm=nullptr, const char *stderrfnm=nullptr, double maxwaittm=20)
 

Static Public Member Functions

static bool openTerminal (const char *cmd, const BufferStringSet *args=nullptr, BufferString *errmsg=nullptr, uiString *launchermsg=nullptr, const char *workdir=nullptr)
 

Protected Member Functions

int catchError ()
 
bool doExecute (const MachineCommand &, const CommandExecPars &)
 
void reset ()
 
bool startDetached (const MachineCommand &, bool inconsole=false, const char *workingdir=nullptr)
 
void startMonitor ()
 

Static Protected Member Functions

static void manageQProcess (QProcess *)
 

Protected Attributes

uiString errmsg_
 
int exitcode_ = Values::Undef< int >::val()
 
MachineCommand machcmd_
 
BufferString monitorfnm_
 
const BufferString odprogressviewer_
 
PID_Type pid_ = 0
 
QProcess * process_ = nullptr
 
BufferString progvwrcmd_
 
od_istreamstderror_ = nullptr
 
qstreambufstderrorbuf_ = nullptr
 
od_ostreamstdinput_ = nullptr
 
qstreambufstdinputbuf_ = nullptr
 
od_istreamstdoutput_ = nullptr
 
qstreambufstdoutputbuf_ = nullptr
 

Detailed Description

Launches machine commands.

<>

Constructor & Destructor Documentation

◆ CommandLauncher()

OS::CommandLauncher::CommandLauncher ( const MachineCommand & )

◆ ~CommandLauncher()

OS::CommandLauncher::~CommandLauncher ( )

Member Function Documentation

◆ catchError()

int OS::CommandLauncher::catchError ( )
protected

◆ doExecute()

bool OS::CommandLauncher::doExecute ( const MachineCommand & ,
const CommandExecPars &  )
protected

◆ errorMsg()

uiString OS::CommandLauncher::errorMsg ( ) const
inline

◆ execute() [1/3]

bool OS::CommandLauncher::execute ( BufferString & output_stdout,
BufferString * output_stderr = nullptr,
const char * workdir = nullptr )

run &, wait until finished, catch output

◆ execute() [2/3]

bool OS::CommandLauncher::execute ( const CommandExecPars & )

◆ execute() [3/3]

bool OS::CommandLauncher::execute ( LaunchType lt = Wait4Finish,
const char * workdir = nullptr )

◆ exitCode()

int OS::CommandLauncher::exitCode ( ) const

◆ getStdError()

od_istream * OS::CommandLauncher::getStdError ( )
inline

◆ getStdInput()

od_ostream * OS::CommandLauncher::getStdInput ( )
inline

◆ getStdOutput()

od_istream * OS::CommandLauncher::getStdOutput ( )
inline

◆ manageQProcess()

static void OS::CommandLauncher::manageQProcess ( QProcess * )
staticprotected

Add a QProcess and it will be deleted one day.

◆ monitorFileName()

const char * OS::CommandLauncher::monitorFileName ( ) const
inline

◆ openTerminal()

static bool OS::CommandLauncher::openTerminal ( const char * cmd,
const BufferStringSet * args = nullptr,
BufferString * errmsg = nullptr,
uiString * launchermsg = nullptr,
const char * workdir = nullptr )
static

◆ processID()

PID_Type OS::CommandLauncher::processID ( ) const

◆ reset()

void OS::CommandLauncher::reset ( )
protected

◆ set()

void OS::CommandLauncher::set ( const MachineCommand & )

◆ startDetached()

bool OS::CommandLauncher::startDetached ( const MachineCommand & ,
bool inconsole = false,
const char * workingdir = nullptr )
protected

◆ startMonitor()

void OS::CommandLauncher::startMonitor ( )
protected

◆ startServer()

bool OS::CommandLauncher::startServer ( bool inpythonenv = false,
const char * stdoutfnm = nullptr,
const char * stderrfnm = nullptr,
double maxwaittm = 20 )

Member Data Documentation

◆ errmsg_

uiString OS::CommandLauncher::errmsg_
protected

◆ exitcode_

int OS::CommandLauncher::exitcode_ = Values::Undef< int >::val()
protected

◆ machcmd_

MachineCommand OS::CommandLauncher::machcmd_
protected

◆ monitorfnm_

BufferString OS::CommandLauncher::monitorfnm_
protected

◆ odprogressviewer_

const BufferString OS::CommandLauncher::odprogressviewer_
protected

◆ pid_

PID_Type OS::CommandLauncher::pid_ = 0
protected

◆ process_

QProcess* OS::CommandLauncher::process_ = nullptr
protected

◆ progvwrcmd_

BufferString OS::CommandLauncher::progvwrcmd_
protected

◆ stderror_

od_istream* OS::CommandLauncher::stderror_ = nullptr
protected

◆ stderrorbuf_

qstreambuf* OS::CommandLauncher::stderrorbuf_ = nullptr
protected

◆ stdinput_

od_ostream* OS::CommandLauncher::stdinput_ = nullptr
protected

◆ stdinputbuf_

qstreambuf* OS::CommandLauncher::stdinputbuf_ = nullptr
protected

◆ stdoutput_

od_istream* OS::CommandLauncher::stdoutput_ = nullptr
protected

◆ stdoutputbuf_

qstreambuf* OS::CommandLauncher::stdoutputbuf_ = nullptr
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2025