X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af8481937288aa79f67b5e7df3caeef5a7824248..75d3838010e2d8a9592a4a016e2994f4f0d3070b:/include/wx/unix/pipe.h diff --git a/include/wx/unix/pipe.h b/include/wx/unix/pipe.h index 93257ea456..972113ae36 100644 --- a/include/wx/unix/pipe.h +++ b/include/wx/unix/pipe.h @@ -94,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_