]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mstream.h
no message
[wxWidgets.git] / include / wx / mstream.h
CommitLineData
32fc4afb
GL
1/////////////////////////////////////////////////////////////////////////////
2// Name: mstream.h
3// Purpose: Memory stream classes
4// Author: Guilhem Lavaux
5// Modified by:
6// Created: 11/07/98
7// RCS-ID: $Id$
8// Copyright: (c) Guilhem Lavaux
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
83141d3a 11
34138703
JS
12#ifndef _WX_WXMMSTREAM_H__
13#define _WX_WXMMSTREAM_H__
32fc4afb 14
ed58dbea 15#include "wx/stream.h"
32fc4afb 16
ce4169a4
RR
17#if wxUSE_STREAMS
18
83141d3a
VZ
19class WXDLLEXPORT wxMemoryInputStream : public wxInputStream
20{
21public:
22 wxMemoryInputStream(const char *data, size_t length);
23 virtual ~wxMemoryInputStream();
24 virtual size_t GetSize() const { return m_length; }
25 virtual bool Eof() const;
26
27 char Peek();
79c3e0e1 28
83141d3a 29 wxStreamBuffer *InputStreamBuffer() const { return m_i_streambuf; }
c980c992 30
83141d3a
VZ
31protected:
32 wxStreamBuffer *m_i_streambuf;
0d631778 33
83141d3a
VZ
34 size_t OnSysRead(void *buffer, size_t nbytes);
35 off_t OnSysSeek(off_t pos, wxSeekMode mode);
36 off_t OnSysTell() const;
c980c992 37
83141d3a
VZ
38private:
39 size_t m_length;
32fc4afb
GL
40};
41
83141d3a
VZ
42class WXDLLEXPORT wxMemoryOutputStream : public wxOutputStream
43{
44public:
45 wxMemoryOutputStream(char *data = NULL, size_t length = 0);
46 virtual ~wxMemoryOutputStream();
47 virtual size_t GetSize() const { return m_o_streambuf->GetLastAccess(); }
0d631778 48
83141d3a 49 wxStreamBuffer *OutputStreamBuffer() const { return m_o_streambuf; }
c980c992 50
83141d3a 51 size_t CopyTo(char *buffer, size_t len) const;
a324a7bc 52
83141d3a
VZ
53protected:
54 wxStreamBuffer *m_o_streambuf;
c980c992 55
83141d3a
VZ
56protected:
57 size_t OnSysWrite(const void *buffer, size_t nbytes);
58 off_t OnSysSeek(off_t pos, wxSeekMode mode);
59 off_t OnSysTell() const;
32fc4afb
GL
60};
61
32fc4afb 62#endif
ce4169a4
RR
63 // wxUSE_STREAMS
64
65#endif
cc985fac
PA
66 // _WX_WXMMSTREAM_H__
67