X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/764471557e06c8816b8cc8eb9924a1e3c78509d8..51146826fc0a0a949d88f23fb9d83fc1f1ada14e:/src/common/mstream.cpp diff --git a/src/common/mstream.cpp b/src/common/mstream.cpp index b9fef96e8c..24252d273c 100644 --- a/src/common/mstream.cpp +++ b/src/common/mstream.cpp @@ -42,6 +42,8 @@ // wxMemoryInputStream // ---------------------------------------------------------------------------- +IMPLEMENT_ABSTRACT_CLASS(wxMemoryInputStream, wxInputStream) + wxMemoryInputStream::wxMemoryInputStream(const void *data, size_t len) { m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read); @@ -97,6 +99,11 @@ wxMemoryInputStream::InitFromStream(wxInputStream& stream, wxFileOffset lenFile) m_length = stream.LastRead(); } +bool wxMemoryInputStream::CanRead() const +{ + return m_i_streambuf->GetIntPosition() != m_length; +} + wxMemoryInputStream::~wxMemoryInputStream() { delete m_i_streambuf; @@ -146,6 +153,8 @@ wxFileOffset wxMemoryInputStream::OnSysTell() const // wxMemoryOutputStream // ---------------------------------------------------------------------------- +IMPLEMENT_DYNAMIC_CLASS(wxMemoryOutputStream, wxOutputStream) + wxMemoryOutputStream::wxMemoryOutputStream(void *data, size_t len) { m_o_streambuf = new wxStreamBuffer(wxStreamBuffer::write);