]>
git.saurik.com Git - wxWidgets.git/blob - src/common/stream.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStream base classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "stream.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
18 #include <wx/stream.h>
24 wxInputStream::wxInputStream()
28 wxInputStream::~wxInputStream()
32 #define BUF_TEMP_SIZE 10000
34 wxInputStream
& wxInputStream::Read(wxOutputStream
& stream_out
)
36 char buf
[BUF_TEMP_SIZE
];
37 size_t bytes_read
= BUF_TEMP_SIZE
;
39 while (bytes_read
== BUF_TEMP_SIZE
&& !stream_out
.Bad()) {
40 bytes_read
= Read(buf
, bytes_read
).LastRead();
42 stream_out
.Write(buf
, bytes_read
);
47 wxOutputStream::wxOutputStream()
51 wxOutputStream::~wxOutputStream()
55 wxOutputStream
& wxOutputStream::Write(wxInputStream
& stream_in
)
57 stream_in
.Read(*this);
61 wxFilterInputStream::wxFilterInputStream(wxInputStream
& stream
)
64 m_parent_i_stream
= &stream
;
67 wxFilterInputStream::~wxFilterInputStream()
71 wxFilterOutputStream::wxFilterOutputStream(wxOutputStream
& stream
)
74 m_parent_o_stream
= &stream
;
77 wxFilterOutputStream::~wxFilterOutputStream()