fixed input stream
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2042 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
58a33cb4e6
commit
18c07b73c6
@ -14,9 +14,13 @@
|
|||||||
#include <wx/stream.h>
|
#include <wx/stream.h>
|
||||||
|
|
||||||
class wxMemoryInputStream: public wxInputStream {
|
class wxMemoryInputStream: public wxInputStream {
|
||||||
|
private:
|
||||||
|
size_t m_length;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMemoryInputStream(const char *data, size_t length);
|
wxMemoryInputStream(const char *data, size_t length);
|
||||||
virtual ~wxMemoryInputStream();
|
virtual ~wxMemoryInputStream();
|
||||||
|
virtual size_t StreamSize() const { return m_length; }
|
||||||
|
|
||||||
char Peek();
|
char Peek();
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,9 @@ wxMemoryInputStream::wxMemoryInputStream(const char *data, size_t len)
|
|||||||
: wxInputStream()
|
: wxInputStream()
|
||||||
{
|
{
|
||||||
m_i_streambuf->SetBufferIO((char*) data, (char*) (data+len));
|
m_i_streambuf->SetBufferIO((char*) data, (char*) (data+len));
|
||||||
|
m_i_streambuf->SetIntPosition(0); // seek to start pos
|
||||||
m_i_streambuf->Fixed(TRUE);
|
m_i_streambuf->Fixed(TRUE);
|
||||||
|
m_length = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryInputStream::~wxMemoryInputStream()
|
wxMemoryInputStream::~wxMemoryInputStream()
|
||||||
|
Loading…
Reference in New Issue
Block a user