]> git.saurik.com Git - wxWidgets.git/blame - src/common/stream.cpp
IsModified() function now works correctly
[wxWidgets.git] / src / common / stream.cpp
CommitLineData
3d4c6a21
GL
1/////////////////////////////////////////////////////////////////////////////
2// Name: stream.cpp
3// Purpose: wxStream base classes
4// Author: Guilhem Lavaux
5// Modified by:
6// Created: 11/07/98
7// RCS-ID: $Id$
8// Copyright: (c) Guilhem Lavaux
9// Licence: wxWindows license
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "stream.h"
14#endif
15
db138a4c
JS
16// For compilers that support precompilation, includes "wx.h".
17#include "wx/wxprec.h"
79c3e0e1 18#include <wx/stream.h>
db138a4c
JS
19
20#ifdef __BORLANDC__
21#pragma hdrstop
22#endif
23
3d4c6a21 24wxInputStream::wxInputStream()
3d4c6a21
GL
25{
26}
27
28wxInputStream::~wxInputStream()
29{
30}
31
32#define BUF_TEMP_SIZE 10000
33
34wxInputStream& wxInputStream::Read(wxOutputStream& stream_out)
35{
36 char buf[BUF_TEMP_SIZE];
37 size_t bytes_read = BUF_TEMP_SIZE;
38
39 while (bytes_read == BUF_TEMP_SIZE && !stream_out.Bad()) {
40 bytes_read = Read(buf, bytes_read).LastRead();
41
42 stream_out.Write(buf, bytes_read);
43 }
44 return *this;
45}
46
47wxOutputStream::wxOutputStream()
3d4c6a21
GL
48{
49}
50
51wxOutputStream::~wxOutputStream()
52{
53}
54
55wxOutputStream& wxOutputStream::Write(wxInputStream& stream_in)
56{
57 stream_in.Read(*this);
58 return *this;
59}
60
61wxFilterInputStream::wxFilterInputStream(wxInputStream& stream)
62 : wxInputStream()
63{
219f895a 64 m_parent_i_stream = &stream;
3d4c6a21
GL
65}
66
67wxFilterInputStream::~wxFilterInputStream()
68{
69}
219f895a
RR
70
71wxFilterOutputStream::wxFilterOutputStream(wxOutputStream& stream)
72 : wxOutputStream()
73{
74 m_parent_o_stream = &stream;
75}
76
77wxFilterOutputStream::~wxFilterOutputStream()
78{
79}