]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/unix/pipe.h
removed duplicated code from dynlib.h and dynload.h
[wxWidgets.git] / include / wx / unix / pipe.h
index a142b752a98585d3c1034bb3bae157e908047ce8..972113ae368efe33a96e401e42dee6dccd9319d0 100644 (file)
@@ -14,6 +14,9 @@
 
 #include <unistd.h>
 
+#include "wx/log.h"
+#include "wx/intl.h"
+
 // ----------------------------------------------------------------------------
 // wxPipe: this class encapsulates pipe() system call
 // ----------------------------------------------------------------------------
@@ -91,5 +94,27 @@ private:
     int m_fds[2];
 };
 
+#if wxUSE_STREAMS
+
+#include "wx/wfstream.h"
+
+// ----------------------------------------------------------------------------
+// wxPipeInputStream: stream for reading from a pipe
+// ----------------------------------------------------------------------------
+
+class wxPipeInputStream : public wxFileInputStream
+{
+public:
+    wxPipeInputStream(int fd) : wxFileInputStream(fd) { }
+
+    // return TRUE if the pipe is still opened
+    bool IsOpened() const { return !Eof(); }
+
+    // return TRUE if we have anything to read, don't block
+    virtual bool CanRead() const;
+};
+
+#endif // wxUSE_STREAMS
+
 #endif // _WX_UNIX_PIPE_H_