3DCoat
3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
|
Platform independent class for creating processes. More...
#include <cProcess.h>
Public Member Functions | |
_ExProcess (const comms::cStr &command, const comms::cStr &path=comms::cStr(), std::function< void(const char *bytes, size_t n)> read_stdout=nullptr, std::function< void(const char *bytes, size_t n)> read_stderr=nullptr, bool open_stdin=false, size_t buffer_size=131072) | |
Note on Windows: it seems not possible to specify which pipes to redirect. Thus, at the moment, if read_stdout==nullptr, read_stderr==nullptr and open_stdin==false, the stdout, stderr and stdin are sent to the parent process instead. More... | |
_ExProcess (std::function< void()> function, std::function< void(const char *bytes, size_t n)> read_stdout=nullptr, std::function< void(const char *bytes, size_t n)> read_stderr=nullptr, bool open_stdin=false, size_t buffer_size=131072) | |
Supported on Unix-like systems only. More... | |
id_type | get_id () |
Get the process id of the started process. More... | |
int | get_exit_status () |
Wait until process is finished, and return exit status. More... | |
bool | write (const char *bytes, size_t n) |
Write to stdin. More... | |
bool | write (const std::string &data) |
Write to stdin. Convenience function using write(const char *, size_t). More... | |
void | close_stdin () |
Close stdin. If the process takes parameters from stdin, use this to notify that all parameters have been sent. More... | |
void | kill (bool force=false) |
Kill the process. force=true is only supported on Unix-like systems. More... | |
Static Public Member Functions | |
static void | kill (id_type id, bool force=false) |
Kill a given process id. Use kill(bool force) instead if possible. force=true is only supported on Unix-like systems. More... | |
Platform independent class for creating processes.
_ExProcess::_ExProcess | ( | const comms::cStr & | command, |
const comms::cStr & | path = comms::cStr() , |
||
std::function< void(const char *bytes, size_t n)> | read_stdout = nullptr , |
||
std::function< void(const char *bytes, size_t n)> | read_stderr = nullptr , |
||
bool | open_stdin = false , |
||
size_t | buffer_size = 131072 |
||
) |
Note on Windows: it seems not possible to specify which pipes to redirect. Thus, at the moment, if read_stdout==nullptr, read_stderr==nullptr and open_stdin==false, the stdout, stderr and stdin are sent to the parent process instead.
_ExProcess::_ExProcess | ( | std::function< void()> | function, |
std::function< void(const char *bytes, size_t n)> | read_stdout = nullptr , |
||
std::function< void(const char *bytes, size_t n)> | read_stderr = nullptr , |
||
bool | open_stdin = false , |
||
size_t | buffer_size = 131072 |
||
) |
Supported on Unix-like systems only.
void _ExProcess::close_stdin | ( | ) |
Close stdin. If the process takes parameters from stdin, use this to notify that all parameters have been sent.
int _ExProcess::get_exit_status | ( | ) |
Wait until process is finished, and return exit status.
_ExProcess::id_type _ExProcess::get_id | ( | ) |
Get the process id of the started process.
void _ExProcess::kill | ( | bool | force = false | ) |
Kill the process. force=true is only supported on Unix-like systems.
Referenced by kill().
|
static |
Kill a given process id. Use kill(bool force) instead if possible. force=true is only supported on Unix-like systems.
References kill().
bool _ExProcess::write | ( | const char * | bytes, |
size_t | n | ||
) |
Write to stdin.
bool _ExProcess::write | ( | const std::string & | data | ) |
Write to stdin. Convenience function using write(const char *, size_t).