]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/private/pipestream.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / msw / private / pipestream.h
CommitLineData
bfabc7f4
VZ
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)
bfabc7f4
VZ
6// Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
7// Licence: wxWindows licence
8///////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_MSW_PRIVATE_PIPESTREAM_H_
11#define _WX_MSW_PRIVATE_PIPESTREAM_H_
12
13class wxPipeInputStream : public wxInputStream
14{
15public:
16 wxEXPLICIT wxPipeInputStream(HANDLE hInput);
17 virtual ~wxPipeInputStream();
18
19 // returns true if the pipe is still opened
20 bool IsOpened() const { return m_hInput != INVALID_HANDLE_VALUE; }
21
22 // returns true if there is any data to be read from the pipe
23 virtual bool CanRead() const;
24
25protected:
26 virtual size_t OnSysRead(void *buffer, size_t len);
27
28protected:
29 HANDLE m_hInput;
30
31 wxDECLARE_NO_COPY_CLASS(wxPipeInputStream);
32};
33
34class wxPipeOutputStream: public wxOutputStream
35{
36public:
37 wxEXPLICIT wxPipeOutputStream(HANDLE hOutput);
38 virtual ~wxPipeOutputStream() { Close(); }
39 bool Close();
40
41protected:
42 size_t OnSysWrite(const void *buffer, size_t len);
43
44protected:
45 HANDLE m_hOutput;
46
47 wxDECLARE_NO_COPY_CLASS(wxPipeOutputStream);
48};
49
50#endif // _WX_MSW_PRIVATE_PIPESTREAM_H_