wex  v21.10.0
Public Member Functions | List of all members
wex::factory::process Class Reference

This class offers core process. More...

#include <wex/factory/process.h>

Inheritance diagram for wex::factory::process:
Inheritance graph
[legend]

Public Member Functions

 process ()
 Default constructor.
 
virtual ~process ()
 Destructor, stops running process.
 
virtual bool async_system (const std::string &exe, const std::string &start_dir=std::string())
 Virtual interface. More...
 
const auto & get_exe () const
 Other methods. More...
 
const auto & get_stderr () const
 Returns the stderr.
 
const auto & get_stdout () const
 Returns the stdout.
 
bool is_debug () const
 Is this a debug process.
 
bool is_running () const
 Is this process running.
 
void set_handler_dbg (wxEvtHandler *eh)
 Sets debug event handler.
 
void set_handler_out (wxEvtHandler *eh)
 Sets out event handler.
 
int system (const std::string &exe, const std::string &start_dir=std::string())
 Runs the sync process, collecting output in stdout and stderr. More...
 

Detailed Description

This class offers core process.

Member Function Documentation

◆ async_system()

virtual bool wex::factory::process::async_system ( const std::string &  exe,
const std::string &  start_dir = std::string() 
)
virtual

Virtual interface.

Starts the async process, collecting output into the out handler, and debug info in debug handler. You should have called set_handler_out or dbg before to set these. The output streams of the executing process are sent to these event handlers using wxPostEvent. Returns true if the async process is started.

Reimplemented in wex::process.

◆ get_exe()

const auto& wex::factory::process::get_exe ( ) const
inline

Other methods.

Returns last or current exe.

◆ system()

int wex::factory::process::system ( const std::string &  exe,
const std::string &  start_dir = std::string() 
)

Runs the sync process, collecting output in stdout and stderr.

It will execute the process and wait for it's exit, then return the exit_code.