]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mstream.h
converted to 16 colors
[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/////////////////////////////////////////////////////////////////////////////
34138703
JS
11#ifndef _WX_WXMMSTREAM_H__
12#define _WX_WXMMSTREAM_H__
32fc4afb 13
79c3e0e1 14#include <wx/stream.h>
32fc4afb 15
ce4169a4
RR
16#if wxUSE_STREAMS
17
75ed1d15 18class wxMemoryInputStream: public wxInputStream {
18c07b73
VS
19 private:
20 size_t m_length;
21
32fc4afb 22 public:
79c3e0e1
GL
23 wxMemoryInputStream(const char *data, size_t length);
24 virtual ~wxMemoryInputStream();
cd25b18c 25 virtual size_t GetSize() const { return m_length; }
79c3e0e1 26
32a4b1d5 27 char Peek();
c980c992 28
0d631778
GL
29 wxStreamBuffer *InputStreamBuffer() const { return m_i_streambuf; }
30
c980c992
GL
31 protected:
32 wxStreamBuffer *m_i_streambuf;
33
34 protected:
35 size_t OnSysRead(void *buffer, size_t nbytes);
36 off_t OnSysSeek(off_t pos, wxSeekMode mode);
37 off_t OnSysTell() const;
32fc4afb
GL
38};
39
75ed1d15 40class wxMemoryOutputStream: public wxOutputStream {
32fc4afb 41 public:
79c3e0e1
GL
42 wxMemoryOutputStream(char *data = NULL, size_t length = 0);
43 virtual ~wxMemoryOutputStream();
cd25b18c 44 virtual size_t GetSize() const { return m_o_streambuf->GetLastAccess(); }
0d631778
GL
45
46 wxStreamBuffer *OutputStreamBuffer() const { return m_o_streambuf; }
c980c992 47
a324a7bc
GL
48 size_t CopyTo(char *buffer, size_t len) const;
49
c980c992
GL
50 protected:
51 wxStreamBuffer *m_o_streambuf;
52
53 protected:
54 size_t OnSysWrite(const void *buffer, size_t nbytes);
55 off_t OnSysSeek(off_t pos, wxSeekMode mode);
56 off_t OnSysTell() const;
32fc4afb
GL
57};
58
32fc4afb 59#endif
ce4169a4
RR
60 // wxUSE_STREAMS
61
62#endif
cc985fac
PA
63 // _WX_WXMMSTREAM_H__
64