]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/unix/private/pipestream.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/unix/private/pipestream.h
3 // Purpose: Unix wxPipeInputStream and wxPipeOutputStream declarations
4 // Author: Vadim Zeitlin
5 // Created: 2013-06-08 (extracted from wx/unix/pipe.h)
6 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_UNIX_PRIVATE_PIPESTREAM_H_
11 #define _WX_UNIX_PRIVATE_PIPESTREAM_H_
13 #include "wx/wfstream.h"
15 class wxPipeInputStream
: public wxFileInputStream
18 wxEXPLICIT
wxPipeInputStream(int fd
) : wxFileInputStream(fd
) { }
20 // return true if the pipe is still opened
21 bool IsOpened() const { return !Eof(); }
23 // return true if we have anything to read, don't block
24 virtual bool CanRead() const;
27 class wxPipeOutputStream
: public wxFileOutputStream
30 wxPipeOutputStream(int fd
) : wxFileOutputStream(fd
) { }
32 // Override the base class version to ignore "pipe full" errors: this is
33 // not an error for this class.
34 size_t OnSysWrite(const void *buffer
, size_t size
);
37 #endif // _WX_UNIX_PRIVATE_PIPESTREAM_H_