]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/private/pipestream.h
Reuse wxMessageOutputStderr for wxLogStderr implementation.
[wxWidgets.git] / include / wx / msw / private / pipestream.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/private/pipestream.h
3 // Purpose: MSW wxPipeInputStream and wxPipeOutputStream declarations
4 // Author: Vadim Zeitlin
5 // Created: 2013-06-08 (extracted from src/msw/utilsexc.cpp)
6 // RCS-ID: $Id$
7 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_MSW_PRIVATE_PIPESTREAM_H_
12 #define _WX_MSW_PRIVATE_PIPESTREAM_H_
13
14 class wxPipeInputStream : public wxInputStream
15 {
16 public:
17 wxEXPLICIT wxPipeInputStream(HANDLE hInput);
18 virtual ~wxPipeInputStream();
19
20 // returns true if the pipe is still opened
21 bool IsOpened() const { return m_hInput != INVALID_HANDLE_VALUE; }
22
23 // returns true if there is any data to be read from the pipe
24 virtual bool CanRead() const;
25
26 protected:
27 virtual size_t OnSysRead(void *buffer, size_t len);
28
29 protected:
30 HANDLE m_hInput;
31
32 wxDECLARE_NO_COPY_CLASS(wxPipeInputStream);
33 };
34
35 class wxPipeOutputStream: public wxOutputStream
36 {
37 public:
38 wxEXPLICIT wxPipeOutputStream(HANDLE hOutput);
39 virtual ~wxPipeOutputStream() { Close(); }
40 bool Close();
41
42 protected:
43 size_t OnSysWrite(const void *buffer, size_t len);
44
45 protected:
46 HANDLE m_hOutput;
47
48 wxDECLARE_NO_COPY_CLASS(wxPipeOutputStream);
49 };
50
51 #endif // _WX_MSW_PRIVATE_PIPESTREAM_H_