X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2478fde622a16d25c66690af353dfdc37e7b582..5c2e93769956ec4a3ff1c6f02f8c2b492a13febd:/include/wx/unix/pipe.h diff --git a/include/wx/unix/pipe.h b/include/wx/unix/pipe.h index a142b752a9..972113ae36 100644 --- a/include/wx/unix/pipe.h +++ b/include/wx/unix/pipe.h @@ -14,6 +14,9 @@ #include +#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_