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:
73
src/common/stream.cpp
Normal file
73
src/common/stream.cpp
Normal 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()
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user