Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

wvpipe.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * Provides support for piping data to/from subprocesses.
00006  */ 
00007 #ifndef __WVPIPE_H
00008 #define __WVPIPE_H
00009 
00010 #include "wvfdstream.h"
00011 #include "wvsubproc.h"
00012 
00032 class WvPipe : public WvFDStream
00033 {
00034     WvSubProc proc;
00035 protected:
00036     void setup(const char *program, const char * const *argv,
00037                bool writable, bool readable, bool catch_stderr,
00038                int stdin_fd, int stdout_fd, int stderr_fd);
00039 public:
00049     WvPipe(const char *program, const char * const *argv,
00050            bool writable, bool readable, bool catch_stderr,
00051            int stdin_fd = 0, int stdout_fd = 1, int stderr_fd = 2);
00052     
00066     WvPipe(const char *program, const char * const *argv,
00067            bool writable, bool readable, bool catch_stderr,
00068            WvFDStream *stdin_str, WvFDStream *stdout_str = NULL,
00069            WvFDStream *stderr_str = NULL);
00070     
00075     WvPipe(const char *program, const char **argv,
00076            bool writable, bool readable, bool catch_stderr,
00077            WvFDStream *stdio_str);
00078 
00080     virtual ~WvPipe();
00081 
00086     void kill(int signum);
00087     
00089     int finish(bool wait_children = true);
00090     
00092     bool child_exited();
00093 
00095     bool child_killed() const;
00096     
00102     int exit_status();
00103 
00104     // returns pid
00105     int getpid() const { return proc.pid; };
00106 
00107     // callback to ignore everything.  see comment in wvpipe.cc.
00108     static void ignore_read(WvStream& s, void *userdata);
00109 };
00110 
00111 #endif // __WVPIPE_H

Generated on Sun Jul 10 15:30:22 2005 for WvStreams by  doxygen 1.4.0