hmbdc
simplify-high-performance-messaging-programming
Public Member Functions | Public Attributes | List of all members
hmbdc::os::ExecutionIo Struct Reference

execute a program as a child and capture its stdin stdout and/or stderr More...

#include <ExecutionIo.hpp>

Public Member Functions

 ExecutionIo (const char *const argv[], bool captureStderr=false)
 execute a program as a child and capture its stdin stdout and/or stderr More...
 
ExecutionIooperator<< (char const *input)
 
ExecutionIooperator<< (string const &input)
 
ExecutionIooperator>> (string &output)
 
ExecutionIoreadErr (string &output)
 

Public Attributes

int exeStdinFd
 child stdin fd, use write on it - not read More...
 
int exeStdoutFd
 child stdout fd, use read on it - not write More...
 
int exeStderrFd
 if captured, child stderr fd, use read on it - not write More...
 
pid_t exePid
 process id of the started child process
 

Detailed Description

execute a program as a child and capture its stdin stdout and/or stderr

IO are exposed in the fd form

Constructor & Destructor Documentation

hmbdc::os::ExecutionIo::ExecutionIo ( const char *const  argv[],
bool  captureStderr = false 
)

execute a program as a child and capture its stdin stdout and/or stderr

Parameters
argvullptr terminated command line args array, for example, {"/usr/bin/bc", "-q", nullptr}
captureStderroptionally capture

Member Data Documentation

int hmbdc::os::ExecutionIo::exeStderrFd

if captured, child stderr fd, use read on it - not write

blocking by default

int hmbdc::os::ExecutionIo::exeStdinFd

child stdin fd, use write on it - not read

blocking by default

int hmbdc::os::ExecutionIo::exeStdoutFd

child stdout fd, use read on it - not write

blocking by default


The documentation for this struct was generated from the following file: