added wxMemoryInputStream(wxMemoryOutputStream&) ctor (patch 1170635)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-04-02 22:37:58 +00:00
parent 1cd555d2de
commit 96461cc29d
5 changed files with 55 additions and 0 deletions

View File

@@ -52,6 +52,22 @@ wxMemoryInputStream::wxMemoryInputStream(const void *data, size_t len)
m_length = len;
}
wxMemoryInputStream::wxMemoryInputStream(const wxMemoryOutputStream& stream)
{
int len = stream.GetLength();
if (len == wxInvalidOffset) {
m_i_streambuf = NULL;
m_lasterror = wxSTREAM_EOF;
return;
}
m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
m_i_streambuf->SetBufferIO(len); // create buffer
stream.CopyTo(m_i_streambuf->GetBufferStart(), len);
m_i_streambuf->SetIntPosition(0); // seek to start pos
m_i_streambuf->Fixed(true);
m_length = len;
}
wxMemoryInputStream::~wxMemoryInputStream()
{
delete m_i_streambuf;