10 #include "wvfdstream.h"
11 #include "wvsubproc.h"
36 void setup(
const char *program,
const char *
const *argv,
37 bool writable,
bool readable,
bool catch_stderr,
38 int stdin_fd,
int stdout_fd,
int stderr_fd,
54 WvPipe(
const char *program,
const char *
const *argv,
55 bool writable,
bool readable,
bool catch_stderr,
56 int stdin_fd = 0,
int stdout_fd = 1,
int stderr_fd = 2,
72 WvPipe(
const char *program,
const char *
const *argv,
73 bool writable,
bool readable,
bool catch_stderr,
81 WvPipe(
const char *program,
const char **argv,
82 bool writable,
bool readable,
bool catch_stderr,
92 void kill(
int signum);
95 int finish(
bool wait_children =
true);
111 int getpid()
const {
return proc.pid; };
114 static void ignore_read(
WvStream &s);
117 const char *wstype()
const {
return "WvPipe"; }
int finish(bool wait_children=true)
wait for child to die.
bool child_exited()
returns true if child is dead.
Implementation of a WvPipe stream.
void kill(int signum)
send the child a signal (signal names are defined in signal.h)
virtual ~WvPipe()
kill the child process and close the stream.
WvPipe(const char *program, const char *const *argv, bool writable, bool readable, bool catch_stderr, int stdin_fd=0, int stdout_fd=1, int stderr_fd=2, WvStringList *env=NULL)
default pipe constructor; if you just want to use a pipe, use this.
Unified support for streams, that is, sequences of bytes that may or may not be ready for read/write ...
bool child_killed() const
returns true if child is dead because of a signal.
Base class for streams built on Unix file descriptors.
This is a WvList of WvStrings, and is a really handy way to parse strings.
int exit_status()
returns the exit status: if child_killed()==true, the signal that killed the child.