Added wxStream but I haven't tested them.

Modified wxDataStream.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guilhem Lavaux
1998-07-12 15:16:09 +00:00
parent 23f641681f
commit 3d4c6a214a
10 changed files with 378 additions and 54 deletions

73
src/common/stream.cpp Normal file
View File

@@ -0,0 +1,73 @@
/////////////////////////////////////////////////////////////////////////////
// Name: stream.cpp
// Purpose: wxStream base classes
// Author: Guilhem Lavaux
// Modified by:
// Created: 11/07/98
// RCS-ID: $Id$
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "stream.h"
#endif
#include <wx/object.h>
#include "stream.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxInputStream, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxOutputStream, wxObject)
IMPLEMENT_ABSTRACT_CLASS2(wxStream, wxInputStream, wxOutputStream)
IMPLEMENT_CLASS(wxFilterInputStream, wxInputStream)
#endif
wxInputStream::wxInputStream()
: wxObject()
{
}
wxInputStream::~wxInputStream()
{
}
#define BUF_TEMP_SIZE 10000
wxInputStream& wxInputStream::Read(wxOutputStream& stream_out)
{
char buf[BUF_TEMP_SIZE];
size_t bytes_read = BUF_TEMP_SIZE;
while (bytes_read == BUF_TEMP_SIZE && !stream_out.Bad()) {
bytes_read = Read(buf, bytes_read).LastRead();
stream_out.Write(buf, bytes_read);
}
return *this;
}
wxOutputStream::wxOutputStream()
: wxObject()
{
}
wxOutputStream::~wxOutputStream()
{
}
wxOutputStream& wxOutputStream::Write(wxInputStream& stream_in)
{
stream_in.Read(*this);
return *this;
}
wxFilterInputStream::wxFilterInputStream(wxInputStream& stream)
: wxInputStream()
{
m_parent_stream = &stream;
}
wxFilterInputStream::~wxFilterInputStream()
{
}