]> git.saurik.com Git - wxWidgets.git/blame - src/common/stream.cpp
constraints handling for the notebook pages fixed
[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
219f895a
RR
16#include "wx/object.h"
17#include "wx/stream.h"
3d4c6a21
GL
18
19#if !USE_SHARED_LIBRARY
20IMPLEMENT_ABSTRACT_CLASS(wxInputStream, wxObject)
21IMPLEMENT_ABSTRACT_CLASS(wxOutputStream, wxObject)
22IMPLEMENT_ABSTRACT_CLASS2(wxStream, wxInputStream, wxOutputStream)
23IMPLEMENT_CLASS(wxFilterInputStream, wxInputStream)
24#endif
25
26wxInputStream::wxInputStream()
27 : wxObject()
28{
29}
30
31wxInputStream::~wxInputStream()
32{
33}
34
35#define BUF_TEMP_SIZE 10000
36
37wxInputStream& wxInputStream::Read(wxOutputStream& stream_out)
38{
39 char buf[BUF_TEMP_SIZE];
40 size_t bytes_read = BUF_TEMP_SIZE;
41
42 while (bytes_read == BUF_TEMP_SIZE && !stream_out.Bad()) {
43 bytes_read = Read(buf, bytes_read).LastRead();
44
45 stream_out.Write(buf, bytes_read);
46 }
47 return *this;
48}
49
50wxOutputStream::wxOutputStream()
51 : wxObject()
52{
53}
54
55wxOutputStream::~wxOutputStream()
56{
57}
58
59wxOutputStream& wxOutputStream::Write(wxInputStream& stream_in)
60{
61 stream_in.Read(*this);
62 return *this;
63}
64
65wxFilterInputStream::wxFilterInputStream(wxInputStream& stream)
66 : wxInputStream()
67{
219f895a 68 m_parent_i_stream = &stream;
3d4c6a21
GL
69}
70
71wxFilterInputStream::~wxFilterInputStream()
72{
73}
219f895a
RR
74
75wxFilterOutputStream::wxFilterOutputStream(wxOutputStream& stream)
76 : wxOutputStream()
77{
78 m_parent_o_stream = &stream;
79}
80
81wxFilterOutputStream::~wxFilterOutputStream()
82{
83}